Giter Club home page Giter Club logo

Comments (7)

badicsalex avatar badicsalex commented on August 18, 2024 1

@tiagovla , you should probably check this recent patch and reopen the issue if you still see the flicker.

from nvim-semantic-tokens.

tiagovla avatar tiagovla commented on August 18, 2024 1

@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.

theHamsta avatar theHamsta commented on August 18, 2024

@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.

theHamsta avatar theHamsta commented on August 18, 2024

@jdrouhard did you ever experience something similar?

from nvim-semantic-tokens.

tiagovla avatar tiagovla commented on August 18, 2024

@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 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...

It is indeed the on_invalidate_range/clear_highlights. Clangd works fine for me (it also calls it a lot).

from nvim-semantic-tokens.

tiagovla avatar tiagovla commented on August 18, 2024

I was counting the number of times on_invalidate_range was called using clangd.
gifcast_220625172545

from nvim-semantic-tokens.

badicsalex avatar badicsalex commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.