fix gopls without setting ale_go_gopls_init_options (#5059)

This commit is contained in:
halfcrazy
2026-01-25 15:25:25 +08:00
committed by GitHub
parent 8eb4803da9
commit c0dd8167a6
3 changed files with 78 additions and 0 deletions

View File

@@ -8,6 +8,14 @@ module.start = function(config)
config.init_options[true] = nil
end
-- ensure init_options uses empty_dict if empty
if type(config.init_options) == "table"
and next(config.init_options) == nil
and getmetatable(config.init_options) == nil
then
config.init_options = vim.empty_dict()
end
-- If configuring LSP via a socket connection, then generate the cmd
-- using vim.lsp.rpc.connect(), as defined in Neovim documentation.
if config.host then