You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, I've noticed that sometimes following a paren change made by parinfer, the LSP thinks I have unbalanced parens. Upon save (and thus auto-reformat) the code gets reformatted by the LSP quite strangely, as if a paren had indeed been missing. The LSP then won't go back to normal operation until I restart it completely. Since this happens every few minutes, it's making the dev experience a bit jarring 😆
Theorizing elsewhere, peers have pointed out:
Just a hunch, but it sounds like parinfer is modifying the buffer without triggering the modification hooks lsp-mode uses to report buffer changes to the server, so the server is operating on a stale buffer.
I recall that being an issue with some other editing package, but can't remember which. aggressive-indent, maybe?
and
It's not unusual to do:
(let ((inhibit-modification-hooks t))
...do the thing...)
To prevent clobbering hooks or infinite recursion, but rarely are they triggered afterwards, which would resolve this issue. Using combine-change-calls or combine-after-change-calls would get around that.
Does any of this sound familiar? Thank you kindly.
The text was updated successfully, but these errors were encountered:
Hi @fosskers,
I disable inhibit-modification-hooks specifically for the reason to avoid clobbering hooks or causing infinite recursion. Though, I am not sure if my use case is entirely valid.
Unfortunately my next 3 weeks are kind of full and I don't have much time to look into this. However, if you want to, you could look at https://github.com/justinbarclay/parinfer-rust-mode/blob/main/parinfer-rust-mode.el#L404 and either completely remove that line. Or wrap L404-427 in a combine-after-change-calls. If you do either of those and they work for you, I'm happy to look at a PR when I have free time again :)
Hi there, thanks for this great project; it makes writing Lisps a lot more pleasureful.
I've hit a situation where some or all of
racket-mode
,lsp-mode
,parinfer-rust-mode
, and the underlying Racket LSPracket-langserver
seem to be fighting. Here's the sister issue to this that I opened with the LSP.Basically, I've noticed that sometimes following a paren change made by parinfer, the LSP thinks I have unbalanced parens. Upon save (and thus auto-reformat) the code gets reformatted by the LSP quite strangely, as if a paren had indeed been missing. The LSP then won't go back to normal operation until I restart it completely. Since this happens every few minutes, it's making the dev experience a bit jarring 😆
Theorizing elsewhere, peers have pointed out:
and
Does any of this sound familiar? Thank you kindly.
The text was updated successfully, but these errors were encountered: