Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Alt+G in output window
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tom_seddon
Tomato Guru

162 Posts

Posted - Jun 22 2006 :  05:56:03 AM  Show Profile  Reply with Quote
I quite often use __FUNCTION__ in logging macros and such like, printing stuff out with OutputDebugString. It would be useful if VA would do its best to provide some kind of Alt+G facility in the output window, making a best guess at interpreting the thing under the cursor as a name of something in the project. It doesn't have to be spot on, but I'm sure that it could be made to work in most cases, and that would be very useful.

FOr example, if I have the phrase "Xyz::Abc: Failed" in the output window, and I have the cursor on the "X", VAX could try to find the Abc method/var/etc. in the Xyz class, as if I'd done an Alt+G on the corresponding text in the normal text editor.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jun 22 2006 :  2:32:02 PM  Show Profile  Reply with Quote
the obvious problem with this will be when users start wanting to alt-g on any old text in the output window

there was a recent discussion about alt-g from function names in comments, which ended up with the idea that you could select some text and then trigger FSIW with the selected text as the default filter. this solves all of the "what am i sitting on" problems, and if have both the class and function name it should filter the list down to just the item you want.

does this sound close enough to be useful? as someone who regularly puts __FILE__ and __LINE__ in debug statements this does have quite an appeal

case=1316

zen is the art of being at one with the two'ness
Go to Top of Page

tom_seddon
Tomato Guru

162 Posts

Posted - Jun 22 2006 :  6:10:54 PM  Show Profile  Reply with Quote
I think having to select the text would make the feature less convenient to use. I was actually thinking more along the lines of having VA make vague guesses :) I envisaged the functionality being restricted to names given in the :: syntax (i.e., containing nothing but types and member names), and VAX doing a very quick scan forwards and backwards to work out, roughly, what the extents of the C++ name might be. It would then try (and possibly fail) to match it against the known set of symbols. (Bonus points if you scrape through namespaces and so on to try and find a number of matches :)

A couple of examples of my imagined matching strategy follow. | is not part of the text, but is supposed to represent the cursor position:

Xyz:|:Blah: error.

In this case, scanning takes account of the "::", because that's valid C++, but stops at the ":", because it probably isn't. Or perhaps:

Xyz::Blah: fatal error. (calling Xy|z::Whatever.)

Again, scanning takes account of the "::", but treats the " " and "." as terminating chars, because they don't form part of a C++ symbol.

It's guesswork, basically, and it won't cater for every case, but if the rules are simple enough then it will be easy enough to format error messages appropriately. I've seen a number of people format their error messages specifically to take advantage of Visual Studio's existing handling of output window lines matching "^.*\\([0-9]+)\\:", so I infer from this that people are willing to meet their tools halfway in the interests of having things work well.

(The same would go for Alt+G in comments; I'd vote against having to select the word. Same rationale.)

Of course, you could end up being able to Alt+G on something that isn't valid, or perhaps get an unexpected result by coincidence. Personally, I really don't see this as a big problem...

Edited by - tom_seddon on Jun 22 2006 6:11:34 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jun 24 2006 :  08:05:31 AM  Show Profile  Reply with Quote
the original thread was about function names in comments, which tend to be much more random, and free text like. if we assume for the moment that people are using __FUNCTION__ then this approach makes much more sense.

personally i tend to be a bit lax, and a bit free form when placing function names into debug and trace output, since close enough is good enough. plus i have yet to develop the habit of using __FUNCTION__, since as far as i am aware it does not work when i have to compile my code under UNIX.

this is why i originally preferred FSIW to alt-g, since FSIW is designed to handle partial function names, as well as complete class + function name strings.

so does it make sense to you to pick up what we can, and route it via FSIW?

zen is the art of being at one with the two'ness
Go to Top of Page

tom_seddon
Tomato Guru

162 Posts

Posted - Jul 01 2006 :  6:43:43 PM  Show Profile  Reply with Quote
Yeah, that sounds good.

Regarding the use of __FUNCTION__, even though I said "::" syntax, I think what I actually meant was declaration syntax -- so it should work for free functions, too.

Ideally you should be able to Alt+G on anything in the output window or in a comment, and have VAX work out roughly what the possible symbols might be, xref the possibilities with the FSIW list, and bring you up the list. Or, if there's only one possibility, go straight there. (Ignoring declarations would probably be useful for this situation.)

As well as error messages, this would be handy for see-also type comments.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 02 2006 :  1:49:10 PM  Show Profile  Reply with Quote
i have updated case 1316 with this. it is a very interesting idea, but as with all feature requests it may take a while before anyone looks at it.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000