Bug 499788 - Enable JSDT Outline view in Neon

Make CompilationUnitStructureVisitor descend down AST past
FunctionInvocations. Previously, this would only occur for
functions declared at the top level, resulting in e.g. the
module design pattern not being outlined correctly.

Change-Id: Id19b521093e8ac2843ba4cb6807d64eab6a00415
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitStructureVisitor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitStructureVisitor.java
index 41b02ba..9b98d9c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitStructureVisitor.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnitStructureVisitor.java
@@ -141,8 +141,9 @@
 	}

 	

 	public boolean visit(FunctionInvocation node ){

-		JavaElement parentHandle= this.handleStack.peek();

-		return parentHandle.getElementType() == IJavaScriptElement.JAVASCRIPT_UNIT;

+		// We return true here to allow structure to be built for e.g.

+		// anonymous functions that define a namespace (see: module pattern)

+		return true;

 	}

 

 	public boolean visit(JavaScriptUnit node){