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

Updates to compile_commands.json are not handled if specified using a relative path #7610

Closed
Colengms opened this issue May 27, 2021 · 1 comment
Assignees
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

@Colengms
Copy link
Contributor

Colengms commented May 27, 2021

If I specify compileCommands like so:
"compileCommands": "build/compile_commands.json"

.. it seems to work as expected, however changes to the file are not (always?) handled properly.

If I specify it like so:
"compileCommands":"${workspaceFolder}/build/compile_commands.json"

.. it appears to work as expected, including when changes are made.

It looks like we're resolving this path to within the workspace directory in some cases, but not in others. If the current working directory is different, the file is looked for there. This should either default to always resolving as relative to the workspace folder if not a full path (after variables like ${workspaceFolder} are expanded). Or, it should result in a squiggle in c_cpp_properties.json.

We had added some additional checking for changes to compile_commands.json, to address user reports that changes were not always being handled properly. This is likely the actual cause, and that additional handling could potentially be removed.

@Colengms Colengms added this to the On Deck milestone Jun 8, 2021
@Colengms Colengms modified the milestones: On Deck, 1.6.0, 1.5.0 Jun 15, 2021
@Colengms Colengms modified the milestones: 1.5.0, 1.6.0 Jun 15, 2021
@jureid jureid modified the milestones: 1.6.0, 1.7.0 Aug 2, 2021
@bobbrow bobbrow modified the milestones: 1.7.0, 1.8.0 Oct 19, 2021
@sean-mcmanus sean-mcmanus removed this from the 1.8.2 milestone Jan 28, 2022
@Colengms Colengms added this to the On Deck milestone Mar 22, 2022
@browntarik browntarik self-assigned this Oct 5, 2022
@browntarik browntarik assigned Bernardin-MS and unassigned browntarik Oct 7, 2022
@michelleangela
Copy link
Contributor

When the file path property compileCommands in the c_cpp_properties.json file (IntelliSense configuration) is set with a relative path, extension does not resolve path to the correct absolute path.

Examples of relative path cases for a workspace folder under path Home/projects/myFolder or the value of ${workspaceFolder} is Home/projects/myFolder .

Example path value: "${workspaceFolder}/build/compile_commands.json"
Should resolve to: "Home/projects/myFolder/build/compile_commands.json"

Example path value: "some_subfolder/compile_commands.json"
Should resolve to: "Home/projects/myFolder/some_subfolder/compile_commands.json"

Example path value: "compile_commands.json"
Should resolve to: "Home/projects/myFolder/compile_commands.json"

@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.13.4 Nov 1, 2022
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Nov 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2023
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

7 participants