Skip to content

PR #1513 breaks nvim v0.10.3 stable release #1514

@vunhatchuong

Description

@vunhatchuong

Describe the bug

PR #1513 uses the new form of vim.validate which isn't available in stable release yet.

Error executing vim.schedule lua callback: ....local/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/util.lua:235: opt: expected table, got string
stack traceback:
	[C]: in function 'error'
	vim/shared.lua: in function 'validate'
	....local/share/nvim/lazy/lspsaga.nvim/lua/lspsaga/util.lua:235: in function 'get_offset_encoding'
	...m/lazy/lspsaga.nvim/lua/lspsaga/codeaction/lightbulb.lua:110: in function 'render'
	...m/lazy/lspsaga.nvim/lua/lspsaga/codeaction/lightbulb.lua:137: in function <...m/lazy/lspsaga.nvim/lua/lspsaga/codeaction/lightbulb.lua:135>

Upstream PR neovim/neovim#30855

Steps to reproduce

Uses on nvim stable version v0.10.3

Expected behavior

No error

This is how I fix in one of the plugin

- vim.validate("config", config, "table", true)
- vim.validate("config.targets", config.targets, "table", true)
- vim.validate("config.additional_targets", config.additional_targets, "table", true)
+ vim.validate({ config = { config, "table" } })
+ vim.validate({
+    ["config.targets"] = { config.targets, { "table", "nil" } },
+ })
+ vim.validate({
+ ["config.additional_targets"] = {
+    config.additional_targets,
+    { "table", "nil" },
+ },
+ })

Neovim version (nvim -v)

NVIM v0.10.3 Build type: RelWithDebInfo LuaJIT 2.1.1731601260

lspsaga commit

e5e25f8

Terminal name/version

ghostty

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions