1

I'm writing a vscode extension, which is trying to communicate with vscode-clangd extension. I need the AST from a cpp file, more precisely the type with occurences in file of a selected variable, however

  • I can't call the clangd.ast command, because there are only restart, check for update, download language server commands, also if I run the code
    let clangdExt = vscode.extensions.getExtension('llvm-vs-code-extensions.vscode-clangd');
    activating or not the extension itself
    console.log('Exports: ' + clangdExt?.exports);
    shows exports is undefined.
  • I couldn't find a way to parse the clangd outputchannel, which outputs lsp messages from communication between the active vscode-clangd extension and the clangd daemon.
Syn0n
  • 11
  • 3
  • "Show AST" clangd.ast support is available in extension clangd v12 or higher. I have tried the latest [rc2](https://github.com/clangd/clangd/releases/tag/12.0.0-rc2) and it works fine. Couldn't find a way to call exported functions from clangd, but the extension [source](https://github.com/clangd/vscode-clangd) is very useful to create an lsp client for clangd daemon. – Syn0n Mar 30 '21 at 22:50

0 Answers0