use of org.apache.flex.compiler.mxml.IMXMLTagAttributeData in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptTextDocumentService method findMXMLUnits.
private void findMXMLUnits(IMXMLTagData tagData, IDefinition definition, List<ISourceLocation> result) {
IDefinition tagDefinition = currentProject.resolveXMLNameToDefinition(tagData.getXMLName(), tagData.getMXMLDialect());
if (tagDefinition != null && definition == tagDefinition) {
result.add(tagData);
}
if (tagDefinition instanceof IClassDefinition) {
IClassDefinition classDefinition = (IClassDefinition) tagDefinition;
IMXMLTagAttributeData[] attributes = tagData.getAttributeDatas();
for (IMXMLTagAttributeData attributeData : attributes) {
IDefinition attributeDefinition = currentProject.resolveSpecifier(classDefinition, attributeData.getShortName());
if (attributeDefinition != null && definition == attributeDefinition) {
result.add(attributeData);
}
}
}
IMXMLTagData childTag = tagData.getFirstChild(true);
while (childTag != null) {
if (childTag.isCloseTag()) {
//only open tags matter
continue;
}
findMXMLUnits(childTag, definition, result);
childTag = childTag.getNextSibling(true);
}
}
use of org.apache.flex.compiler.mxml.IMXMLTagAttributeData in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptTextDocumentService method getDefinitionForMXMLTagAttribute.
private IDefinition getDefinitionForMXMLTagAttribute(IMXMLTagData tag, int offset, boolean includeValue) {
IMXMLTagAttributeData attributeData = null;
if (includeValue) {
attributeData = getMXMLTagAttributeAtOffset(tag, offset);
} else {
attributeData = getMXMLTagAttributeWithNameAtOffset(tag, offset);
}
if (attributeData == null) {
return null;
}
IDefinition tagDefinition = getDefinitionForMXMLTag(tag);
if (tagDefinition != null && tagDefinition instanceof IClassDefinition) {
IClassDefinition classDefinition = (IClassDefinition) tagDefinition;
return currentProject.resolveSpecifier(classDefinition, attributeData.getShortName());
}
return null;
}
Aggregations