Search in sources :

Example 11 with ITypeDefinition

use of org.apache.flex.compiler.definitions.ITypeDefinition in project vscode-nextgenas by BowlerHatLLC.

the class ActionScriptTextDocumentService method addDefinitionAutoCompleteMXML.

private void addDefinitionAutoCompleteMXML(IDefinition definition, String prefix, String uri, CompletionList result) {
    if (definition.getBaseName().startsWith(VECTOR_HIDDEN_PREFIX)) {
        return;
    }
    CompletionItem item = new CompletionItem();
    item.setKind(getDefinitionKind(definition));
    item.setDetail(getDefinitionDetail(definition));
    item.setLabel(definition.getBaseName());
    if (prefix != null) {
        item.setInsertText(prefix + IMXMLCoreConstants.colon + definition.getBaseName());
        if (definition instanceof ITypeDefinition && uri != null) {
            item.setCommand(createMXMLNamespaceCommand(definition, prefix, uri));
        }
    }
    result.getItems().add(item);
}
Also used : CompletionItem(org.eclipse.lsp4j.CompletionItem) ITypeDefinition(org.apache.flex.compiler.definitions.ITypeDefinition)

Aggregations

ITypeDefinition (org.apache.flex.compiler.definitions.ITypeDefinition)11 IDefinition (org.apache.flex.compiler.definitions.IDefinition)10 FileNotFoundException (java.io.FileNotFoundException)4 IOException (java.io.IOException)4 ConcurrentModificationException (java.util.ConcurrentModificationException)4 IFunctionDefinition (org.apache.flex.compiler.definitions.IFunctionDefinition)4 IASScope (org.apache.flex.compiler.scopes.IASScope)4 ICompilationUnit (org.apache.flex.compiler.units.ICompilationUnit)4 IClassDefinition (org.apache.flex.compiler.definitions.IClassDefinition)3 IVariableDefinition (org.apache.flex.compiler.definitions.IVariableDefinition)3 CompletionItem (org.eclipse.lsp4j.CompletionItem)3 ArrayList (java.util.ArrayList)2 IEventDefinition (org.apache.flex.compiler.definitions.IEventDefinition)2 IInterfaceDefinition (org.apache.flex.compiler.definitions.IInterfaceDefinition)2 IPackageDefinition (org.apache.flex.compiler.definitions.IPackageDefinition)2 IParameterDefinition (org.apache.flex.compiler.definitions.IParameterDefinition)2 ASScope (org.apache.flex.compiler.internal.scopes.ASScope)2 TypeScope (org.apache.flex.compiler.internal.scopes.TypeScope)2 IExpressionNode (org.apache.flex.compiler.tree.as.IExpressionNode)2 PrefixMap (org.apache.flex.compiler.common.PrefixMap)1