kosayoda / nvim-lightbulb

VSCode 💡 for neovim's built-in LSP.
MIT License
783 stars 27 forks source link

Fix #39 #46

Closed qsdrqs closed 1 year ago

qsdrqs commented 1 year ago

This PR contains 2 commits and should fix #39.

The first commit adds an ignore_id option to opts in update_lightbulb. That is because if we just set opts.ignore[client.id] = true in init.lua:201, the ignore table will be messed up.

For example, if we have two client clangd which have the id 1, and null-ls, which have the id 2. Then set ignore to {"null-ls"}, after init.lua:201, the ignore will be {"null-ls", true}. So when code comes to init.lua:147, for clangd that has id 1, the not opts.ignore[client_id] will also be false because not "null-ls" = false. So storing the client id in a standalone field will prevent the table to be messed up.

The second commit change config usage into opts because config will not respect the default options that are set by setup but opts will.

I'm not very familiar with the code of the repo so if I break anything, feel free the change it.

kosayoda commented 1 year ago

Hello! Thanks a lot for the PR, and apologies for the long response time.