Repository navigation
feat: the Semantic Tokens Inspector formats without a write action, and shows the language server, its legend and the data of the answer - #2402
Open
lagergren wants to merge 2 commits into
Conversation
…ing pass without a write action Each highlighting pass formatted its tokens for the open inspector in a throwaway document, inside WriteCommandAction.runWriteCommandAction: a write action on the UI thread, which cancels the highlighting passes that run. The tags are now inserted in a StringBuilder, at the same offsets and in the same order, which gives the same text.
…gend and the data of the answer The left panel of the inspector shows, for the selected file, the name of the language server that its tokens come from, the token types and modifiers of its legend, and the data of the answer, a line per token, for the first 1000 tokens. SemanticTokensInspectorData carries them. Fixes redhat-developer#2349
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 52 minutes. View limit details
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2402 +/- ##
==========================================
- Coverage 60.26% 60.17% -0.09%
==========================================
Files 864 864
Lines 37908 37948 +40
Branches 7847 7857 +10
==========================================
- Hits 22845 22835 -10
- Misses 11947 11996 +49
- Partials 3116 3117 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #2349.
Gap 10 of #2334. Two commits, for rebase-merge.
1. perf: the inspector formats without a write action
Before: while the Semantic Tokens Inspector was open, each highlighting pass formatted its tokens in a throwaway
DocumentImpl, insideWriteCommandAction.runWriteCommandAction. That is a write action on the UI thread, which cancels the highlighting passes that run.Now: the tags go into a
StringBuilder, at the same offsets and in the same order as the document edits, which gives the same text.formatkeeps its signature.2. feat: the inspector shows the answer the tokens come from
Before: the inspector showed the decoded tokens only, without the language server they came from, its legend, or the data of its answer.
Now:
SemanticTokensInspectorDatahas three new components:languageServer,legendanddata. Its earlier constructors remain, withnullfor them.SemanticTokensData.highlightfills them, with the server's name from the semantic tokens feature's client features.UserGuide.md.Behaviour changes
Tests
SemanticTokensInspectorTest:ApplicationListener. With the old formatting it fails: 1 write action;SemanticTokensInspectorAnswerTest: a real highlighting with the mock server gives the inspector the server's name, its legend and the answer's data.