-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add LspComplete
autocmd
#25788
Comments
You could use the The protocol doesn't have any other special mechanism to identify when a server has indexed a project, or if it finished compilation or analysis. Further, any text changes you make can always trigger a re-compilation or analysis. |
Could you expand on the As for triggering re-compilation / analysis, that's not much of a concern in this use-case as the intent is to make plug-ins available after the first time (at least) that the LSP is indexed and ready. If the event triggers once again later, though not ideal, it's still certainly an improvement. https://github.com/simrat39/symbols-outline.nvim is a decent example. It cannot display until the LSP is done checking the files for the first time. |
We would not add a new event for this, it could perhaps be a
|
The problem is that there is no defined "I finished analysing the project" event. Even if we wanted, we couldn't add a I think your best option is to continue using |
Thank you for those details, I can see the bigger picture now! I'll try out |
Problem
Some plug-ins that I use only function if LSP is available and has already run on a particular buffer. If I wanted to delay-load these plug-ins with a plug-in manager like lazy.nvim, there's currently no straightforward way to do this. Existing related autocmds such as
:h LspRequest
and:h LspProgressUpdate
are spammy and also get called too early.It'd be nice if there was a "LSP is done now" side-effect, which motivated the idea of a new
LspComplete
autocmd.I've got a User autocmd that basically implements what I had in mind if you want to check it out (A big thanks to fidget.nvim for inspiring this code)
Click to expand
And is callable with
This request might tie into or be related to future implementations of #25714
Expected behavior
An autocmd that is called after LSP has been fully attached and initialized on some buffer. I think it'd be fine it if is called more than once if the LSP needs to re-index or do some other kind of work. But ideally this should be at the "end" of that work
The text was updated successfully, but these errors were encountered: