vscode-nim icon indicating copy to clipboard operation
vscode-nim copied to clipboard

Support refactoring

Open ghost opened this issue 7 years ago • 5 comments

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 avatar Feb 10 '18 10:02 ghost

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

ghost avatar Oct 01 '18 15:10 ghost

@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

kosz78 avatar Dec 01 '18 16:12 kosz78

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

antonkatz avatar Jun 21 '20 14:06 antonkatz

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

RSDuck avatar Jun 21 '20 15:06 RSDuck

@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.

antonkatz avatar Jun 21 '20 15:06 antonkatz