Open pBlasiak opened 1 year ago
I am having a similar issue. My problem is best described in the issue from another cpp extension here: https://github.com/microsoft/vscode-cpptools/issues/4662 The RCA seems to be that vscode does not automatically trigger completions for macro definitions. But the extension does not support manual completion either.
I think in macros it is more difficult situation. OpenFOAM has specific H files. Sometimes they are typical h file as a class header, sometimes it contains frequently used code, sometimes just includes other H files. The question is if it would be typical h file or hpp, does ccls supports autocompletion in such files? Is it possible to add this feature to H files?
Hi, try removing the key-pair value, "ccls.cache.directory"
. This is because for some bizarre reason, ccls will index the header files inside of the cache directory, instead of the header files inside of the includes (or wherever you put your header files) directory.
Observed behavior
I am using OpenFOAM C++ library. I followed these instructions https://openfoamwiki.net/index.php/HowTo_Use_OpenFOAM_with_Visual_Studio_Code After the running the vscode-settings I have the following setting.json file: ` { "[cpp]": { "editor.wordBasedSuggestions": true, "editor.suggest.insertMode": "replace", "editor.semanticHighlighting.enabled": true }, "ccls.cache.directory": "/home/przemek/OpenFOAM/OpenFOAM-v2106/build/linux64GccDPInt64Opt/ccls-cache",
}
`
When I open folder with my project in VSC evry file is recognized by the ccls. In the main file with .C extension autocompletion of methods after writing "object." works very well. However, in the .H files it does not see anything.
Expected behavior
Autocompletion in header files (*.H) works.
Steps to reproduce
I think it is general issue and no reproduce steps are necessary. The question is how to enable autocompletion in *.H files. I have tried to use .ccls file with such settings but it does not work:
%h -x %h c++-header
System information