How I can let the user choose from a set of valid types in an introduce refactoring?
I've implemented an introduce variable refactoring and it's working very well. In the target language, there are times when a given expression can have multiple valid evaluated types, though, and when that's the case I want to present those types to the user for selection before setting the variable name. Unfortunately I'm not seeing an obvious way to do this. Anyone have any pointers/tips on how I might be able to do that easily? Can I perhaps insert a live template where I'd normally insert the declaration moving from a type selector to the variable name?
Thanks in advance for any thoughts!
Please sign in to leave a comment.
Hi Scott,
java introduce variable actually contains the type chooser (if you press Shift-Tab you'll get to the type declaration). Is it what you want to get?
Anna
Thanks, Anna! I can tell I'm tired because I've been so focused on in-place refactorings that I completely forgot about bringing up a dialog when necessary. Super easy. Thanks again for the response!
UPDATE: Still tired evidently...yes, I see that Shift+Tab works for in-place refactorings in Java as well. I'll look at how that's wired in and send any other questions I might have. Once again, thanks!