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
 OFIW - parse line numbers!
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Jan 29 2009 :  03:43:48 AM  Show Profile  Reply with Quote
See the debug window in VS. You will find tons of lines containing the filename + a line number.

E.g.
C:\\Apps\\MyApp\\MyApp.cpp(133): Logging important information...

If I paste "MyApp.cpp(133)" into the OFIW-window, I expect VAX to understand that I want to open MyApp.cpp and go to line 133.

This is a hard-coded filename+line syntax in VC++ and I think VAX should handle it!

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jan 29 2009 :  08:41:27 AM  Show Profile  Reply with Quote
I am missing something here. If you are looking at an IDE find result, then why don't you just double click on the line in the find result? The IDE takes you directly to this file and line.

As for hard coded, I recently came across this:

http://joginipally.blogspot.com/2007/12/customize-your-find-in-files-results-in.html

which actually says it is configurable. To be fair we could get away with treating it has hard coded most of the time.

Windows allows round brackets containing number in file names... I have never actually seen this done with code files, but I am sure someone somewhere does it.

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

znakeeye
Tomato Guru

379 Posts

Posted - Jan 29 2009 :  10:08:43 AM  Show Profile  Reply with Quote
Yes, you can click it when you get that string inside the IDE. If you get the string from elsewhere, you cannot.

In OFIW:
if match
   open matched_file
else
   strip trailing_number
   if match
      open matched_file
      goto_line trailing_number
Possible combinations:
MyApp.cpp 123
MyApp 123
MyApp.cpp 123

That makes perfect sense! It's more or less an extension to your current support for paths using '\\'.
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Jan 29 2009 :  10:09:54 AM  Show Profile  Reply with Quote
"MyApp.cpp(123)" should also work. That way you can paste it into the window (from some other source - e.g. a log file).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jan 30 2009 :  10:32:08 AM  Show Profile  Reply with Quote
This makes perfect sense IF you assume that file names can never contain numbers. Remember that space indicates separate filtering tokens for the OFIW dialog.

In my main test solution 504 files out of 779 files have 00 (double zero) as part of their file name, since they have 4 digit numbers in the file names. There IS a very good reason for this, before you ask.

If you are broadening this to text from log files then we cannot make any assumptions about the formatting of the text, or what part is the line number, since log files are not constrained, unlike the standard text in the IDE find in files results list.

The idea is interesting, but please stop assuming it is very simple.

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jan 30 2009 :  3:54:47 PM  Show Profile  Reply with Quote
At first glance, seems like an IDE macro would make more sense for this.
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Jan 31 2009 :  04:51:28 AM  Show Profile  Reply with Quote
How about this?

MyApp.cpp|123

Filenames cannot contain '|'.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 02 2009 :  5:44:25 PM  Show Profile  Reply with Quote
What are you trying to achieve here?

A character that is not valid in a file name is one approach, but this means that you cannot use lines from the IDE find results list, since they use a different format, but this is where you started.

Are you trying to use the IDE find results list?
A specific, custom log file format?
Something different again?

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

znakeeye
Tomato Guru

379 Posts

Posted - Feb 04 2009 :  05:33:59 AM  Show Profile  Reply with Quote
I'm not saying you should copy traces from the Output window.

A team of coders communicate.
A asks B: "Where can I find a function that does this?"
B answers: "TheClassThatIMade.cpp line 187."
A fires up OFIW: TheClassThatIMade.cpp|187

Similarly, some hackers do actually remember exactly where some tricky code blocks are. Alt+Shift+S, TrickyFile <enter>, Ctrl+G 1234 <enter>

It makes sense to let VAX do this.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Feb 04 2009 :  10:01:48 AM  Show Profile  Reply with Quote
I have often included line numbers in logging, especially in code where stepping through with the debugger is not an option. Speaking from this experience, line numbers are only semi helpful, since adding logging, editing the code, etc, invalidates them.

Function names, especially if you have relatively short functions, is a much more useful system, since these are much less fluid.

I am not totally against having OFIW understand line numbers, but I would like to understand the benefit of adding this. Remember it has to use a "custom" syntax which people have to learn and remember to use. This does not strike me as a feature that many people are going to use.

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