HighCommander4 wrote:

> > the new behaviour that clangd looks for such a file there even for files 
> > outside the workspace directory is basically a no-op.
> 
> Does this impact indexing files located outside of the projects but are 
> `#include`ed in the project?

I think clangd today stores index data for such files in 
`$HOME/.cache/clangd/index`, which is not very intuitive in my opinion. With 
strong workspace mode, it would store them in 
`<workspace_root>/.cache/clangd/index`.

> > the new behaviour that clangd looks for such a file there even for files 
> > outside the workspace directory is basically a no-op. Clangd will continue 
> > using the sub-project compile_commands.json files based on 
> > ancestor-directory lookup just as it did before.
> 
> So as long as an open file is in one of these `compile_commands.json`, clangd 
> will use that for indexing, correct? How will indexing for included files 
> (from outside of the project) be handled? For example, one subproject's 
> macros (say, `USE_WAYLAND` vs `USE_XCB`) could expose symbols differently 
> when including a system header.

Other than the index storage location being 
`<workspace_root>/.cache/clangd/index`, I would expect it to work the same as 
it does today without strong workspace mode.

https://github.com/llvm/llvm-project/pull/155905
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to