Skip to content

perf(diagnostics): avoid loading remote documents for marker offsets#1401

Merged
rubenporras merged 1 commit intoeclipse-lsp4e:mainfrom
sebthom:issue-160
Nov 18, 2025
Merged

perf(diagnostics): avoid loading remote documents for marker offsets#1401
rubenporras merged 1 commit intoeclipse-lsp4e:mainfrom
sebthom:issue-160

Conversation

@sebthom
Copy link
Copy Markdown
Member

@sebthom sebthom commented Nov 14, 2025

Avoid calling LSPEclipseUtils.getDocument for non-file: URIs so diagnostics for remote resources no longer trigger expensive content loads just to compute marker offsets. Persist raw LSP range (start/end line/character) on diagnostic markers and use it to match existing markers when no IDocument is available, reducing unnecessary delete/recreate cycles for remote files. Keep existing behavior for local/workspace files and open editors by still computing document-based CHAR_START/CHAR_END and line numbers when a document is present.

Addresses #160

@sebthom
Copy link
Copy Markdown
Member Author

sebthom commented Nov 14, 2025

@rubenporras can you give this a try please.

@sebthom sebthom requested a review from rubenporras November 14, 2025 21:10
Avoid calling LSPEclipseUtils.getDocument for non-file: URIs so
diagnostics for remote resources no longer trigger expensive content
loads just to compute marker offsets. Persist raw LSP range (start/end
line/character) on diagnostic markers and use it to match existing
markers when no IDocument is available, reducing unnecessary
delete/recreate cycles for remote files. Keep existing behavior for
local/workspace files and open editors by still computing document-based
CHAR_START/CHAR_END and line numbers when a document is present.
@sebthom sebthom marked this pull request as ready for review November 17, 2025 13:27
@rubenporras
Copy link
Copy Markdown
Contributor

@sebthom , amazing. Thanks a lot!

I could only do one quick test, but so far it seems to be very fast. If I can I want to compare to the performance without this PR and then review the code.

@rubenporras
Copy link
Copy Markdown
Contributor

It works great

@rubenporras rubenporras merged commit 9dfdf10 into eclipse-lsp4e:main Nov 18, 2025
10 checks passed
@sebthom sebthom deleted the issue-160 branch November 18, 2025 18:47
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

Successfully merging this pull request may close these issues.

2 participants