-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSPDiagnosticsToMarkers usage of LSPEclipseUtils.toOffset #160
Comments
Although it's not a written down explicitly, it's indeed a requirement. See all references to
Those attributes are used -among others- to draw the red squiggle underline at the right location.
Yes.
That's something to discuss on a different issue against eclipse.platform.text repo. |
I think it'd be simpler to ask LSP to allow a documentPosition, |
You mean asking for it in https://github.com/microsoft/language-server-protocol? |
yes, explaining the case of remote documents. |
I have noticed that LSPDiagnosticsToMarkers uses LSPEclipseUtils.toOffset to recalculate the start and end positions of the diagnostics published by the language server.
This is a performance issue for us because our filesystem implementation is based on remote files, and for the recalculation of these offsets the text of the resource must be fetch from the remote connection. We have many of these remote files with markers that need to be propagated, so it is an overhead of several seconds that would be very nice to avoid.
I see that the offsets are used to detect markers which are already present, and for this usage, the offsets coming from the server should be good enough.
I see that the offsets are also saved as marker attributes (
IMarker.CHAR_START
andIMarker.CHAR_END
). Is there a requirement in the platform that tells that the offsets must be relative to the start of the document instead of to the start of the line of the marker? I could not find this in the documentation on theIMarker
class. The problems view does not show this attributes, so I think the only problem would be the editor itself.Is the reason of this recalculation of offsets that org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.createPositionFromMarker(IMarker) needs offsets relative to the beginning of he document? If so, would it be possible to subclass it to use offsets relative to the line and use that subclass to show the markers in the
org.eclipse.ui.internal.genericeditor.ExtensionBasedTextEditor
? Does it sound like something we could do?Thanks
The text was updated successfully, but these errors were encountered: