How to get VS Code to propose more limited rename?

Viewed 168

In Visual Studio Code, F2 rename on purely local C++ symbols is fine, but trying it on a symbol with wider scope, results in a very aggressive scope of suggested renaming, going as far as suggesting to rename unrelated symbols with the same name in the system header files. These typically default to unchecked, but at one point, it did rename an unrelated symbol with the same name in a project header, so it would be nice if the default could be dialed down a bit. Is there a way to do that?

1 Answers

The problem isn't with vscode, it's the linter vscode is using. The easiest way to try to resolve the problem is using a different more advanced c++ linter. It's what I did to resolve a similar issue using golang.

Maybe the below link will help you find your new favorite linter.

https://www.reddit.com/r/cpp/comments/5b397d/what_c_linter_do_you_use/

PS: There is probably a setting that can edit the linter like what I am posting below, but based off of what you're asking, it may be difficult to find the right regex or whatever you need. It'd probably be best just to switch linters and then maybe make an issue on their github repository if you can't find one that suis your need.

  "python.formatting.blackArgs": [
    "--line-length=80"
  ],
Related