public static List<Location> getDefinition(EventPositionContext context) {
        ArrayList<Location> ret = new ArrayList<Location>();

        Node node = CSTUtils.getSymbolAtPosition(context.document.getRootNode(), context.position);

        if (node == null || !node.hasSymbol()) {
            return ret;
        }

        Symbol search = node.getSymbol();

        // Try the faster search first
        Optional<Symbol> results = context.schemaIndex.getNextSymbolDefinition(search);

        if (results.isEmpty() && search.getType() == SymbolType.DOCUMENT) {
            results = context.schemaIndex.findSymbol(search); 
        }

        if (results.isPresent()) {
            ret.add(results.get().getLocation());
        } else if (search.getStatus() == SymbolStatus.DEFINITION) {
            ret.add(search.getLocation());
        }

        return ret;
    }
Responsible for LSP textDocument/definition requests.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/definition/SchemaDefinition.java