fix(windows): use vim.json.decode to avoid E5560 in fast-event context - #327
Merged
nickjvandyke merged 1 commit intoSep 14, 2026
Merged
Conversation
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.
vad-bond
force-pushed
the
fix/windows-json-decode-fast-event
branch
from
September 12, 2026 08:22
5ff5038 to
71c22b4
Compare
Owner
|
Good find, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasks
Description
On Windows, server discovery sometimes surfaced
E5560: Vimscript function "json_decode" must not be called in a fast event context, which the surroundingpcallmislabeled as a JSON parse failure.vim.fn.json_decodeis a Vimscript function call, which Neovim forbids from the fast-event context used by thevim.uvtimer/job callback during Windows process discovery. This PR replaces it withvim.json.decode, which is Lua-native, API-equivalent for this use, and callable from fast-event context — so theE5560error no longer occurs and parsing behavior is unchanged.Testing
E5560notification appears instead of the process being discovered.vim.json.decodeparses the PowerShell JSON output identically tovim.fn.json_decode(single-object and array forms).Related Issue(s)
N/A
Screenshots/Videos
N/A