-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Feature: Find All ReferencesFind All References, Peek References, RenameFind All References, Peek References, RenameFeature: RenameLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.So we'd need to fix it for VS Code to reach parity.bugverifiedBug has been reproducedBug has been reproduced
Milestone
Description
Type: LanguageService
Describe the bug
- OS and Version: Arch Linux Manjaro
- VS Code Version: 1.41.0 Microsoft Branded from AUR
- C/C++ Extension Version: latest 0.26.2
- Short Description: Rename Symbol command can put out-of-scope, non-related files from the include path into the Confirmed Rename (Pending Rename) section. NOT tested if it actually performs the rename, but if it did, it would break other programs relying on it.
To Reproduce
- Open brand new folder (no include paths, cpp_properties, etc. needed) and create main.cpp with:
struct Tag {};
int main() { return 0; }
- Rename Symbol on Tag (probably works on other common names as well)
- Provided name was common enough, VSCode will default to modifying files in the include path. For Tag, it will attempt to replace in /usr/include/google/protobuf/parse_context.h:
template <typename Tag, typename T>
PROTOBUF_MUST_USE_RESULT const char* ReadRepeatedFixed(const char* ptr, Tag expected_tag, RepeatedField<T>* out);
Note in this instance it would probably not break anything as it is a local name.
Expected behavior
VSCode C/C++ Rename detects that occurance is unrelated to the local definition and puts it into "Candidates for Rename" at best.
Screenshots

(In context of project, but tested with provided example as well)
segfault16, bugrasan, mcspr, rasmusmk, yaoxinliu and 2 more
Metadata
Metadata
Assignees
Labels
Feature: Find All ReferencesFind All References, Peek References, RenameFind All References, Peek References, RenameFeature: RenameLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.So we'd need to fix it for VS Code to reach parity.bugverifiedBug has been reproducedBug has been reproduced
Type
Projects
Status
No status