Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile_commands.json are not getting reloaded on change. #2306

Closed
omicronns opened this issue Jul 21, 2018 · 5 comments
Closed

compile_commands.json are not getting reloaded on change. #2306

omicronns opened this issue Jul 21, 2018 · 5 comments
Assignees
Labels
bug Feature: Compile Commands fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@omicronns
Copy link

omicronns commented Jul 21, 2018

Type: LanguageService

I can not find a way to reload compile_commands.json file other than restart vscode.

  • OS and Version: Linux 4.17.6-1-ARCH
  • VS Code Version: 1.25.1
  • C/C++ Extension Version: 0.17.7
  • Clang Version: 6.0.1

To 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:

https://github.com/Microsoft/vscode-cpptools/blob/2cbc90d98b52349ad929e587c250803aee414f6f/Extension/src/LanguageServer/configurations.ts#L482

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.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jul 23, 2018

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.

@grigorig
Copy link

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.

@bobbrow
Copy link
Member

bobbrow commented Jul 25, 2019

I believe @Jasdriel fixed this recently. PR #3938. It should be in the next release.

@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Jul 25, 2019
@bobbrow
Copy link
Member

bobbrow commented Jul 25, 2019

Related: #3864

@sean-mcmanus
Copy link
Contributor

Should be fixed with 0.25.0.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Compile Commands fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

7 participants