Skip to content

Commit aed0eb2

Browse files
committed
language-server: fix MXML instances being included when getting embedded AS3 nodes in MXML specifiers
This could lead to iterating over the same nodes more than once because the specifiers are children of the instance.
1 parent 6356f43 commit aed0eb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

language-server/src/main/java/com/as3mxml/vscode/utils/ActionScriptProjectManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.apache.royale.compiler.tree.mxml.IMXMLNode;
4949
import org.apache.royale.compiler.tree.mxml.IMXMLPropertySpecifierNode;
5050
import org.apache.royale.compiler.tree.mxml.IMXMLSingleDataBindingNode;
51+
import org.apache.royale.compiler.tree.mxml.IMXMLSpecifierNode;
5152
import org.apache.royale.compiler.units.ICompilationUnit;
5253
import org.apache.royale.utils.FilenameNormalization;
5354
import org.eclipse.lsp4j.DocumentSymbol;
@@ -308,7 +309,7 @@ public List<IASNode> getEmbeddedActionScriptNodesInMXMLTag(IMXMLTagData tag, Pat
308309
continue;
309310
}
310311
IASNode offsetNode = getOffsetNode(path, attributeData.getAbsoluteStart(), projectData);
311-
if (offsetNode == null) {
312+
if (offsetNode == null || !(offsetNode instanceof IMXMLSpecifierNode)) {
312313
continue;
313314
}
314315
IClassDefinition tagDefinition = (IClassDefinition) resolvedDefinition;

0 commit comments

Comments
 (0)