pragmagic / vscode-nim

An extension for VS Code which provides support for the Nim language.
Other
237 stars 37 forks source link

Support refactoring #81

Open ghost opened 6 years ago

ghost commented 6 years ago

This one should be hard to implement, too, but useful: For the code

var x = 1

proc test() =
  var x = 2
  echo x

test()
echo x

Jetbrains products have the option to Refactor all occurences or Refactor code occurences (where local scope would be a better name). The second one would only refactor inside test.

ghost commented 5 years ago

Just saw that this is actually supported in nimsuggest using use command: https://nim-lang.org/docs/nimsuggest.html#nimsuggest-invocation-symbol-usages

kosz78 commented 5 years ago

@tim-st nimsuggest dont guarantee returns all occurrences correctly, Some time ago I was trying integration rename support but found that standard VSCode find and replace works better than nimsuggest support

antonkatz commented 4 years ago

How come does the find & replace work better? What about renames across files?

RSDuck commented 4 years ago

you can use the search and replace within workspace feature for that (it's the magnification glass on the sidebar).

antonkatz commented 4 years ago

@RSDuck I'm new to VS so that's a nice tip. Thank you. A properly implemented refactor feature though (seems to me) will be much more accurate. And a time saver.