Nathan Ridge

Results 1174 comments of Nathan Ridge

The log shows: > Failed to find compilation database for /data1/zzb/code/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp What is the full path of the `compile_commands.json` file?

@zhanglistar Can you try symlinking it into `/data1/zzb/code/duckdb` and see it that helps?

Very strange. Clangd looks for the `compile_commands.json` in the ancestor directories of the file being opened, so if you're opening `/data1/zzb/code/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp`, it should look in `/data1/zzb/code/duckdb/src/include/duckdb/parser/statement/` and then `/data1/zzb/code/duckdb/src/include/duckdb/parser/` and...

Maybe try using the `--compile-commands-dir` command line argument to clangd, as discussed in [this FAQ entry](https://clangd.llvm.org/faq#how-do-i-fix-errors-i-get-when-opening-headers-outside-of-my-project-directory)?

In vscode settings, something like: ``` { "clangd.arguments": [ "--compile-commands-dir=/data1/zzb/code/duckdb/build" ] } ```

> @HighCommander4 This works! Yay! > So where is wrong? I'm not sure, sorry. Perhaps someone else can offer a hypothesis or suggest a way to investigate the original setup...

Based on previous discussions, e.g. https://github.com/clangd/clangd/issues/352#issuecomment-619442147: > Things that are easily lexically derived (such as preprocessor defines and doxygen tags) don't need to be in the language server I think....

> * have a generic, approximate parsing system (textmate, regex, ...) which, in my experience, doesn't get to the same level as a dedicated parser In my experience, the C++...

> Do you have tests/estimates of how much additional tokens "cost"? Rust Analyzer provides tokens for pretty much every character in a file, and it seems to be doing just...

I agree that clangd should follow the LSP, and cater to all clients not just VSCode (and we do try -- we have users happily using other clients such as...