private static Optional<String> getSymbolDocumentationComments(Node node, String documentContent) {
        int offset = node.getBeginOffset();
        if (offset == -1) return Optional.empty();

        int linePointer = documentContent.lastIndexOf("\n", offset);

        List<String> comments = new LinkedList<>();
        while (linePointer != -1) {
            Optional<String> comment = getCommentOnLine(documentContent, linePointer);
            if (comment.isEmpty()) break;

            comments.add(0, comment.get());
            linePointer = documentContent.lastIndexOf("\n", linePointer - 1);
        }

        if (comments.isEmpty()) return Optional.empty();

        return Optional.of(String.join("\n", comments));
    }
Some definitions might have useful comments by them.
This function takes a node which should point to some node where a symbol is defined,
and returns optionally a string containing all contiguous comments above the definition, joined by newline.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/hover/SchemaHover.java