vbvictor wrote:

> Can you explain why it is relevant to check the extension? Doesn't 
> header/source switch look at the symbols? In what situation would the file 
> extension be relevant?

It first try to look based on filenames (if files are in one directory) and 
then tries AST approach, here is relevant part:
https://github.com/llvm/llvm-project/blob/fda6309919a0c391ed224c0da214ba89ecff5478/clang-tools-extra/clangd/ClangdServer.cpp#L817-L835

In my particular case file structure was:
```
dir/
  context.h
  context.hpp
  context.cpp
```
So swithing from `context.cpp` got into `context.h`, but I think it should 
preferrably go into `context.hpp`.

-------------------------

Now I wonder if "symbols" approach would give `context.cpp` -> `context.hpp`. 
Maybe better solution for this problem is to make "symbols" approach go first 
with flag/config option

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

Reply via email to