Skip to content

Commit 5cff548

Browse files
authored
fix(lspconfig): add hook before and not after (#92)
## Description A common use of `on_new_config` is to construct the `cmd` for starting language servers based on the configuration. These language servers require that the settings are finalized before it is run. It looks like previous commits did use `add_hook_before` for the `lspconfig` integration but it got moved to being `add_hook_after` when centralizing it with the `lua_ls` and `jsonls` plugin integrations. We should revert this back to `add_hook_before` so that the existing `on_new_config` functions continue working.
1 parent 87f703a commit 5cff548

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/neoconf/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ end
3939
---@param opts { on_config: fun(config, root_dir:string, original_config), root_dir: fun(), name: string }
4040
function M.on_config(opts)
4141
local lsputil = require("lspconfig.util")
42-
local hook = lsputil.add_hook_after
42+
local hook = lsputil.add_hook_before
4343

4444
lsputil.on_setup = hook(lsputil.on_setup, function(initial_config)
4545
if opts.on_config then

0 commit comments

Comments
 (0)