private static Hover getSymbolHover(Node node, EventPositionContext context) {
        switch(node.getSymbol().getType()) {
            case STRUCT:
                return getStructHover(node, context);
            case FIELD:
                return getFieldHover(node, context);
            default:
                break;
        }

        if (node.getSymbol().getType() == SymbolType.LABEL) {
            return new Hover(new MarkupContent(MarkupKind.PLAINTEXT, "label"));
        }

        if (node.getSymbol().getStatus() == SymbolStatus.BUILTIN_REFERENCE) {
            return new Hover(new MarkupContent(MarkupKind.PLAINTEXT, "builtin"));
        }

        if (node.getSymbol().getStatus() == SymbolStatus.REFERENCE || node.getSymbol().getStatus() == SymbolStatus.DEFINITION) {
            Optional<Symbol> definition = context.schemaIndex.getSymbolDefinition(node.getSymbol());

            if (definition.isPresent()) {
                Node definitionNode = definition.get().getNode();

                if (definitionNode.getParent() != null) {
                    String text = definitionNode.getParent().getText();
                    String[] lines = text.split(System.lineSeparator());
                    String hoverContent = lines[0].trim();
                    while (hoverContent.length() > 0 && hoverContent.endsWith("{")) {
                        hoverContent = hoverContent.substring(0, hoverContent.length() - 1);
                    }
                    hoverContent = hoverContent.trim();
                    String documentContent = context.scheduler.getDocument(definition.get().getFileURI()).getCurrentContent();
                    Optional<String> documentationComments = getSymbolDocumentationComments(definitionNode, documentContent);

                    if (documentationComments.isPresent()) {
                        hoverContent = documentationComments.get() + "\n" + hoverContent;
                    }
                    if (hoverContent.length() > 0) {
                        // Render as code
                        return new Hover(new MarkupContent(MarkupKind.MARKDOWN, "```\n" + hoverContent + "\n```"));
                    }
                }
            }
        }

        return null;
    }
Special handling of field hover to also list which indexing settings are set (index | attribute | summary)
as well as whether the field is inside or outside its document.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/hover/SchemaHover.java