diff options
| author | cryxtalix <fgx8p9t@protonmail.com> | 2026-05-11 01:39:07 +0800 |
|---|---|---|
| committer | cryxtalix <fgx8p9t@protonmail.com> | 2026-05-11 01:39:07 +0800 |
| commit | 3b15748e9c831161c55470dcdaa31f9c21559d9d (patch) | |
| tree | fe381abc9be6e963ab79a52444045684db29a9fa | |
| parent | 77904766509c232fa66c662bb0ba51637d8904ff (diff) | |
Fix pyright.
| -rw-r--r-- | .config/nvim/init.lua | 1 | ||||
| -rw-r--r-- | .config/nvim/lsp/lua_ls.lua | 19 | ||||
| -rw-r--r-- | .config/nvim/lua/configs/pyright.lua (renamed from .config/nvim/lsp/pyright.lua) | 15 | ||||
| -rw-r--r-- | .config/nvim/nvim-pack-lock.json | 5 |
4 files changed, 17 insertions, 23 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 160ef63..d7f4bb8 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -2,6 +2,7 @@ require("configs.basic") require("configs.vim-plug") require("configs.lsp") +require("configs.pyright") -- Install plugins with native vim.pack -- require("plugins.mason") diff --git a/.config/nvim/lsp/lua_ls.lua b/.config/nvim/lsp/lua_ls.lua deleted file mode 100644 index c0a6d56..0000000 --- a/.config/nvim/lsp/lua_ls.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - -- Command and arguments to start the server. - cmd = { 'lua-language-server' }, - -- Filetypes to automatically attach to. - filetypes = { 'lua' }, - -- Sets the "workspace" to the directory where any of these files is found. - -- Files that share a root directory will reuse the LSP server connection. - -- Nested lists indicate equal priority, see |vim.lsp.Config|. - root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' }, - -- Specific settings to send to the server. The schema is server-defined. - -- Example: https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - } - } - } -} diff --git a/.config/nvim/lsp/pyright.lua b/.config/nvim/lua/configs/pyright.lua index aece9a7..e15a7fb 100644 --- a/.config/nvim/lsp/pyright.lua +++ b/.config/nvim/lua/configs/pyright.lua @@ -1,9 +1,14 @@ -return { +vim.pack.add({ + { + src = "https://github.com/neovim/nvim-lspconfig", + version = 'master', + }, +}) + +vim.lsp.config['pyright'] = { cmd = { "pyright-langserver", "--stdio" }, filetypes = { "python" }, - root_dir = function(filename) - return util.root_pattern(unpack(root_files))(filename) or util.path.dirname(filename) - end, + settings = { python = { analysis = { @@ -14,3 +19,5 @@ return { } } } + +vim.lsp.enable('pyright') diff --git a/.config/nvim/nvim-pack-lock.json b/.config/nvim/nvim-pack-lock.json index e09663c..c884659 100644 --- a/.config/nvim/nvim-pack-lock.json +++ b/.config/nvim/nvim-pack-lock.json @@ -44,6 +44,11 @@ "src": "https://github.com/hrsh7th/nvim-cmp", "version": "'main'" }, + "nvim-lspconfig": { + "rev": "451d4ef9abd4f0f08e379ef0d55d1c391b6125a7", + "src": "https://github.com/neovim/nvim-lspconfig", + "version": "'master'" + }, "nvim-treesitter": { "rev": "4916d6592ede8c07973490d9322f187e07dfefac", "src": "https://github.com/nvim-treesitter/nvim-treesitter" |
