justinbarclay / parinfer-rust-mode

Simplifying how you write Lisp
https://shaunlebron.github.io/parinfer/
GNU General Public License v3.0
227 stars 16 forks source link

inhibit-modification-hooks seems to interfere with lsp-mode #55

Closed lassemaatta closed 3 months ago

lassemaatta commented 3 years ago

When using parinfer-rust-mode with lsp-mode, sometime the ending delimiters (), ], }) are not visible to the LSP server. Based on a discussion in the lsp-mode ticket, the problem seems to relate to how parinfer-rust-mode uses inhibit-modification-hooks.

See original issue: emacs-lsp/lsp-mode#3048

justinbarclay commented 3 years ago

I don't have that much time to play with this at the moment. But if you want to disable lines 404 and 426-427 of parinfer-rust-mode.el (the lines that touch inhibit-modification-hooks) and let me know if that improves the experience that would help me out tremendously.

lassemaatta commented 3 years ago

My initial impressions after testing the modifications for a few minutes: the problem seems to be resolved and I've yet to notice any other side-effects. I'll keep using my modified version and report back if I encounter anything odd.

I don't have that many emacs packages installed so, of course, it's possible that these changes might cause problems with other users. Perhaps a conservative approach (assuming I don't detect any problems when testing this) might be to add a user-configurable variable, which could disable the inhibit hook? :thinking:

justinbarclay commented 3 months ago

Closing this because inhibit-modification-hook is no longer touched by parinfer-rust-mode. The last remnants of that were removed here a88eff726d50cbb9c666cf75c31df38b697c2ee4