You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 1.13.0-insider
Commit c615b43
Date 2017-05-09T06:13:02.691Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
When pressing F2 to rename a variable, VSCode always lets you enter the new name, only afterwards it appears to check whether the rename is possible and if not, it shows "You cannot rename this element".
It would be better to check this first, before even prompting for a new name, to avoid frustration that what was just written has been lost and has to be written again after using Ctrl+D or similar.
The text was updated successfully, but these errors were encountered:
From what I now understand, this is hard to implement because there are various implementations for different languages which all have their own handling and would need to get support for this... But I wonder whether there would be a way to "test" this before, e.g. telling the provider to rename, either to the same thing as before, or (in case this is caught and prevented) to a temporary name, and then not applying the change (or invisibly reverting it), in order to detect whether rename is possible. But I guess this would be a can of worms in case the rename is expensive or in case there are only so-many things allowed to rename that thing to and your temporary value is not one of them...
But I guess this would be a can of worms in case the rename is expensive or in case there...
Yeah, you'll be on thin ice. When we designed the rename API and flow we ended up with the common denominator which is a plain rename. Having said that most providers are smarter and can validate a range before attempting to rename a symbol, esp TypeScript and C# should be fit for this
Version 1.13.0-insider
Commit c615b43
Date 2017-05-09T06:13:02.691Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
When pressing F2 to rename a variable, VSCode always lets you enter the new name, only afterwards it appears to check whether the rename is possible and if not, it shows "You cannot rename this element".
It would be better to check this first, before even prompting for a new name, to avoid frustration that what was just written has been lost and has to be written again after using Ctrl+D or similar.
The text was updated successfully, but these errors were encountered: