Skip to content

Conversation

@mitsaucepls
Copy link
Contributor

Hello, I noticed that I get an error when I try to edit an empty openapi.yaml file.

Specificly:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:214: attempt to get length of local 'diagnostics' (a nil value)

stack traceback:
        /usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:214: in function 'handle_diagnostics'
        /usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:240: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp/client.lua:1117: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

This resulted from returning nil instead of an empty list as diagnostics.
As required by the specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#publishDiagnosticsParams

I also renamed interface{} to any. Since its the new style.

@daveshanley daveshanley added the release/patch Patch / non-breaking release label Oct 22, 2025
Copy link
Owner

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daveshanley daveshanley merged commit e98c328 into daveshanley:main Oct 22, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/patch Patch / non-breaking release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants