Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Marker not displayed on correct line
Marker not displayed on correct line [message #303961] Fri, 26 May 2006 12:15 Go to next message
Eclipse UserFriend
Originally posted by: matt.querix.com

Hi all,

My problem marker is not displayed on the correct line of my source file
in the editor even though I have checked that the IMarker.LINE_NUMBER
attribute is correct. Can anyone help?

Thanks in advance

Matt D.
Re: Marker not displayed on correct line [message #303968 is a reply to message #303961] Fri, 26 May 2006 13:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matt.querix.com

Hi,

I figured this out, and to the problem of markers spanning lines.
CHAR_START is not the offset from the beginning of the line specified by
LINE_NUMBER, as I thought, but the offset from the beginning of the
document. Unfortunately this makes it rather difficult for me to mark an
area of text as our compiler gives its output in terms of start_line,
end_line, start_column, end_column. For the moment I just set
LINE_NUMBER to start_line and this puts the error in the ruler on the
left of the editor at the right line.

Matt



Matt Dickie wrote:
> Hi all,
>
> My problem marker is not displayed on the correct line of my source file
> in the editor even though I have checked that the IMarker.LINE_NUMBER
> attribute is correct. Can anyone help?
>
> Thanks in advance
>
> Matt D.
Re: Marker not displayed on correct line [message #303972 is a reply to message #303968] Fri, 26 May 2006 13:33 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Matt,

I've run into the same kind of issue where the SAX parser gives me line
and column, but I can't easily/efficiently convert that to a char_start
at the point in the code where the marker is being created. If you have
access to the IDocument object, the conversion is supported quite easily:

IDocument document =
textEditor.getDocumentProvider().getDocument(textEditor.getE ditorInput());
marker.setAttribute(IMarker.CHAR_START,
document.getLineOffset(startLine) + startColumn - 1);
marker.setAttribute(IMarker.CHAR_END,
document.getLineOffset(endLine) + endColumn - 1);

It would be very nice if the marker could specify start line/column and
end line/column in addition to the character offset approach.

I'm not sure if there's a feature request for that, but it might be a
good thing. I'd love to have such support...


Matt Dickie wrote:
> Hi,
>
> I figured this out, and to the problem of markers spanning lines.
> CHAR_START is not the offset from the beginning of the line specified
> by LINE_NUMBER, as I thought, but the offset from the beginning of the
> document. Unfortunately this makes it rather difficult for me to mark
> an area of text as our compiler gives its output in terms of
> start_line, end_line, start_column, end_column. For the moment I just
> set LINE_NUMBER to start_line and this puts the error in the ruler on
> the left of the editor at the right line.
>
> Matt
>
>
>
> Matt Dickie wrote:
>> Hi all,
>>
>> My problem marker is not displayed on the correct line of my source
>> file in the editor even though I have checked that the
>> IMarker.LINE_NUMBER attribute is correct. Can anyone help?
>>
>> Thanks in advance
>>
>> Matt D.
Previous Topic:CVS merge problem
Next Topic:Tabbed Property View and MultiPageEditorPart
Goto Forum:
  


Current Time: Tue Jul 22 15:14:18 EDT 2025

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

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

Back to the top