Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

LSP is sending way too many didChange events, making it unusable #166

Open
holyjak opened this issue Oct 5, 2021 · 0 comments
Open

LSP is sending way too many didChange events, making it unusable #166

holyjak opened this issue Oct 5, 2021 · 0 comments

Comments

@holyjak
Copy link

holyjak commented Oct 5, 2021

Sometimes LSP sends many didChange events even though I barely change any file. The backend I use, clojure-lsp, does non-trivial analysis on changed files and thus consumes all my CPU for no good reason. Here is an example from its log of what it received:

10:49:42.427Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:43.231Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.008Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.104Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.134Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.389Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.557Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.591Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.699Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:44.740Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:45.815Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:57.554Z DEBUG [clojure-lsp.server:?] - :didChange 1ms
10:49:57.648Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:58.123Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:58.262Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:58.408Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:58.444Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:58.516Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:58.642Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:49:59.363Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:00.515Z DEBUG [clojure-lsp.server:?] - :didChange 1027ms
10:50:01.369Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:01.486Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:01.501Z DEBUG [clojure-lsp.server:?] - :didSave 0ms
10:50:01.501Z DEBUG [clojure-lsp.server:?] - :didSave 0ms
10:50:22.613Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:22.817Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:25.195Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:25.322Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:25.489Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:32.575Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:34.988Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:35.779Z DEBUG [clojure-lsp.server:?] - :didChange 1ms
10:50:35.938Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:36.076Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:36.093Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:36.110Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:36.208Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:36.363Z DEBUG [clojure-lsp.server:?] - :didChange 1ms
10:50:36.391Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:36.407Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:38.700Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:41.500Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:42.941Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:43.061Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:43.090Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:52.149Z DEBUG [clojure-lsp.server:?] - :didChange 0ms
10:50:55.584Z DEBUG [clojure-lsp.server:?] - :didSave 0ms

It is not clojure-lsp issue because when I use it from VS Code, it works just fine. So the cause seems indeed to be that LSP sends too many of these didChange events in a short time window.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant