neovim clangd setup not able to detect sub header files

51 Views Asked by At

The setup with clangd on neovim works fine for c++, but found it does not work in this case: File A.h if has #include "A.hcpp" at its end then nothing in A.hcpp can be looked up like jump to function definition etc. It works perfectly for A.h file. This kind of file naming is common for templates in c++

A.h

template<typename T>
class A
{
public:
  void some_func();
};

#include "A.hcpp" // This will contain some_func which can refer to other classes in the code base

The compile_commands.json was generated with the simple "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON".

clangd version I am using is 18.0.0.

Any pointers on what am I missing to get this working will be very helpful

0

There are 0 best solutions below