Skip to content

feat: pull diagnostics support#2978

Open
jasonlyu123 wants to merge 7 commits intosveltejs:masterfrom
jasonlyu123:pull-diagnostics
Open

feat: pull diagnostics support#2978
jasonlyu123 wants to merge 7 commits intosveltejs:masterfrom
jasonlyu123:pull-diagnostics

Conversation

@jasonlyu123
Copy link
Member

@jasonlyu123 jasonlyu123 commented Mar 14, 2026

This switches the diagnostics from push model (server to client) to the pull model when the client supports it. The advantage is that the client can prioritise sending the diagnostic request for the visible tab. With this, we can check the document split to the side immediately and don't need to check all open files after a file save. The pull mode has a way to tell the client that the diagnostics haven't changed. I implement this mostly because VSCode sends another diagnostic request for the same files when switching files in the editor, even if the file isn't changed.

I also lowered the debounce delay in the push-mode diagnostics. I've been wondering if some of the performance complaints are actually just because the artificial delay is too long for some people. The pull mode also has a much lower artificial delay. I think we can give it a try. If people are complaining about it, we can switch to an approach similar to the "smart" mode.

@changeset-bot
Copy link

changeset-bot bot commented Mar 14, 2026

🦋 Changeset detected

Latest commit: 242348b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-language-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant