Skip to content

fix(progress): treat vim.NIL as nil in LSP progress fields#310

Merged
j-hui merged 1 commit into
j-hui:mainfrom
1334:fix/lsp-progress-handle-vim-nil
May 21, 2026
Merged

fix(progress): treat vim.NIL as nil in LSP progress fields#310
j-hui merged 1 commit into
j-hui:mainfrom
1334:fix/lsp-progress-handle-vim-nil

Conversation

@1334
Copy link
Copy Markdown
Contributor

@1334 1334 commented Apr 24, 2026

Some LSP servers emit $/progress notifications whose optional value.title, value.message, or value.percentage fields arrive as JSON null, which vim.lsp decodes as vim.NIL. vim.NIL is truthy in Lua but isn't a string/number, so passing it through M.poll_for_messages() unchanged crashes downstream display code on string concat / formatting.

This coerces vim.NILnil for those three fields before constructing the message table. Non-nil, non-vim.NIL values pass through unchanged.

Minimal change, scoped to lua/fidget/progress/lsp.lua. I've been running this locally for a while without regressions against servers that don't send null (they hit the ~= vim.NIL short-circuit untouched).

Copy link
Copy Markdown
Owner

@j-hui j-hui left a comment

Choose a reason for hiding this comment

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

Thank you fixing this!

@j-hui j-hui merged commit 22a59a4 into j-hui:main May 21, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants