debug: add a new textDocument/previewParseTree command #1

Open
opened 2026-07-29 14:55:51 +02:00 by thibault · 0 comments
Owner

I want to (long term) make contributions to Texlab. However, I cannot make sense of their parser. So, add a new LSP command/endpoint to get a JSON or tree-like representation of the parsed syntax tree for a file. It could be called textDocument/previewParseTree as suggested in the title of the issue, or something else. Needs to signal the command is relative to the document only, so maybe keep the textDocument prefix ?

Clangd does this for the C++ AST using the textDocument/ast method. Links to:

I want to (long term) make contributions to Texlab. However, I cannot make sense of their parser. So, add a new LSP command/endpoint to get a JSON or tree-like representation of the parsed syntax tree for a file. It could be called `textDocument/previewParseTree` as suggested in the title of the issue, or something else. Needs to signal the command is relative to the document only, so maybe keep the `textDocument` prefix ? Clangd does this for the C++ AST using the `textDocument/ast` method. Links to: - their implementation: - entrypoint in the main LSP process: https://github.com/llvm/llvm-project/blob/f43c0e2dac8d75362a07e283f44ae20339cd1de2/clang-tools-extra/clangd/ClangdLSPServer.cpp#L1657-L1660 - `Server::getAST` function: https://github.com/llvm/llvm-project/blob/f43c0e2dac8d75362a07e283f44ae20339cd1de2/clang-tools-extra/clangd/ClangdServer.cpp#L1084-L1121 - their documentation: https://clangd.llvm.org/extensions#ast
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thibault/texlab#1
No description provided.