Comments (7)
@tiagovla , you should probably check this recent patch and reopen the issue if you still see the flicker.
from nvim-semantic-tokens.
@tiagovla , you should probably check this recent patch and reopen the issue if you still see the flicker.
Funnily enough, I was checking it right now. It did fix it.
from nvim-semantic-tokens.
@tiagovla it is only called when the language server tells me to refresh. Can you check whether the LSP actually calls this method https://github.com/theHamsta/neovim/blob/5099653ae1089e9180c560b7a4172674d0fa5398/runtime/lua/vim/lsp/handlers.lua#L25-L27 (e.g. by removing the handler). Maybe we should consider to not set this handler. It does not flicker for the language server I use (clang, sumneko_lua, rust-analyzer).
What is the language server you're using?
EDIT: I see it calls on_invalidate_range/clear_highlights
on cursor move. Will check the upstream PR later. You should maybe link this issue upstream that on_invalidate_range/clear_highlights
is called to often. Actually it should only clear when it already has the highlight so the flickering is strange...
from nvim-semantic-tokens.
@jdrouhard did you ever experience something similar?
from nvim-semantic-tokens.
@tiagovla it is only called when the language server tells me to refresh. Can you check whether the LSP actually calls this method https://github.com/theHamsta/neovim/blob/5099653ae1089e9180c560b7a4172674d0fa5398/runtime/lua/vim/lsp/handlers.lua#L25-L27 (e.g. by removing the handler). Maybe we should consider to not set this handler. It does not flicker for the language server I use (clang, sumneko_lua, rust-analyzer).
I checked and it's not the on_refresh
.
What is the language server you're using?
Pylance
EDIT: I see it calls
on_invalidate_range/clear_highlights
on cursor move. Will check the upstream PR later. You should maybe link this issue upstream thaton_invalidate_range/clear_highlights
is called to often. Actually it should only clear when it already has the highlight so the flickering is strange...
It is indeed the on_invalidate_range/clear_highlights
. Clangd works fine for me (it also calls it a lot).
from nvim-semantic-tokens.
I was counting the number of times on_invalidate_range
was called using clangd.
from nvim-semantic-tokens.
I encountered a similar thing with rust_analyzer
. If I add or remove multiple lines in quick succession, there are multiple in-flight token requests. The tick check fails for the first response, which leaves the buffer un-highlighted momentarily, but then the 'correct' response arrives, and highlighting is correct again.
For now all I did was move the invalidate
call below the error checking if
, which seems to solve my problem. "Leftover" highlights are not really a problem IMO, but a stricter way to do this would be to only call invalidate if there's an actual error, since with the tick check it can be assumed that the response with the correct tick is on the way.
from nvim-semantic-tokens.
Related Issues (14)
- false branch can not grayed out, but #if 0 can grayed out(no treesitter) HOT 3
- Semantic token under cursor HOT 3
- using with clangd or pyright returns "method textDocument/semanticTokens/full is not supported" HOT 3
- Can the current preset only load the ones in the git repository? How to load a local preset? HOT 2
- How to highlight based on multiple modifiers at once? HOT 2
- token type is member HOT 9
- error "col value outside range" when inserts missing include
- inactive regions? HOT 2
- Can you provide an example of this working? HOT 4
- Missing token types HOT 1
- Highlighting of modifiers is broken HOT 1
- Work without "official support" HOT 5
- module 'vim.lsp.semantic_tokens' not found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-semantic-tokens.