@Override
    public int getEndOffset() {
        switch (language) {
            case SCHEMA:
                if (originalSchemaNode == null) return -1;
                return originalSchemaNode.getEndOffset();
            case INDEXING:
                if (originalIndexingNode == null) return -1;
                return originalIndexingNode.getEndOffset();
            case RANK_EXPRESSION:
                if (originalRankExpressionNode == null) return -1;
                return originalRankExpressionNode.getEndOffset();
            default:
                return -1;
        }
    }
SchemaNode represents a node in the AST of a file the language server parses.
The node exposes a general interface to handle different AST from different parsers.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/tree/SchemaNode.java