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 is only updated on reload #5687

Closed
bpbradley opened this issue Jun 24, 2020 · 4 comments
Closed

compile_commands.json is only updated on reload #5687

bpbradley opened this issue Jun 24, 2020 · 4 comments
Labels
bug Feature: Compile Commands fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Milestone

Comments

@bpbradley
Copy link

bpbradley commented Jun 24, 2020

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10 (OS Build 19041.329)
  • VS Code Version: 1.46.1
  • C/C++ Extension Version: 0.28.3
  • Other extensions you installed (and if the issue persists after disabling them):
    C/C++ Advanced Lint
    CMake
    CMake Tools
    CMake Integration
    cmake-format
    DeviceTree
    Doxygen Documentation Generator
    Markdown PDF
    markdownlint
    Python
    Remote - WSL
    reStructredText

I have disabled all of these and the problem persists.

  • Does this issue involve using SSH remote to run the extension on a remote machine?: No.
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

Fairly large project with a number of external dependencies. Numerous cmake projects are added with add_subdirectory, and compile_commands.json is generated specifically for the intellisense.

Steps to reproduce

  1. Create cmake project.
  2. Build with -DCMAKE_EXPORT_COMPILE_COMMANDS=1
  3. Point extension to the generated compile_commands.json
  4. Verify intellisense works as expected
  5. Add new header file to project
  6. Repeat step 2
  7. Without reloading, try to include header. Intellisense will complain that it cant locate the header.
  8. Reload window, verify that it works as expected again

Expected behavior

The intellisense should be updated automatically, either periodically or when a file is opened/changed.

Logs
Insert logs here.

-------- Diagnostics - 6/24/2020, 10:27:20 AM
Version: 0.28.3
Current Configuration:
{
"name": "removed",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"compilerArgs": [],
"configurationProvider": "go2sh.cmake-integration",
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}
Translation Unit Mappings:

<removed/path>

<removed/path>

Translation Unit Configurations:

Process ID: 8680
Memory Usage: 33 MB
Compiler Path: C:\gnuarmemb\bin\arm-none-eabi-gcc.exe
Includes:
    <removed/paths>
Defines: <removed>

Forced Includes:
    <removed/paths>
Standard Version: c11
IntelliSense Mode: gcc-x64
Other Flags:
    --gcc
    --gnu_version=70301

[ <removed/path> ]:
Process ID: 2856
Memory Usage: 11 MB
Compiler Path: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
Includes:
<removed/paths>
Standard Version: c11
IntelliSense Mode: msvc-x64
Total Memory Usage: 44 MB

Screenshots

Additional context

This was originally raised in #2306 and #3864. It was supposedly fixed with PR #3938 and build 0.25.0 but I am still experiencing the issue.

@bpbradley bpbradley reopened this Jun 24, 2020
@sean-mcmanus sean-mcmanus self-assigned this Jun 24, 2020
@sean-mcmanus
Copy link
Contributor

Yeah, I repro the bug. fs.watch is only giving "rename" events instead of "change" events at https://github.com/microsoft/vscode-cpptools/blob/master/Extension/src/LanguageServer/configurations.ts#L682 , causing the update code to never be run.

@bpbradley
Copy link
Author

Yeah, I repro the bug. fs.watch is only giving "rename" events instead of "change" events at https://github.com/microsoft/vscode-cpptools/blob/master/Extension/src/LanguageServer/configurations.ts#L682 , causing the update code to never be run.

Awesome. I am glad it is reproducible. Seems you made quick work of finding the issue.

@bpbradley
Copy link
Author

@sean-mcmanus I tested the change you proposed in PR #5688. It resolved my issue.

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jun 25, 2020
@sean-mcmanus sean-mcmanus removed their assignment Jun 25, 2020
@sean-mcmanus
Copy link
Contributor

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 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 quick fix
Projects
None yet
Development

No branches or pull requests

2 participants