use of org.apache.flex.compiler.mxml.IMXMLTagData in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptTextDocumentService method getDefinitionForMXMLTag.
private IDefinition getDefinitionForMXMLTag(IMXMLTagData tag) {
if (tag == null) {
return null;
}
IDefinition offsetDefinition = currentProject.resolveXMLNameToDefinition(tag.getXMLName(), tag.getMXMLDialect());
if (offsetDefinition != null) {
return offsetDefinition;
}
if (tag.getXMLName().getXMLNamespace().equals(tag.getMXMLDialect().getLanguageNamespace())) {
for (String typeName : LANGUAGE_TYPE_NAMES) {
if (tag.getShortName().equals(typeName)) {
return currentProject.resolveQNameToDefinition(typeName);
}
}
}
IMXMLTagData parentTag = tag.getParentTag();
if (parentTag == null) {
return null;
}
IDefinition parentDefinition = currentProject.resolveXMLNameToDefinition(parentTag.getXMLName(), parentTag.getMXMLDialect());
if (parentDefinition == null || !(parentDefinition instanceof IClassDefinition)) {
return null;
}
IClassDefinition classDefinition = (IClassDefinition) parentDefinition;
return currentProject.resolveSpecifier(classDefinition, tag.getShortName());
}
use of org.apache.flex.compiler.mxml.IMXMLTagData in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptTextDocumentService method references.
/**
* Finds all references of the definition referenced at the current position
* in a text document. Does not necessarily get called where a definition is
* defined, but may be at one of the references.
*/
@Override
public CompletableFuture<List<? extends Location>> references(ReferenceParams params) {
String textDocumentUri = params.getTextDocument().getUri();
if (!textDocumentUri.endsWith(AS_EXTENSION) && !textDocumentUri.endsWith(MXML_EXTENSION)) {
return CompletableFuture.completedFuture(Collections.emptyList());
}
IMXMLTagData offsetTag = getOffsetMXMLTag(params);
if (offsetTag != null) {
IASNode embeddedNode = getEmbeddedActionScriptNodeInMXMLTag(offsetTag, currentOffset, params.getTextDocument(), params.getPosition());
if (embeddedNode != null) {
return actionScriptReferencesWithNode(params, embeddedNode);
}
//so that's why we call isMXMLTagValidForCompletion()
if (isMXMLTagValidForCompletion(offsetTag)) {
return mxmlReferences(params, offsetTag);
}
}
return actionScriptReferences(params);
}
Aggregations