use of com.redhat.qute.services.definition.DefinitionRequest in project quarkus-ls by redhat-developer.
the class QuteDefinition method findDefinition.
public CompletableFuture<List<? extends LocationLink>> findDefinition(Template template, Position position, CancelChecker cancelChecker) {
try {
DefinitionRequest definitionRequest = new DefinitionRequest(template, position);
Node node = definitionRequest.getNode();
if (node == null) {
return NO_DEFINITION;
}
int offset = definitionRequest.getOffset();
switch(node.getKind()) {
case Section:
// - Java data model definition
return findDefinitionFromSection(offset, (Section) node, template, cancelChecker);
case ParameterDeclaration:
// Return Java class definition
return findDefinitionFromParameterDeclaration(offset, (ParameterDeclaration) node, template);
case Expression:
return findDefinitionFromExpression(offset, (Expression) node, template, cancelChecker);
case ExpressionPart:
Part part = (Part) node;
return findDefinitionFromPart(part, template, cancelChecker);
default:
// no definitions
return NO_DEFINITION;
}
} catch (BadLocationException e) {
LOGGER.log(Level.SEVERE, "Failed creating DefinitionRequest", e);
return NO_DEFINITION;
}
}
Aggregations