This patch is against Console-5.1.3.zip.
What it is about:
I build a C/C++ project with traditional "make".
The C/C++ compiler is called with relative paths.
So I get (for exmple) the following warning messages in the console output:
../../mod1/src/access/checkit.c:1381:23: warning: variable ‘excess’ set but not used
I use the following warning pattern to catch this:
../../([^\:]+)\:([^\:]+)\:.* warning\:(.*)
Now I have got several copies of the C/C++ project on my PC, but of course I only
have got one Error Pattern to catch the warnings for the builds in all the different
project directories.
So I want to be able to somehow replace the "../../" with my Project Root path in
the Error Pattern matcher.
The following patch allows this by including <p> in your Error Pattern "filename".
For example like this:
filename: <p>/prja/$1
The <p> will be replaced by the Project Root path from the Project Viewer, when the
project is build and the error and warning messages are collected in the Error List.
So for example the filename will be modified to:
/home/lundril/checkouts/copy_a/prja/mod1/src/access/checkit.c
because my Project Root is "/home/lundril/checkouts/copy_a".
This patch is intended as a basis for discussion.
TBD/Notes:
- Maybe using <p> as magic tag to be replaced is not a good idea ?
(because it is too close to XML tags ?).
Note: Using $p does not seem to work, because this seems to conflict with
the regex parser.
- Maybe more/different tags might also make sense ?
- Currently ErrorMatcher.matchLine() is modified to use the "expanded"
filename (fileBackrefExp). Maybe it is better to instead further modify
ErrorMatcher.match() around the call to MiscUtilities.constructPath() ?
Maybe leads to cleaner code and completely avoids the
fileBackrefExp declaration ?
Submitted | lundril - 2014-04-16 14:29:10.289000 | Assigned | ezust |
---|---|---|---|
Priority | 5 | Labels | Console |
Status | open | Group | None |
Resolution | None |
2014-04-16 14:40:35.964000 lundril |
Ok just addressing my own comments:
project_dir_in_error_pattern_2.patch (1.1Kio) |
---|---|
2014-04-16 14:54:33.704000 ezust |
Ticket moved from /p/jedit/patches/523/ |
2014-04-16 15:37:07.327000 ezust |
Does this patch fix a bug? If so, please reference the ticket.
|
2014-04-16 15:43:28.571000 ezust |
Your particular patch makes Console depend on ProjectViewer for all uses of ErrorMatcher,
changing it from an optional dependency to a regular dependency.
|
2014-04-20 00:33:39.934000 lundril |
> Does this patch fix a bug? If so, please reference the ticket.
project_dir_in_error_pattern_3.patch (1.2Kio) |
2014-04-20 21:04:17.294000 ezust |
1. the unused import in ConsolePlugin.java is a mistake and I just removed it from
trunk. thanks for letting me know.
|
2014-04-20 22:58:41.922000 ezust |
- **status**: open --> closed-rejected |
2014-04-21 15:31:11.083000 lundril |
Hello, It still does not work for me.
prja.tgz (669B) |
2014-04-21 16:17:03.960000 ezust |
On Mon, Apr 21, 2014 at 8:31 AM, lundril <lundril@users.sf.net> wrote: |
2014-04-21 16:17:22.638000 ezust |
On Mon, Apr 21, 2014 at 8:31 AM, lundril <lundril@users.sf.net> wrote:
|
2014-04-21 23:41:15.509000 lundril |
Not sure if replying via E-Mail works, so I just re-post it here:
|
2014-04-21 23:47:01.501000 lundril |
On Mon, Apr 21, 2014 at 04:17:42PM +0000, Alan Ezust wrote: |
2014-04-21 23:47:43.213000 ezust |
Exactly, FileOpenerService only works for unambiguous filenames, while your patch
does in fact set the correct path based on the project variable.
|
2014-04-21 23:50:01.241000 ezust |
- **status**: closed-rejected --> open |
2014-04-22 10:07:51.139000 lundril |
> I am thinking that we can avoid adding the direct dependency
|
2014-04-22 11:06:40.415000 lundril |
Ok here is another try, this time using BeanShell to get the project path.
|
2014-04-22 22:00:42.894000 ezust |
Console is supposed to be able to run without ProjectViewer (although it's been a
while since I've tested it that way). And most of the PV code that is in Console was
designed with an optional dependency in mind. An import at the top can cause problems,
and other things can too. At the moment, Console doesn't work for me without ProjectViewer
for a reason I have not yet determined.
|
2014-04-22 22:10:20.207000 ezust |
Nice that it is getting smaller/simpler but I don't want to pay a runtime penalty
if I don't use this feature. So it should check first if the string contains #p# before
it does an extra beanshell eval.
|