Type: LanguageService
I can not find a way to reload compile_commands.json file other than restart vscode.
Linux 4.17.6-1-ARCH1.25.10.17.76.0.1To Reproduce
Take example from #2305 and having everything set up, change in a line in CMakeLists.txt:
add_definitions("-D__weak=__attribute__((weak))" -DABC=\"asd\")
asd to qwe, rebuild, resave c_cpp_properties.json. Hover over ABC in lib.cxx in editor and it still shows asd. Restarting vscode helps with that.
Expected behavior
compile_commands.json being reloaded on change.
Additional context
I tried to debug the extension in order to investigate this issue and #2305 further and I found something interesting:
This conditional (second part fs.existsSync(c.compileCommands)) is not satisfied when compileCommands in c_cpp_properties.json have ${workspaceFolder} in the path. I believe it should not behave like that. Setting path to absolute does not fix reloading issue though.
I'm able to repro the problem. Until it's fixed, using the Reload Window command would be the fastest way to get it to update.
This is an old bug and it seriously affects my workflow. Reloading the window isn't really a good option as I often use the integrated terminal, whose state is lost on reload. Any idea on what might cause this and if it can be fixed? It would be OK to provide a manual reload command IMO.
I believe @Jasdriel fixed this recently. PR #3938. It should be in the next release.
Related: #3864
Should be fixed with 0.25.0.
Most helpful comment
I'm able to repro the problem. Until it's fixed, using the Reload Window command would be the fastest way to get it to update.