How does clangd
know where a function definition is when only one file has been indexed through the LSP (Language Server Protocol) message textDocument/didOpen
?
This question is based off of the assumption that there is no compile_commands.json
file for clangd
to work with.
To the best of my knowledge clangd
will partially index(?) a given file when clangd
receives the LSP message textDocument/didOpen
with no compile_commands.json
file in the workspace(?).
Thus the index of the file being partially indexed will only reside in memory.
So how is clangd
aware of definitions outside of the partially indexed file when it has no awareness of any outside files?
Or is it aware?
Or is it made aware of other files by some heuristic that looks at the relative path or the includes (#include "<filename.hpp>"
) that only reside in directories root-project-dir/src
and the likes thereof?