Author |
Topic |
|
willdean
Tomato Guru
134 Posts |
Posted - Jan 18 2005 : 5:58:10 PM
|
Is there any particular reason why ALT-G can't be made to work on identifiers which are within comments?
It would be very useful to be able to comment-out a function's definition, then ALT-G from the (now commented) name of the function to the header file to comment-out the declaration.
Maybe this is difficult for some reason I haven't thought of.
Will
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Jan 19 2005 : 01:49:11 AM
|
I've often wanted to do this. I quite frequently refer to another function in the comments to a function. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 21 2005 : 01:18:20 AM
|
Technically, there is no context for functions inside a comment. It's as if the function is no longer a function, because it isn't despite the fact it looks like one.
For the same reason, Ctrl+Space after typing part of a symbol generates a list of string matches from within your file. The symbol has no context either. |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Jan 21 2005 : 11:29:09 AM
|
You're correct, of course. But it would still be useful to pretend that it's in scope so that Alt-G did something useful. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
willdean
Tomato Guru
134 Posts |
Posted - Jan 29 2005 : 06:37:21 AM
|
Thanks for this, but I still don't see why the contents of a comment can't been seen as being in the scope which contains the comment.
I'm not really sure where 'technically' comes into it - VA is not strictly following language parsing rules, it's trying to help developers. (cf your approach to #if 0)
Will
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jan 29 2005 : 10:54:55 AM
|
There is no doubt VA X could guess at scope of symbols in a comment, particularly if uncommenting results in parse-able code. Obviously, the problem arises when prose within comments makes commented code impossible to parse. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jan 29 2005 : 2:07:54 PM
|
*thinks about how i would want this to work*
i can see two basic situations where i would normally want to do this. a) i am referencing a class member function, normally on the same class. so if VAX knows which class the comment is attached to, first look for the word as a member function of this class.
knowing which class i am on could be hard though, especially for comments that are above a function, so not actually with its scope.
b) some system function that is directly relevant to what i am doing.
in both cases feeding the current word into FSIW stands a good chance of at least helping, if not actually offering up the correct situation. this is of course based on me remembering to be sensible when i ask VAX to goto a comment word.
i would like to report i can record a macro in .NET 2003 to select the current word, copy it, run FSIW, and paste in the word. however i cannot seem to make this macro run correctly. the sequence of key presses is very straight forward:
ctrl_w - select the current word ctrl_c - copy the word alt_shift_s - open FSIW ctrl_v - paste the word you are interested in
yet i am not getting consistent results when running the temporary macro i am recording.
*looks for a big stick to use on this IDE*
accessing menus with the keyboard does not seem to get recorded when i record a temporary macro. how exactly am i supposed to use such a diabolical macro system?
anyone know of a good total beginners guide to writing macro's for the IDE? this should be easy, if only it would work *sigh*
for now how about manually using FSIW as a work around? |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|