Giter Club home page Giter Club logo

Comments (12)

deathaxe avatar deathaxe commented on May 24, 2024 1

Each time a new diagnostics response is received, the panel's content is cleared and rebuilt from scratch using "view.insert()" for each message. This causes flickering, if many items are added.

To solve this issue, all responses must be converted to the text content in the background and then be used to replace the whole panal's content with one "view.replace()" call.

EDIT: Maybe the scoll position should even be restored after update rather than scrolling to the bottom.

from lsp.

rmccue avatar rmccue commented on May 24, 2024

Debouncing the update would help somewhat here (VS Code seems to use "editor.quickSuggestionsDelay": 10) but I think there's also an issue with the redrawing generally.

from lsp.

chenglou avatar chenglou commented on May 24, 2024

This is especially disturbing when the error surpasses a screenful. The whole view starts scrolling a lot

from lsp.

tomv564 avatar tomv564 commented on May 24, 2024

Could you enable log_debug in your settings and share the results of a single keypress? A single diagnostics update should result in 1 update of the panel, but the way we write lines to the panel may not be batched in an efficient manner.

from lsp.

chenglou avatar chenglou commented on May 24, 2024
LSP: notify: textDocument/didSave
LSP: notify: textDocument/didSave
LSP: got json:  {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"range":{"end":{"character":10,"line":88},"start":{"character":2,"line":78}},"message":"Warning 34: unused type ac
LSP: got json:  {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"range":{"end":{"character":10,"line":88},"start":{"character":2,"line":78}},"message":"Warning 34: unused type ac

Two here

from lsp.

tomv564 avatar tomv564 commented on May 24, 2024

@deathaxe that sounds like a great fix!
@chenglou Two didSave events! That's not good - are you running some format-on-save logic (eg. another plugin?)?

from lsp.

chenglou avatar chenglou commented on May 24, 2024

No format on save

from lsp.

rmccue avatar rmccue commented on May 24, 2024

I'm only seeing the one textDocument/didChange event here, but that's still causing the flickering. I'll look at the view.replace() fix and see if that helps.

from lsp.

tomv564 avatar tomv564 commented on May 24, 2024

Merging the PR closed the issue, we can re-open if this hasn't improved.

from lsp.

tsujp avatar tsujp commented on May 24, 2024

This is still an issue.

from lsp.

tomv564 avatar tomv564 commented on May 24, 2024

Hi @tsujp, thanks for commenting in the original issue!
Can you share some details (what server are you running, when does it flicker?) A log covering a fresh start to a repro (with the LSP log_debug setting would be much appreciated!

from lsp.

tsujp avatar tsujp commented on May 24, 2024

@tomv564 very sorry, I did not have "only_show_lsp_completions": true set which was the cause of the issue, I should've more thoroughly checked the setup. When I removed some things to get the diagnostics I noticed the setting.

So, setting "only_show_lsp_completions": true removed the 'problem' (which was really me hehe).

from lsp.

Related Issues (20)

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.