Refactor code action annotations#2835
Merged
jwortmann merged 9 commits intosublimelsp:mainfrom Mar 31, 2026
Merged
Conversation
Member
Author
|
I added a new change that fixes a bug on main which causes to run the code action twice when you double click on an annotation (because the annotation gets only removed/updated when new diagnostics arrive). The new code uses the encoded URIs for code action annotations, and I've modified that now to also include the version number of the view. That number can then be compared to the current change count of the view and prevent to run the code action if the version is outdated. |
rchl
reviewed
Mar 30, 2026
✅ Deploy Preview for sublime-lsp ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
rchl
reviewed
Mar 31, 2026
rchl
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses the first point from #2800:
When new diagnostics from a server arrive, code actions for the selection are only requested again for that particular session, and not for all sessions.
I have also changed that if there are multiple code actions available, all of them are shown directly in the annotation now, instead of a "3 code actions" link that opens the quick panel. ST always displays the annotation as a single line anyway, with a "linebreak" icon if there are multiple lines, revealing the other lines on mouse hover.
Code actions are sorted so that actions with the
isPreferredproperty are on top.Before:
After:
on mouse hover:
We could revert this change if there is any advantage of the "3 code actions" style. But I think the multi-line annotation should be fine?
I have only tested with a single session. I'll maybe check again tomorrow that I haven't broken anything with these refactorings, but I think it should work.