-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Select the span automatically based on cursor position for introduce local / constant #752
Labels
Area-IDE
Concept-Continuous Improvement
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
IDE-CodeStyle
Built-in analyzers, fixes, and refactorings
Resolution-Not Reproducible
The described behavior could not be reproduced by developers
Milestone
Comments
Moving to 1.1. |
34 tasks
Design Meeting Notes: Let's try this out with a service that lets the customer select an expression from a sub-list based on where their caret was when they invoked. |
This refactoring will use
|
akhera99
added a commit
that referenced
this issue
Oct 1, 2024
akhera99
added a commit
that referenced
this issue
Oct 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-IDE
Concept-Continuous Improvement
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
IDE-CodeStyle
Built-in analyzers, fixes, and refactorings
Resolution-Not Reproducible
The described behavior could not be reproduced by developers
Ported from TFS WorkItem: 1065670, originally filed by @shyamnamboodiripad
Repro Steps:
Currently, I if I want to invoke introduce local /constant refactoring on a multiline string literal, I am forced to select the entire string first. It would be nice if I could invoke the refactoring by simply placing cursor somewhere in the string and hitting ctrl + .
Can't we figure out the minimum enclosing span for the current cursor position (i.e. expand to span of innermost node / expression containing the cursor) and offer refactorings as if the user had selected this span? I could also imagine this being useful for other expressions (date literals, expressions / method calls involving long identifiers etc.)
Looks like we do this already in some other refactorings? For example, if i select jsut 'String' in the following If statement, I am offered an extract method refactoring that extracts the entire 'typeof x isnot string' expression-
Revision History:
Created By Shyam Namboodiripad (10/16/2014 11:22:37 PM)
Edited By Kevin Pilch-Bisson (10/17/2014 10:03:24 AM)
Can you think about the UX here?
Yes, I think this is a good idea to help with our refactoring discoverability. It may not fit in RTM though. Can you port to GitHub.
The text was updated successfully, but these errors were encountered: