Author |
Topic |
|
Assassin
New Member
3 Posts |
Posted - Jun 25 2004 : 1:33:21 PM
|
I often work with long functions that have numerous variables. It's productive to consolidate pieces of these functions into smaller helper functions, but finding all the variable references that need to be taken out or modified is rather time-consuming. I'd like some kind of highlighting for all references of the currently selected variable, by underlining them or changing their color. This should make it easier to identify all the pieces of code that need to be considered for modification if a variable is altered. Unreferenced variables could also be identified. Keeping track of proper scope is important, as a different variable with the same name might be defined in a different scope.
Adding to the highlighting, a form of visual variable liveness analysis would also be nice. This basically boils down to compiling the code into a program flow graph and doing a liveness analysis on it to find the "liveness ranges" of a variable. These ranges could be indicated with vertical bars in the margin, with different colors indicating the various liveness varieties, which could include: definitely live (variable will definitely be used in a future expression), possibly live (variable may be used in future), and definitely dead (variable will definitely be assigned before being used). I know this is a rather complex task, but it would definitely aid in understanding the flow of foreign code, or with refactoring unfinished code. If it would be too memory consuming to precompute (those flow graphs can get rather large), I wouldn't mind waiting a second or two for it to be regenerated for the current function. |
|
jpizzi
Tomato Guru
USA
642 Posts |
Posted - Jun 25 2004 : 3:54:17 PM
|
Sounds useful. But, I wouldn't think that it falls within the scope of Visual Assist.
|
Joe Pizzi |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jun 28 2004 : 6:12:15 PM
|
if you change / remove the definition of a variable, all references to this variable in the function should get red underlines. slightly fiddly, but this should definetly help |
zen is the art of being at one with the two'ness |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jun 28 2004 : 9:09:55 PM
|
quote: I wouldn't mind waiting a second or two...
Tough customer.
Interesting ideas. Nowhere on our list to consider. |
Whole Tomato Software, Inc. |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jul 02 2004 : 7:01:34 PM
|
i would love getting all instances of the current word coloured in
this is VERY useful to me in VIM, one of the things i still miss. if you are considering adding this then having this word highlighted across the whole file might be a useful simplification.
if (or when) you do this there needs to be a way to cancel the highlighting once you have finished with it. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|