yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
447 stars 43 forks source link

`omnifunc` is not set when `LspOptionsSet` is called after `LspAddServer` #532

Open nv-quan opened 1 month ago

nv-quan commented 1 month ago

The documentation states that setting autoComplete to false will automatically set omniComplete to true, and omnifunc will be set. However, this does not work as expected when LspOptionsSet is called after LspAddServer. The documentation should clarify the required order of calling LspOptionsSet and LspAddServer. Alternatively, the code should ensure omniComplete is set correctly after LspOptionsSet is called, or even better, refactor LspAddServer to accept LSP options as an argument.

Konfekt commented 1 month ago

This was discussed already a couple of times, say in https://github.com/yegappan/lsp/pull/442/files and https://github.com/yegappan/lsp/commit/e3216cae9583c655bfb1c3cfac399738d0521621, and https://github.com/yegappan/lsp/commit/87189faf0bd4a2f974408df2d8c261dbfc3348dd ; the doc now states the correct order of calling LspOptionsSet and LspAddServer. However, I'd agree that it would make users' life simpler if the importance of this order was drawn to attention.