LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.29k stars 305 forks source link

don't do diagnostics when workspace is not ready #2692

Closed folke closed 3 months ago

folke commented 3 months ago

Hi!

I created a new Neovim plugin that automatically updates the workspace/library configuration for the active workspace folder based on what files the user has open in Neovim.

It works great and is a lot faster than my older neodev.nvim plugin.

However, one thing I noticed, is that when I send a workspace/didChangeConfiguration, the diagnostics of the currently open files, become all wrong (things like, string, or table does not exist). After a couple of seconds, they are then replaced by the correct diagnostics.

After debugging, it seems that diagnostics sometimes run, even when the workspace is not ready.

This PR fixes that.

abeldekat commented 3 months ago

+one:)

sumneko commented 3 months ago

Thank you!