Iterate over LSP structure as like CDT AST iteration #157
-
I'm using the org.eclipse.cdt.core jar to parse the AST of a source. Sample AST Parser - git Source:int num = 10; AST:
Like this, can the Eclipse CDT LSP provide a similar kind of structure to iterate over the source with AST or any other structure? Does it currently have support for it? If no, is there any future plans to expose the structure? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
It's the job of the server to build and parse the AST to provide its services to cdt-lsp as a client. So currently the cdt-lsp has no use case to get and parse the AST. I don't know your use case but can documentSymbols do it for your purpose? Otherwise take a look on the clangd LSP protocol extension for AST: |
Beta Was this translation helpful? Give feedback.
This cannot be achieved with the current cdt-lsp. AFAIK there are not plans on this.
LSP is only the protocol. The C/C++ language server must support the standards.