Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Change to use nightly types causes missing types for vim.uv.* #185

Open
3 tasks done
dsully opened this issue Feb 29, 2024 · 2 comments
Open
3 tasks done

bug: Change to use nightly types causes missing types for vim.uv.* #185

dsully opened this issue Feb 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@dsully
Copy link

dsully commented Feb 29, 2024

Did you check docs and existing issues?

  • I have read all the neodev.nvim docs
  • 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)

v0.10.0-dev-2483+g6ab0876f5-Homebrew

Operating system/version

macOS 14.3.1

Describe the bug

The change in b354c38 for #175 (which is great BTW) causes warnings from lua_ls due to the fact that there are no types / functions / members exposed for libuv via vim.uv.* from the Neovim source:

CleanShot 2024-02-29 at 07 56 08@2x

The correct thing to do here is to expose those from Neovim, but I'm wondering if A) there's a shorter term fix you can make here, or B) You happen to have a PR for Neovim already in progress that I'm not aware of. I did search open PRs and issues over there though and didn't see anything.

Steps To Reproduce

Use any vim.uv.* method with lua_ls diagnostics turned on.

Expected Behavior

Member fields and types are properly accounted for.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/neodev.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

if vim.us.fs_access("init.lua", "R") then
   vim.notify("Foo")
end
@dsully dsully added the bug Something isn't working label Feb 29, 2024
@wookayin
Copy link

Until neovim/neovim#26268 is done, neodev could include the meta annotation file into the LuaLs library.

aarondill added a commit to aarondill/LazyVim that referenced this issue Mar 12, 2024
@delphinus
Copy link

I did a stopgap measure to solve this.

require("lspconfig").lua_ls.setup {
  settings = {
    Lua = {
      workspace = {
        library = { require("neodev.config").types() },
      },
    },
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants