T O P I C R E V I E W |
znakeeye |
Posted - Jan 29 2009 : 03:43:48 AM 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! |
9 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 04 2009 : 10:01:48 AM 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. |
znakeeye |
Posted - Feb 04 2009 : 05:33:59 AM 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. |
feline |
Posted - Feb 02 2009 : 5:44:25 PM 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? |
znakeeye |
Posted - Jan 31 2009 : 04:51:28 AM How about this?
MyApp.cpp|123
Filenames cannot contain '|'. |
sean |
Posted - Jan 30 2009 : 3:54:47 PM At first glance, seems like an IDE macro would make more sense for this. |
feline |
Posted - Jan 30 2009 : 10:32:08 AM 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. |
znakeeye |
Posted - Jan 29 2009 : 10:09:54 AM "MyApp.cpp(123)" should also work. That way you can paste it into the window (from some other source - e.g. a log file). |
znakeeye |
Posted - Jan 29 2009 : 10:08:43 AM 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 '\\'. |
feline |
Posted - Jan 29 2009 : 08:41:27 AM 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. |