-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up syntax highlighting in case of lsp-mode semantic tokens #53
Comments
After some research, I found that this was specifically due to the semantic tokens feature of LSP. Disabling it makes syntax highlighting much more snappy, even though the highlighting of tactics doesn't work anymore. |
I suggest to close this issue as a consequence of this fact. |
I mean, it's a workaround to simply disable the semantic tokens feature, but otherwise, this hasn't been "fixed". Fully-featured syntax highlighting is still slow. |
I see, alright. I was able to reproduce it and see the problem. I wonder how to find out whether the language server needs too long for this, or if it's due to lsp-mode, or if there's something we can do about this. |
I enabled LSP logging with I now wonder if it's possible to make lean4-mode use font-lock fontification as soon as code is inserted and we're still waiting for the semantic-token-fontification. |
I asked someone with a VS Code setup to reproduce this issue, and they have the same problem, so presumably the slowness comes from the server. Yet, the Emacs plugin should still be capable of working around their slowness. For instance:
However, I am quite the elisp noob, so I wouldn't know where to start to make this happen. An other option would be to raise this issue at the server side, to see if it's possible / reasonably easy to optimise this on their end, which would solve the problem at the root. |
Contrary to most major modes, syntax highlighting in
lean4-mode
is not instantaneous, in the sense that if I start typingdef a : Nat :=
, it won't syntax highlight until I have paused my typing, and even then there is a small delay. I haven't read the source code, but this behavior looks like as if syntax highlighting was actually performed by the language server, and passed throughlsp
, which I suspect is because parsing lean actually requires (at least partially) understanding what is parsed, due to the possible instructions to modify the parsing behavior.Yet, this feels pretty annoying, and I was wondering if it was possible to make it more snappy.
The text was updated successfully, but these errors were encountered: