You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues of neodev.nvim
I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.10.0-dev
Operating system/version
Ubuntu 22.04.2 LTS
Describe the bug
The types for the vim.fn.getreg function are incorrect, current types are function vim.fn.getreg(regname?: any, p1?: any, list?: any[]) -> string, the correct types would be the following (these can likely be simplified):
Install an lsp (and optionally a diagnostic) so type errors can be seen
Install neodev with any plugin manager (or manually)
nvim ~/.config/nvim/init.lua
type vim.fn.getreg("+", 1, true)
observe diagnostic issue, even though usage is correct
Expected Behavior
Types match usage types
Repro
~/.config/nvim/init.lua
-- Set keymap for diagnosticslocalroot=vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .reprofor_, nameinipairs({ "config", "data", "state", "cache" }) dovim.env[("XDG_%s_HOME"):format(name:upper())] =root.."/" ..nameend-- bootstrap lazylocallazypath=root.."/plugins/lazy.nvim"ifnotvim.loop.fs_stat(lazypath) thenvim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
endvim.opt.runtimepath:prepend(lazypath)
-- install pluginslocalplugins= {
"folke/tokyonight.nvim",
-- mason to install lua-language-server
{
"williamboman/mason.nvim",
build=":MasonUpdate",
config=true,
},
-- mason-lspconfig to load lua-language-server
{
"williamboman/mason-lspconfig.nvim",
dependencies="williamboman/mason.nvim",
opts= { ensure_installed= { "lua_ls" } },
},
-- nvim-lspconfig to setup lsp
{
"neovim/nvim-lspconfig",
dependencies= {
{ "folke/neodev.nvim" }, -- Load neodev"mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config=function()
require("lspconfig").lua_ls.setup({
settings= {
Lua= {
runtime= {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)version="LuaJIT",
},
workspace= {
-- Make the server aware of Neovim runtime fileslibrary=vim.api.nvim_get_runtime_file("", true),
checkThirdParty=false, -- save some time on startup
},
-- Do not send telemetry data containing a randomized but unique identifiertelemetry= {
enable=false,
},
},
},
})
end,
},
{ -- is it working?"mrded/nvim-lsp-notify",
main="lsp-notify",
config=true,
},
}
require("lazy").setup(plugins, {
root=root.."/plugins",
})
vim.cmd.colorscheme("tokyonight")
The text was updated successfully, but these errors were encountered:
In a similar way the types for vim.fn.setreg are also incorrect.
Current types are function vim.fn.setreg(regname: any, value: any, options?: table<string, any>) -> number but should rather be:
--- @param regname string
--- @param value string[]|string
--- @param options table|string <-- from how I understand it only an empty table is allowed here
--- @return number
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.0-dev
Operating system/version
Ubuntu 22.04.2 LTS
Describe the bug
The types for the
vim.fn.getreg
function are incorrect, current types arefunction vim.fn.getreg(regname?: any, p1?: any, list?: any[]) -> string
, the correct types would be the following (these can likely be simplified):Steps To Reproduce
nvim ~/.config/nvim/init.lua
vim.fn.getreg("+", 1, true)
Expected Behavior
Types match usage types
Repro
~/.config/nvim/init.lua
The text was updated successfully, but these errors were encountered: