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

IntelliSense cache path isn't honored in version 1.18.4 #11693

Closed
dandev486 opened this issue Nov 16, 2023 · 7 comments · Fixed by #11696
Closed

IntelliSense cache path isn't honored in version 1.18.4 #11693

dandev486 opened this issue Nov 16, 2023 · 7 comments · Fixed by #11696
Assignees
Labels
bug Language Service quick fix regression A bug that didn't exist in a previous release
Milestone

Comments

@dandev486
Copy link

dandev486 commented Nov 16, 2023

Environment

  • OS and Version: Debian Bookworm
  • VS Code Version: 1.84.2
  • C/C++ Extension Version: 1.18.4
  • If using SSH remote, specify OS of remote machine: N/A

Bug Summary and Steps to Reproduce

Bug Summary:
The "C/C++" extension is not honoring the intellisense cache path in version 1.18.4, both when using the default configuration or explicitly setting a path and creates a directory for it in my home directory.

20231116065904
20231116065941
20231116071255

It did respect the setting in version 1.17.5, though.

20231116070049

Steps to reproduce:

Part 1:

  1. Install "C/C++" extension version 1.18.4
  2. Open a C file in Visual Studio Code
  3. Check $XDG_CACHE_HOME/vscode-cpptools/, the folder does not exist (but could, if $XDG_CACHE_HOME was set)
  4. Check $HOME/.cache/vscode-cpptools/, the folder does not exist (and should, since $XDG_CACHE_HOME is not set)
  5. Check $HOME/vscode-cpptools/, the folder exists (and should not, since this is not the documented or chosen location).

Part 2:

  1. Install "C/C++" extension version 1.17.5
  2. Open a C file in Visual Studio Code
  3. Check $XDG_CACHE_HOME/vscode-cpptools/, the folder does not exist (but could, if $XDG_CACHE_HOME was set)
  4. Check $HOME/.cache/vscode-cpptools/, the folder exists (correct behaviour)
  5. Check $HOME/vscode-cpptools/, the folder does not exist (correct behaviour).

Expected behavior:
The intellisense cache path should be located at $XDG_CACHE_HOME/vscode-cpptools/ or $XDG_CACHE_HOME/vscode-cpptools/, not $HOME/vscode-cpptools/, as can be verified by performing the steps proposed for 1.17.5.

Configuration and Logs

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "cStandard": "c23",
            "defines": []
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus added bug Language Service regression A bug that didn't exist in a previous release labels Nov 16, 2023
@sean-mcmanus sean-mcmanus added this to the 1.19 milestone Nov 16, 2023
@sean-mcmanus sean-mcmanus self-assigned this Nov 16, 2023
@sean-mcmanus sean-mcmanus modified the milestones: 1.19, 1.19.0 Nov 16, 2023
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Nov 16, 2023

@dandev486 We have a fix at #11696 for the ".cache" folder not being used, but I wasn't able to repro or find in code review any other bug. You may not be seeing the intelliSenseCachePath files/folders written if you have intelliSenseCacheSize set to 0 or you could be setting those settings at the user level settings and there could be workspace or workspace folder setting that is overwriting that setting.

@dandev486
Copy link
Author

dandev486 commented Nov 17, 2023

@sean-mcmanus, it is actually the opposite, I never had to have these settings until 1.18.4 and the folder creation in the home directory happens even without them, adding them was just an attempt to work around the issue. The problem is that they are not at the documented locations $XDG_CACHE_HOME/vscode-cpptools/ or $HOME/.cache/vscode-cpptools/ (which work perfectly for 1.17.5).

You may not be seeing the intelliSenseCachePath files/folders written if you have intelliSenseCacheSize set to 0

The behaviour with the zeroed value it that the directory is empty, but still incorrectly created at $HOME/vscode-cpptools/.

or you could be setting those settings at the user level settings and there could be workspace or workspace folder setting that is overwriting that setting.

They are user settings, I don't use workspaces.

20231116212030

We have a fix at #11696 for the ".cache" folder not being used, but I wasn't able to repro or find in code review any other bug.

Great, I will give it another try when the next version is released! Thanks!


Please, let me know if additional information would be helpful.

@sean-mcmanus
Copy link
Collaborator

@dandev486 FYI, the IntelliSense cache is disabled if there's no workspace folder open (single file mode).

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Nov 17, 2023

@dandev486 This should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.18.5 . Let us know if you're still hitting an issue. Also, you may want to manually delete the ~/vscode-cpptools folder.

@dandev486
Copy link
Author

@sean-mcmanus, tested and it now works as in 1.17.5, the directory isn't created at $HOME, both with and without the settings, thank you very much for the quick support!

20231117075302

@tristan957
Copy link

This seems to hard code .cache. What if the user has XDG_CACHE_HOME set?

@tristan957
Copy link

Whoops, I can't read. Nevermind :).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Language Service quick fix regression A bug that didn't exist in a previous release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants