瀏覽代碼

Update lazydev config to fix "Undefined field `fs_stat`" LSP error (#1040)

7513ec8a7dd579957ce2d9b44e05c1da18d7d0e3 switched from neodev to
lazydev, but in the process it introduced an LSP error in `init.lua`,
which degrades the desired "first timer" experience of kickstart.nvim.

This commit follows the configuration suggested in
https://github.com/folke/lazydev.nvim/tree/6184ebbbc8045d70077659b7d30c705a588dc62f#-installation
which resolves the LSP error.
Richard Macklin 2 年之前
父節點
當前提交
620732789b
共有 1 個文件被更改,包括 11 次插入 和 1 次删除
  1. 11 1
      init.lua

+ 11 - 1
init.lua

@@ -413,7 +413,17 @@ require('lazy').setup({
 
       -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
       -- used for completion, annotations and signatures of Neovim apis
-      { 'folke/lazydev.nvim', ft = 'lua', opts = {} },
+      {
+        'folke/lazydev.nvim',
+        ft = 'lua',
+        opts = {
+          library = {
+            -- Load luvit types when the `vim.uv` word is found
+            { path = 'luvit-meta/library', words = { 'vim%.uv' } },
+          },
+        },
+      },
+      { 'Bilal2453/luvit-meta', lazy = true },
     },
     config = function()
       -- Brief aside: **What is LSP?**