From 71c22b41f301ad9f9ca094bf9bc842d422ac5458 Mon Sep 17 00:00:00 2001 From: "vadim.bondaruk" Date: Sat, 12 Sep 2026 10:58:01 +0300 Subject: [PATCH] fix(windows): use vim.json.decode to avoid E5560 in fast-event context vim.fn.json_decode is a Vimscript function call, which Neovim forbids from fast-event contexts such as the vim.uv timer/job callback used during Windows server discovery. This raised E5560, which the surrounding pcall then mislabeled as a JSON parse failure. vim.json.decode is Lua-native and callable from fast-event context, and is API-equivalent for this use, so parsing behavior is unchanged. --- lua/opencode/server/discovery/process/windows.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/opencode/server/discovery/process/windows.lua b/lua/opencode/server/discovery/process/windows.lua index fc484ad6..1215c512 100644 --- a/lua/opencode/server/discovery/process/windows.lua +++ b/lua/opencode/server/discovery/process/windows.lua @@ -23,7 +23,7 @@ function M.get() return Promise.resolve({}) end - local ok, processes = pcall(vim.fn.json_decode, ps_stdout) + local ok, processes = pcall(vim.json.decode, ps_stdout) if not ok then return Promise.reject("Failed to parse `powershell` output: " .. tostring(processes)) end