How to get LSP to work with *-inl.h
files?
#344
Unanswered
nguyenvukhang
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the areas of the codebase I've explored, I observe a pattern of having some
*.h
file, and then an accompanying*-inl.h
file. Take for examplecachelib/cachebench/cache/Cache.h
andcachelib/cachebench/cache/Cache-inl.h
.Among the
*.h
and*-inl.h
pairs I've seen so far, I notice that the*.h
file is the one and only file in the codebase that includes (#include
) the corresponding*-inl.h
file. However, LSP servers don't understand this. When I open a*-inl.h
file, the LSP server is at a loss of where to find declarations when I, as a human, know to look in the corresponding*.h
file.My current fix, with the
clangd
lsp, is to include a flag that no one would use such as__LSP_BE_HAPPY__
in a.clangd
file at root:and then manually make the following changes:
Cache.h
, make this edit:Cache-inl.h
, prepend it with a#include
s.However, one issue remains. When I go to reference or go to definition in
Cache.h
, LSP doesn't know to search inCache-inl.h
(because it's no longer included).So my question is this: is there an existing practice on getting LSP servers to understand the specific relationship between these two files?
Beta Was this translation helpful? Give feedback.
All reactions