One thing that's been bothering, though, is that i see very few refactoring options, and they don't work reliably.
For example, i was working with a Typescript project (which is basically the main language of the VS Code ecosystem), and when i tried to move a type definition to another file, i discovered you only have the option to move it to a new file, in the current folder, with the name of symbol. This would mean I'd need to either create a separate file for this type (plus some other symbols if i want to) or handle the import and export changing myself.
I won't talk about the error i get if i don't select the symbols' export statement, because this is not discussed anywhere and may be something that only happens to me.
I tried doing this said refactor in Webstorm, and it was just a matter of hitting F6 and choosing the target file. I also tried searching for refactoring extensions for Typescript, to no avail.
This is really bothering me, changing import statements manually everytime i want to move a symbol sounds like a very tedious task.
So, I'm wondering, since a LOT of devs use VS Code, is this just how it is? Do you just get used to manually refactoring? I'm also using the Python extension, and it doesn't even give me any move refactoring options.
I definitely miss the rust-analyzer refactoring experience when I am doing typescript
I will explain how it works with python.
For python, I am able to refactor. You need to ensure you have pylance (as of 6 months ago this should be auto installed with the python extension ) and the python extension both installed. Then you can press F2 and rename variables, functions and etc.
It will not work if there is an issue with one of the extensions which happens maybe quarterly - to me.
If you can't rename a variable in a function
Try downgrade both extensions then restart vscode (after each downgrade). Then try, if it doesn't work no worries try updating to latest version then try again. Disabling the extension then enabling won't do anything so don't bother.
It works well with python but it wasn't always like this. It's come a long way in the past two years.
If you want to change the name of an import you rename the module, then it should offer you to auto-rename everywhere else.
Fwiw vscode is an enhanced editor not an IDE so imho it is not as good for all the refactoring solutions in comparison. That being said it has been my chosen editor/IDE for the past three years. Despite these setbacks I like it because it's light, easy to use. Doesn't ask me what to make a file before I write code in it. Doesn't require ten dialogue boxes either to create one
I still use it always but yeah there are setbacks but more pros than cons for me.
But I will say it's up to the language extension- eg. the rust-analyzer plugin has much more powerful refactoring features than the typescript integration does. So probably what you're talking about, for typescript specifically, is an expansion of features in the official typescript integration. In theory someone could also make an alternate typescript integration, though in practice this would be a huge undertaking and probably isn't worth doing
Renaming and moving files usually auto-updates the imports though, but I could even live without that.
Apart from that.. you can do ctrl shift H I believe to replace across the project, but I won't use it that often.. I was in VIM and then Sublime and then VSCode for the past decade and never thought "I wish I had a button to refactor a symbol" personally
It’s a TypeScript language server issue
one of the stranger things that I see when refactoring TS in VSCode is that sometimes it will insert the imports inline rather than at the top of the file, to bring in new imports.