Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Remove nightly meta annotations conflicting with upstream neovim #175

Closed
6 of 9 tasks
wookayin opened this issue Jan 22, 2024 · 1 comment
Closed
6 of 9 tasks

Remove nightly meta annotations conflicting with upstream neovim #175

wookayin opened this issue Jan 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@wookayin
Copy link

wookayin commented Jan 22, 2024

Did you check the docs?

  • I have read all the neodev.nvim docs

Is your feature request related to a problem? Please describe.

neodev.nvim has been doing a great job in providing the missing piece for neovim+Lua development: the Lua type annotations. We have the following in types/nightly/*.lua:

(As of 1/22/2024)

  • alias: Just a few @alias -> actually they are misleading, should be removed
  • api: vim.api.*
  • cmd: vim.cmd.*
  • lua: vim.{json,mpack}, etc. and other misc.
  • options: vim.{wo,bo,o}
  • uv: vim.loop or vim.uv
  • vim.fn: vim.fn
  • vim (other misc.)

I've checked ones that are now superseded by an official, upstream meta annotation (at $VIMRUNTIME/lua/_meta/*) in neovim 0.10.x-nightly. Unchecked ones are still on the way to go towards 0.10.

The problem is that these meta files conflict with the one in $VIMRUNTIME in Lua-LS, and neodev's one is often incorrect in typings, giving a lots of false-positive diagnostic warnings. The upstream meta files are ensured always up-to-date as they are auto-generated from the source of truth.

Describe the solution you'd like

So in summary, we could (gradually) remove the conflicting meta files --- everything but vim.cmd and vim.uv (which are currently in progress) from nightly/* which are not available yet. For stable (0.9.x) we can still keep things because they are still useful until 0.10 release.

Describe alternatives you've considered

One who is sitting at Nvim nightly can actually disable neodev.nvim from their config, and configure settings.Lua.workspace.library manually to avoid a conflict. The only drawback is that no typings for vim.cmd and vim.uv yet --- but this can be addressed manually (e.g. copying the source to some folder).

Alternative, we can also consider separating each meta file into separate subdirectory so that one can opt in and out of each individually via neodev.setup -- or by configuring settings.Lua.workspace.library.

Eventually, neodev.nvim won't be needed when we arrive at Nvim 0.10-stable.

Additional context

N/A

@wookayin
Copy link
Author

wookayin commented Mar 11, 2024

See "fix: use Neovim distributed types on Neovim >= 0.10, instead of neodev" (b354c38)

@folke folke closed this as completed Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants