-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Semantic Ranges #3307
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
Semantic Ranges #3307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
r=me with nits fxed
}; | ||
|
||
for event in root.preorder_with_tokens() { | ||
match event { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add a quick
if element.text_range().intersection(range_to_highlight).is_none() { continue }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would you like that? On the LSP side the server is allowed to return all highlights for the file if it can't do the range for whatever reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For every event: if parent happens to be a big node, like an impl, we might process unnecessary children
bors r+ |
Build succeeded |
I haven't really followed the semantic highlighting changes. Will we now (after the client changes) have faster highlighting thanks to this? |
If I run this branch on insiders with the necessary changes to the client (this uses the We still use the machinery in If the client sends |
I definitely hope for fewer highlighting bugs per second here :)
…On Tuesday, 25 February 2020, Jeremy Kolb ***@***.***> wrote:
@lnicola <https://github.com/lnicola>
If I run this branch on insiders with the necessary changes to the client
(this uses the textDocument/semantcTokens request) it definitely colors
faster than on stable but I'm not sure what accounts for that.
We still use the machinery in syntax_highlighting so at the moment
generating tokens will stay the same.
If the client sends textDocument/semanticTokens/range requests for a
viewport (this PR) it could potentially be faster since we wouldn't need to
generate or transmit tokens for the whole file. There is also the
textDocument/semanticTokens/edits request which is supposed to
efficiently report deltas between document revisions. I have yet to see
either of these requests in the insiders build when we advertise the
features.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3307>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3M7CVOSCSP3YAP46JTDREWFQZANCNFSM4K3N5CWQ>
.
|
But I haven't seen a highlighting bug since I disabled the rainbow thingy last year 😆. |
Well, I don’t *see* highlighting until I start editing code :)
…On Tuesday, 25 February 2020, Laurențiu Nicola ***@***.***> wrote:
But I haven't seen a highlighting bug since I disabled the rainbow thingy
last year 😆.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3307>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3M6LUU4PTO6667RAA3TREWGRNANCNFSM4K3N5CWQ>
.
|
@matklad Sooooooo I'm actually seeing that with API as well. We get syntax highlighting but occasionally semantic highlighting (AND decorations... maybe that's a hint?) won't kick in until we edit a file. EDIT: Nevermind I think this is because of a panic. |
No description provided.