use of org.apache.flex.compiler.tree.as.INamespaceDecorationNode in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptTextDocumentService method actionScriptHoverWithNode.
private CompletableFuture<Hover> actionScriptHoverWithNode(TextDocumentPositionParams position, IASNode offsetNode) {
IDefinition definition = null;
if (offsetNode == null) {
//we couldn't find a node at the specified location
return CompletableFuture.completedFuture(new Hover(Collections.emptyList(), null));
}
//any hover information for it.
if (definition == null && offsetNode instanceof IIdentifierNode && !(offsetNode instanceof INamespaceDecorationNode)) {
IIdentifierNode identifierNode = (IIdentifierNode) offsetNode;
definition = identifierNode.resolve(currentUnit.getProject());
}
if (definition == null) {
return CompletableFuture.completedFuture(new Hover(Collections.emptyList(), null));
}
Hover result = new Hover();
String detail = getDefinitionDetail(definition);
List<String> contents = new ArrayList<>();
contents.add(MARKDOWN_CODE_BLOCK_NEXTGENAS_START + detail + MARKDOWN_CODE_BLOCK_END);
result.setContents(contents);
return CompletableFuture.completedFuture(result);
}
Aggregations