Adding console filter to external tool? [message #336045] |
Fri, 15 May 2009 04:25 |
Eclipse User |
|
|
|
Originally posted by: fraserofthenight.gmail.com
Hi all,
I apologize if this question has been asked before. Is there any easy
way to create a plugin that adds links to the console based on regular
expressions? I only want to do this on certain programs. The only way I
can think of is to create a new external tools launch delegate, copy
over all of
org.eclipse.ui.externaltools.internal.prohgram.launchConfigu ration, and
modify just the console (I'm looking through the source to see how to do
that right now). I'm sure there's an easier way, though.
Thanks,
All the best,
Robert
|
|
|
Re: Adding console filter to external tool? [message #336046 is a reply to message #336045] |
Fri, 15 May 2009 04:33 |
Eclipse User |
|
|
|
Originally posted by: fraserofthenight.gmail.com
Robert Fraser wrote:
> Hi all,
>
> I apologize if this question has been asked before. Is there any easy
> way to create a plugin that adds links to the console based on regular
> expressions? I only want to do this on certain programs. The only way I
> can think of is to create a new external tools launch delegate, copy
> over all of
> org.eclipse.ui.externaltools.internal.prohgram.launchConfigu ration, and
> modify just the console (I'm looking through the source to see how to do
> that right now). I'm sure there's an easier way, though.
>
> Thanks,
> All the best,
> Robert
Just to clarify, I want to make it so that if a program outputs:
.../candy/compiler/parser.d:880 - Identifier parseFuncttionLiteral not
defined
The "../candy/compiler/parser.d:880" part becomes a link that opens up
an editor for that file to line 880 and I can delete that extra "t".
Ideally, I'd have a regular expression for finding the links that sends
the links as strings to another class (that I write) that finds the file
& line and opens the editor.
Thanks!
|
|
|
Re: Adding console filter to external tool? [message #336047 is a reply to message #336046] |
Fri, 15 May 2009 05:57 |
Eclipse User |
|
|
|
Originally posted by: fraserofthenight.gmail.com
Robert Fraser wrote:
> Robert Fraser wrote:
>> Hi all,
>>
>> I apologize if this question has been asked before. Is there any easy
>> way to create a plugin that adds links to the console based on regular
>> expressions? I only want to do this on certain programs. The only way
>> I can think of is to create a new external tools launch delegate, copy
>> over all of
>> org.eclipse.ui.externaltools.internal.prohgram.launchConfigu ration,
>> and modify just the console (I'm looking through the source to see how
>> to do that right now). I'm sure there's an easier way, though.
>>
>> Thanks,
>> All the best,
>> Robert
>
> Just to clarify, I want to make it so that if a program outputs:
>
> ../candy/compiler/parser.d:880 - Identifier parseFuncttionLiteral not
> defined
>
> The "../candy/compiler/parser.d:880" part becomes a link that opens up
> an editor for that file to line 880 and I can delete that extra "t".
> Ideally, I'd have a regular expression for finding the links that sends
> the links as strings to another class (that I write) that finds the file
> & line and opens the editor.
>
> Thanks!
My bad; ignore this; I found IConsoleLineTracker
|
|
|
Re: Adding console filter to external tool? [message #336049 is a reply to message #336045] |
Fri, 15 May 2009 08:16 |
Eclipse User |
|
|
|
Originally posted by: fraserofthenight.gmail.com
Robert Fraser wrote:
> Hi all,
>
> I apologize if this question has been asked before. Is there any easy
> way to create a plugin that adds links to the console based on regular
> expressions? I only want to do this on certain programs. The only way I
> can think of is to create a new external tools launch delegate, copy
> over all of
> org.eclipse.ui.externaltools.internal.prohgram.launchConfigu ration, and
> modify just the console (I'm looking through the source to see how to do
> that right now). I'm sure there's an easier way, though.
>
> Thanks,
> All the best,
> Robert
Okay, now is there any quick way to search for a file, given a path that
might be somewhere in the workspace? So if I have a path:
.../candy/compiler/parser.d
.... is there a quick way to find that file?
Thanks,
Robert
|
|
|
Re: Adding console filter to external tool? [message #336060 is a reply to message #336049] |
Sat, 16 May 2009 16:05 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Robert Fraser wrote:
> Okay, now is there any quick way to search for a file, given a path that
> might be somewhere in the workspace? So if I have a path:
> ../candy/compiler/parser.d
> ... is there a quick way to find that file?
You'll probably have to construct an IPath (instance of
org.eclipse.core.runtime.Path) and then get the IFile for that path.
This section of the Plug-in Development help will probably be useful:
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/resInt.htm
The gist is that, once you have the IPath, get the IWorkspaceRoot via
ResourcesPlugin.getWorkspace().getRoot()
and from the root you can get files.
I don't think you can use relative paths like above as-is; you'll have
to figure a way to make it an absolute path (absolute in the workspace).
Hope this helps,
Eric
|
|
|
Re: Adding console filter to external tool? [message #336061 is a reply to message #336060] |
Mon, 18 May 2009 06:39 |
Eclipse User |
|
|
|
Originally posted by: fraserofthenight.gmail.com
Eric Rizzo wrote:
> Robert Fraser wrote:
>> Okay, now is there any quick way to search for a file, given a path
>> that might be somewhere in the workspace? So if I have a path:
>> ../candy/compiler/parser.d
>> ... is there a quick way to find that file?
>
> You'll probably have to construct an IPath (instance of
> org.eclipse.core.runtime.Path) and then get the IFile for that path.
> This section of the Plug-in Development help will probably be useful:
> http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/resInt.htm
>
>
> The gist is that, once you have the IPath, get the IWorkspaceRoot via
> ResourcesPlugin.getWorkspace().getRoot()
> and from the root you can get files.
>
> I don't think you can use relative paths like above as-is; you'll have
> to figure a way to make it an absolute path (absolute in the workspace).
>
> Hope this helps,
> Eric
Yup; I know about IPath, etc., the problem is how to search the
workspace for the relative path. I've found a sort-of solution that
works in 95% of cases, and short of implementing an entire search
indexer that's about as good as I think I'll get.
Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.04227 seconds