Editor Code Annotations [message #141058] |
Tue, 07 October 2003 14:09  |
Eclipse User |
|
|
|
Originally posted by: lopian.netvision.net.il
Hi,
I am writting an editor and would like to implement 'as you type' code
annotation.
i.e. when I write an unknown statment the editor should show an error marker
and underline the bad key-word, when fixed it should disapear (or become
disabled).
Where can I find an example of this?
I extended the TextEditor,and have my own DocumemntPartitioner and Damagers
and Repairer. Where should this go?
in the Damager? in the SourceViewerConfiguration?
I tried adding a DocumentListener and IMarkers but they don't update while
typing and they appear in the Tasks/Problems.
Any ideas, pointers?
regards
Eli
|
|
|
|
|
Re: Solved - Editor Code Annotations, What about IMarkers [message #145476 is a reply to message #143940] |
Fri, 17 October 2003 03:27   |
Eclipse User |
|
|
|
Originally posted by: bob.objfac.com
"Eli" <lopian@netvision.net.il> wrote in message
news:bmh8d8$t7u$1@eclipse.org...
> Thanks Bob.
> This works now.
>
> How do I make IMarkers that don't appear in the Tasks?
Interesting question. It's easy enough to do by accident. ;-}
I don't know the correct answer because I've always been going in the other
direction, but I seem to recall that markers that are not standard resource
or text markers don't show up.
Bob
> LE
>
> "Bob Foster" <bob@objfac.com> wrote in message
> news:blv212$u5e$1@eclipse.org...
> > I don't know any quick hacks to do this. Here is the not-so-quick
method:
> >
> > 1. First, implement a parser that will a) scan the file and produce a
list
> > of errors, and b) clear all markers and generate markers where there are
> > errors.
> > 2. When the user makes a change (which you can detect in a
> > DocumentListener), run the (a) part of this parser in the background.
When
> > the parser completes, it should do an asyncExec to do the (b) part on
the
> UI
> > thread.
> >
> > Like all multi-threading solutions, the devil is in the details. The
Java
> > editor still hasn't gotten it right after two years, and I can't explain
> it
> > in a few sentences. If you search the archives, you may be able to find
> the
> > last time I tried to explain it. Whatever I said then still goes.
> >
> > Bob Foster
> >
> >
>
>
|
|
|
Re: Solved - Editor Code Annotations, What about IMarkers [message #145635 is a reply to message #145476] |
Fri, 17 October 2003 07:49  |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Bob Foster wrote:
>"Eli" <lopian@netvision.net.il> wrote in message
>news:bmh8d8$t7u$1@eclipse.org...
>
>
>>Thanks Bob.
>>This works now.
>>
>>How do I make IMarkers that don't appear in the Tasks?
>>
>>
>
>Interesting question. It's easy enough to do by accident. ;-}
>
>I don't know the correct answer because I've always been going in the other
>direction, but I seem to recall that markers that are not standard resource
>or text markers don't show up.
>
>
There's the Tasks view shows task markers
(org.eclipse.core.resources.taskmarker) and there's the Tasks List which
shows task markers (org.eclipse.core.resources.taskmarker) and problem
markers (org.eclipse.core.resources.problemmarker). In all cases
sub-type markers are included.
Dani
>Bob
>
>
>
>>LE
>>
>>"Bob Foster" <bob@objfac.com> wrote in message
>>news:blv212$u5e$1@eclipse.org...
>>
>>
>>>I don't know any quick hacks to do this. Here is the not-so-quick
>>>
>>>
>method:
>
>
>>>1. First, implement a parser that will a) scan the file and produce a
>>>
>>>
>list
>
>
>>>of errors, and b) clear all markers and generate markers where there are
>>>errors.
>>>2. When the user makes a change (which you can detect in a
>>>DocumentListener), run the (a) part of this parser in the background.
>>>
>>>
>When
>
>
>>>the parser completes, it should do an asyncExec to do the (b) part on
>>>
>>>
>the
>
>
>>UI
>>
>>
>>>thread.
>>>
>>>Like all multi-threading solutions, the devil is in the details. The
>>>
>>>
>Java
>
>
>>>editor still hasn't gotten it right after two years, and I can't explain
>>>
>>>
>>it
>>
>>
>>>in a few sentences. If you search the archives, you may be able to find
>>>
>>>
>>the
>>
>>
>>>last time I tried to explain it. Whatever I said then still goes.
>>>
>>>Bob Foster
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05312 seconds