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

Rename / Refactor Preview suggests changes in /usr/include (on WSL) #9751

Closed
n0on0 opened this issue Aug 18, 2022 · 2 comments
Closed

Rename / Refactor Preview suggests changes in /usr/include (on WSL) #9751

n0on0 opened this issue Aug 18, 2022 · 2 comments
Labels
duplicate enhancement Improvement to an existing feature Feature: Find All References Find All References, Peek References, Rename fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@n0on0
Copy link

n0on0 commented Aug 18, 2022

Environment

  • OS and Version: Windows 10 (x64) 21H2 19044.1889
  • VS Code Version: 1.70.2
  • C/C++ Extension Version: 1.11.5
  • Other extensions you installed (and if the issue persists after disabling them):
    • Remote - WSL v0.66.3
  • Remote OS: Ubuntu 20.04 - WSL2

Bug Summary and Steps to Reproduce

Bug Summary:
When renaming a variable or function (or other identifier) with name that is used in /usr/include, the Refactor Preview also suggets changes in files in /usr/include, although these files should not be modified at all.

Steps to reproduce:

  1. Open the code sample as a C file (something.c)
  2. Rename one of the functions (through F2 or the Rename option in the VSCode's right-click menu)
  3. See the suggestions in Refactor Preview

Expected behavior

No suggestions to modify files in /usr/include

Code sample and Logs

#include <stdio.h>
#include <stdlib.h>

void add() {
    return;
}

int main(int argc, char const *argv[]) {
    return 0;
}
-------- Diagnostics - 8/18/2022, 8:58:40 PM
Version: 1.11.5
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "${workspaceFolder}/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "gnu17",
    "cppStandard": "gnu++14",
    "intelliSenseMode": "linux-gcc-x64",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "browse": {
        "path": [
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Translation Unit Mappings:
[ /mnt/c/Users/user/Documents/newtest/test.c ]:
    /mnt/c/Users/user/Documents/newtest/test.c
Translation Unit Configurations:
[ /mnt/c/Users/user/Documents/newtest/test.c ]:
    Process ID: 26208
    Memory Usage: 19 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/lib/gcc/x86_64-linux-gnu/9/include
        /usr/local/include
        /usr/include/x86_64-linux-gnu
        /usr/include
    Standard Version: c17
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --gcc
        --gnu_version=90400
Total Memory Usage: 19 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 2324

Screenshots

image

@sean-mcmanus sean-mcmanus added Language Service Feature: Find All References Find All References, Peek References, Rename enhancement Improvement to an existing feature labels Aug 18, 2022
@sean-mcmanus
Copy link
Contributor

A current workaround would be to add "/usr/include" to "C_Cpp.files.exclude", but that would disable any workspace symbol or reference searching for symbols in those locations. Another potential fix would be to add a C_Cpp.rename.exclude setting, and we could potentially default that to include the system headers paths. This is also related to #4102

@Colengms Colengms modified the milestones: On Deck, 1.14 Oct 4, 2022
@bobbrow
Copy link
Member

bobbrow commented Feb 9, 2023

I believe this is a duplicate of #9235 which is fixed as of version 1.14.1 (pre-release)

@bobbrow bobbrow closed this as completed Feb 9, 2023
@bobbrow bobbrow added duplicate fixed Check the Milestone for the release in which the fix is or will be available. labels Feb 9, 2023
@bobbrow bobbrow modified the milestones: 1.14, 1.14.1 Feb 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate enhancement Improvement to an existing feature Feature: Find All References Find All References, Peek References, Rename 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

4 participants