Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » problem markers
problem markers [message #27833] Mon, 07 July 2008 23:35 Go to next message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
I know how to report a problem in the problems view (if it is enabled and
available),
i.e. by calling IProblemReporter.reportProblem. However, I am not sure how
if/how
to add the returned problem marker (IMarker) to an editor window.
Would someone please tell me:
a) Is it necessary to do something with the returned marker or is a
marker automatically added to your editor window?
b) If you need to do something, what exactly do you have to do with that
marker?

Thanks,
Chuck
Re: problem markers [message #27875 is a reply to message #27833] Tue, 08 July 2008 04:56 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Chuck,

markers in the editor window are managed by the
org.eclipse.dltk.internal.ui.editor.SourceModuleDocumentProv ider.SourceModuleAnnotationModel


It should listen to marker changes and update markers automatically.

Actually the marker change listener is in the base class
org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel.

If something does not work for you - you need to check what annotation
model is created for your editor - start debug at the
SourceModuleDocumentProvider#createFileInfo(Object element)

Regards,
Alex


Chuck Doucette wrote:
> I know how to report a problem in the problems view (if it is enabled and
> available),
> i.e. by calling IProblemReporter.reportProblem. However, I am not sure how
> if/how
> to add the returned problem marker (IMarker) to an editor window.
> Would someone please tell me:
> a) Is it necessary to do something with the returned marker or is a
> marker automatically added to your editor window?
> b) If you need to do something, what exactly do you have to do with that
> marker?
>
> Thanks,
> Chuck
Re: problem markers [message #28228 is a reply to message #27875] Fri, 11 July 2008 20:17 Go to previous messageGo to next message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
As I said, I create problem markers by calling
IProblemReporter.reportProblem.
I am using the default annotation model. I haven't debugged that yet, but I
assume I shouldn't have to.

Apparently, problems are associated with a resource since
DLTKProblemReporter.reportProblem calls IResource.createMarker.

My issues now are that:
a) Sometimes problems are cleared that aren't resolved (perhaps because
their source position changed?)
b) Sometimes the same problem is listed multiple times.

I don't see how this could happen if I/we always call
IProblemReporter.clearMarkers before every call to:
a) parse
b) do semantic checks

Chuck

"Alex Panchenko" <alex@xored.com> wrote in message
news:g4us26$9gd$1@build.eclipse.org...
> Hi Chuck,
>
> markers in the editor window are managed by the
> org.eclipse.dltk.internal.ui.editor.SourceModuleDocumentProv ider.SourceModuleAnnotationModel
>
> It should listen to marker changes and update markers automatically.
>
> Actually the marker change listener is in the base class
> org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel.
>
> If something does not work for you - you need to check what annotation
> model is created for your editor - start debug at the
> SourceModuleDocumentProvider#createFileInfo(Object element)
>
> Regards,
> Alex
>
>
> Chuck Doucette wrote:
>> I know how to report a problem in the problems view (if it is enabled and
>> available),
>> i.e. by calling IProblemReporter.reportProblem. However, I am not sure
>> how if/how
>> to add the returned problem marker (IMarker) to an editor window.
>> Would someone please tell me:
>> a) Is it necessary to do something with the returned marker or is a
>> marker automatically added to your editor window?
>> b) If you need to do something, what exactly do you have to do with
>> that marker?
>>
>> Thanks,
>> Chuck
Re: problem markers [message #28265 is a reply to message #28228] Fri, 11 July 2008 20:50 Go to previous messageGo to next message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
At least some of this may have happened since my builder was not clearing
the markers.
It is now.
Thus,
a) initially the file is built when the project is opened (and the problems
window is populated as needed)
b) the file is edited dynamically and the problems window is cleared and
repopulated (via reconcilation and my semantic checker being called from
ISourceElementParser.parse)
c) the file is saved, and incremental build is started, and the problems
window is cleared and repopulated

Chuck

"Chuck Doucette" <cdoucette@vaultus.com> wrote in message
news:g58f7l$phr$1@build.eclipse.org...
> As I said, I create problem markers by calling
> IProblemReporter.reportProblem.
> I am using the default annotation model. I haven't debugged that yet, but
> I assume I shouldn't have to.
>
> Apparently, problems are associated with a resource since
> DLTKProblemReporter.reportProblem calls IResource.createMarker.
>
> My issues now are that:
> a) Sometimes problems are cleared that aren't resolved (perhaps because
> their source position changed?)
> b) Sometimes the same problem is listed multiple times.
>
> I don't see how this could happen if I/we always call
> IProblemReporter.clearMarkers before every call to:
> a) parse
> b) do semantic checks
>
> Chuck
>
> "Alex Panchenko" <alex@xored.com> wrote in message
> news:g4us26$9gd$1@build.eclipse.org...
>> Hi Chuck,
>>
>> markers in the editor window are managed by the
>> org.eclipse.dltk.internal.ui.editor.SourceModuleDocumentProv ider.SourceModuleAnnotationModel
>>
>> It should listen to marker changes and update markers automatically.
>>
>> Actually the marker change listener is in the base class
>> org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel.
>>
>> If something does not work for you - you need to check what annotation
>> model is created for your editor - start debug at the
>> SourceModuleDocumentProvider#createFileInfo(Object element)
>>
>> Regards,
>> Alex
>>
>>
>> Chuck Doucette wrote:
>>> I know how to report a problem in the problems view (if it is enabled
>>> and available),
>>> i.e. by calling IProblemReporter.reportProblem. However, I am not sure
>>> how if/how
>>> to add the returned problem marker (IMarker) to an editor window.
>>> Would someone please tell me:
>>> a) Is it necessary to do something with the returned marker or is a
>>> marker automatically added to your editor window?
>>> b) If you need to do something, what exactly do you have to do with
>>> that marker?
>>>
>>> Thanks,
>>> Chuck
>
>
Re: problem markers [message #28303 is a reply to message #28265] Mon, 14 July 2008 04:50 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Chuck,

I am improving error reporting & marker operations now.

The results would be

a) reconcilation in the editor will not touch markers - errors will be
visualized via annotations.

b) builder will be parsing all files and creating error markers if there
were any problems encountered.

c) also there are ideas to introduces API so it would be possible to
easier integrate checkers in the build process.

Probably you should wait a few days until this work is finished and
after that build against CVS HEAD.

Regards,
Alex


Chuck Doucette wrote:
> At least some of this may have happened since my builder was not clearing
> the markers.
> It is now.
> Thus,
> a) initially the file is built when the project is opened (and the problems
> window is populated as needed)
> b) the file is edited dynamically and the problems window is cleared and
> repopulated (via reconcilation and my semantic checker being called from
> ISourceElementParser.parse)
> c) the file is saved, and incremental build is started, and the problems
> window is cleared and repopulated
>
> Chuck
>
> "Chuck Doucette" <cdoucette@vaultus.com> wrote in message
> news:g58f7l$phr$1@build.eclipse.org...
>> As I said, I create problem markers by calling
>> IProblemReporter.reportProblem.
>> I am using the default annotation model. I haven't debugged that yet, but
>> I assume I shouldn't have to.
>>
>> Apparently, problems are associated with a resource since
>> DLTKProblemReporter.reportProblem calls IResource.createMarker.
>>
>> My issues now are that:
>> a) Sometimes problems are cleared that aren't resolved (perhaps because
>> their source position changed?)
>> b) Sometimes the same problem is listed multiple times.
>>
>> I don't see how this could happen if I/we always call
>> IProblemReporter.clearMarkers before every call to:
>> a) parse
>> b) do semantic checks
>>
>> Chuck
>>
>> "Alex Panchenko" <alex@xored.com> wrote in message
>> news:g4us26$9gd$1@build.eclipse.org...
>>> Hi Chuck,
>>>
>>> markers in the editor window are managed by the
>>> org.eclipse.dltk.internal.ui.editor.SourceModuleDocumentProv ider.SourceModuleAnnotationModel
>>>
>>> It should listen to marker changes and update markers automatically.
>>>
>>> Actually the marker change listener is in the base class
>>> org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel.
>>>
>>> If something does not work for you - you need to check what annotation
>>> model is created for your editor - start debug at the
>>> SourceModuleDocumentProvider#createFileInfo(Object element)
>>>
>>> Regards,
>>> Alex
>>>
>>>
>>> Chuck Doucette wrote:
>>>> I know how to report a problem in the problems view (if it is enabled
>>>> and available),
>>>> i.e. by calling IProblemReporter.reportProblem. However, I am not sure
>>>> how if/how
>>>> to add the returned problem marker (IMarker) to an editor window.
>>>> Would someone please tell me:
>>>> a) Is it necessary to do something with the returned marker or is a
>>>> marker automatically added to your editor window?
>>>> b) If you need to do something, what exactly do you have to do with
>>>> that marker?
>>>>
>>>> Thanks,
>>>> Chuck
>>
>
>
Re: problem markers [message #28415 is a reply to message #28303] Mon, 14 July 2008 07:28 Go to previous messageGo to next message
Abhijit is currently offline AbhijitFriend
Messages: 18
Registered: July 2009
Junior Member
hi Alex,

I have a similar issue with error reporting.

In my case, suppose i opened a script file, make a small change so as to
produce a syntax error, the reconciler runs my syntax checker and shows
the errors in problems view.

So far so good; now do not save the file and close it without saving, the
problems view is not cleared.

When i reopen the file, it opens the saved file which doesnot have any
syntax errors. But my problems view still shows errors of the unsaved
version.

I tried to debug and found that getProblemReporter() in
AbstractSourceElementParser is null, for first parse on the script file,
which is why it fails.

Can you help me please.

Thanks and regards,
Abhijit.







Alex wrote:
Hi Chuck,

I am improving error reporting & marker operations now.

The results would be

a) reconcilation in the editor will not touch markers - errors will be
visualized via annotations.

b) builder will be parsing all files and creating error markers if there
were any problems encountered.

c) also there are ideas to introduces API so it would be possible to
easier integrate checkers in the build process.

Probably you should wait a few days until this work is finished and after
that build against CVS HEAD.

Regards,
Alex
Re: problem markers [message #28448 is a reply to message #28415] Tue, 15 July 2008 13:41 Go to previous message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi all,

This is fixed in CVS HEAD

You can download 1.0 integration build at
http://download.eclipse.org/technology/dltk/downloads/

Reagrds,
Alex

Abhijit wrote:
> hi Alex,
>
> I have a similar issue with error reporting.
> In my case, suppose i opened a script file, make a small change so as to
> produce a syntax error, the reconciler runs my syntax checker and shows
> the errors in problems view.
> So far so good; now do not save the file and close it without saving,
> the problems view is not cleared.
>
> When i reopen the file, it opens the saved file which doesnot have any
> syntax errors. But my problems view still shows errors of the unsaved
> version.
>
> I tried to debug and found that getProblemReporter() in
> AbstractSourceElementParser is null, for first parse on the script file,
> which is why it fails.
>
> Can you help me please.
>
> Thanks and regards,
> Abhijit.
>
>
>
>
>
>
>
> Alex wrote:
> Hi Chuck,
>
> I am improving error reporting & marker operations now.
>
> The results would be
>
> a) reconcilation in the editor will not touch markers - errors will be
> visualized via annotations.
>
> b) builder will be parsing all files and creating error markers if there
> were any problems encountered.
>
> c) also there are ideas to introduces API so it would be possible to
> easier integrate checkers in the build process.
>
> Probably you should wait a few days until this work is finished and
> after that build against CVS HEAD.
>
> Regards,
> Alex
>
>
>
Previous Topic:Tracking parsing/semantic errors/warnings (problems)
Next Topic:ASTListNode.printNode(CorePrinter)
Goto Forum:
  


Current Time: Thu Apr 25 15:44:07 GMT 2024

Powered by FUDForum. Page generated in 0.03899 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top