Skip to content
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

Question: Marker offsets mismatch between text editor and LSP #886

Open
rubenporras opened this issue Jun 28, 2022 · 0 comments
Open

Question: Marker offsets mismatch between text editor and LSP #886

rubenporras opened this issue Jun 28, 2022 · 0 comments

Comments

@rubenporras
Copy link
Contributor

Hi,

The range of a marker in LSP is defined relative to the line, while in eclipse.platform.text it is relative to the start of the document.

This causes bad performance if the files are stored remotely (See eclipse-lsp4e/lsp4e#160), as creating the markers with the correct offset requires fetching the text from the remove endpoint and recalculating all offsets. Specially fetching the text is quite expensive for the remove files, so if many marker exits (we have +10000 in our workspaces), the recalculation creates a big overhead.

Would it be possible to subclass org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.createPositionFromMarker(IMarker) to use offsets relative to the line and use that subclass to show the markers in the org.eclipse.ui.internal.genericeditor.ExtensionBasedTextEditor if a newer version of LSP4E is used? This way we would avoid the offset recalculation.

If you think that is doable, we could work on it, on eclipse.platform.text and on the LSP4E project.

Regards

@rubenporras rubenporras changed the title Marker offsets mismatch between text editor and LSP Question: Marker offsets mismatch between text editor and LSP Jun 28, 2022
iloveeclipse referenced this issue in iloveeclipse/eclipse.platform.text Jul 27, 2022
Fixed test that didn't created Display but disposed it.
Fixed tests that didn't closed created shells or assumed wrong number of
shells after creation of new.

See eclipse-platform/eclipse.platform.ui#50
@laeubi laeubi transferred this issue from eclipse-platform/eclipse.platform.text Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant