fix lspconfig in nvim
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "21f74f7ba8c49f95f9d7c8293b147c2901dd2d3a" },
|
"LuaSnip": { "branch": "master", "commit": "b3104910bb5ebf40492aadffae18f2528fa757d9" },
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
"cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" },
|
"cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
"none-ls.nvim": { "branch": "main", "commit": "f0b3dc073153a08fd1e32869ed30b87a3bb4230f" },
|
"none-ls.nvim": { "branch": "main", "commit": "f0b3dc073153a08fd1e32869ed30b87a3bb4230f" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "d89f4891f0720cd2598e4bdd60010d8784b2ac8a" },
|
"nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
|
"nvim-surround": { "branch": "main", "commit": "a868c256c861044beb9794b4dd126480dcdfbdad" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" },
|
"nvim-tree.lua": { "branch": "master", "commit": "e179ad2f83b5955ab0af653069a493a1828c2697" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
|||||||
@@ -51,79 +51,80 @@ vim.api.nvim_create_autocmd("VimLeave", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
return { {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
{
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
'hrsh7th/nvim-cmp',
|
dependencies = {
|
||||||
'RRethy/vim-illuminate',
|
'hrsh7th/nvim-cmp',
|
||||||
'j-hui/fidget.nvim',
|
'RRethy/vim-illuminate',
|
||||||
},
|
'j-hui/fidget.nvim',
|
||||||
config = function()
|
},
|
||||||
local lsp = require("lspconfig")
|
config = function()
|
||||||
local lspconfig_defaults = lsp.util.default_config
|
local lsp = require("lspconfig")
|
||||||
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
local lspconfig_defaults = lsp.util.default_config
|
||||||
'force',
|
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
|
||||||
lspconfig_defaults.capabilities,
|
'force',
|
||||||
require('cmp_nvim_lsp').default_capabilities()
|
lspconfig_defaults.capabilities,
|
||||||
)
|
require('cmp_nvim_lsp').default_capabilities()
|
||||||
--local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
)
|
||||||
|
--local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
lsp.lua_ls.setup({
|
lsp.lua_ls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { 'vim' }
|
globals = { 'vim' }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
|
|
||||||
lsp.clangd.setup { on_attach = on_attach }
|
lsp.clangd.setup { on_attach = on_attach }
|
||||||
lsp.ts_ls.setup { on_attach = on_attach } -- typescript
|
lsp.ts_ls.setup { on_attach = on_attach } -- typescript
|
||||||
lsp.hls.setup { on_attach = on_attach } -- haskell
|
lsp.hls.setup { on_attach = on_attach } -- haskell
|
||||||
lsp.pyright.setup { on_attach = on_attach,
|
lsp.pyright.setup { on_attach = on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
pyright = {
|
pyright = {
|
||||||
disableOrganizeImports = true, -- Using Ruff
|
disableOrganizeImports = true, -- Using Ruff
|
||||||
},
|
},
|
||||||
python = {
|
python = {
|
||||||
analysis = {
|
analysis = {
|
||||||
ignore = { '*' }, -- Using Ruff
|
ignore = { '*' }, -- Using Ruff
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
}
|
lsp.ruff.setup { on_attach = on_attach }
|
||||||
lsp.ruff.setup { on_attach = on_attach }
|
lsp.svelte.setup { on_attach = on_attach }
|
||||||
lsp.svelte.setup { on_attach = on_attach }
|
lsp.marksman.setup { on_attach = on_attach }
|
||||||
lsp.marksman.setup { on_attach = on_attach }
|
lsp.rust_analyzer.setup { on_attach = on_attach,
|
||||||
lsp.rust_analyzer.setup { on_attach = on_attach,
|
settings = {
|
||||||
settings = {
|
["rust-analyzer"] = {
|
||||||
["rust-analyzer"] = {
|
checkOnSave = true,
|
||||||
checkOnSave = true,
|
check = {
|
||||||
check = {
|
enable = true,
|
||||||
enable = true,
|
command = "clippy",
|
||||||
command = "clippy",
|
features = "all"
|
||||||
features = "all"
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
lsp.tailwindcss.setup { on_attach = on_attach }
|
||||||
lsp.tailwindcss.setup { on_attach = on_attach }
|
|
||||||
|
|
||||||
lsp.julials.setup {
|
lsp.julials.setup {
|
||||||
on_new_config = function(new_config, _)
|
on_new_config = function(new_config, _)
|
||||||
local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia")
|
local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia")
|
||||||
if lsp.util.path.is_file(julia) then
|
if lsp.util.path.is_file(julia) then
|
||||||
vim.notify("running julials")
|
vim.notify("running julials")
|
||||||
new_config.cmd[1] = julia
|
new_config.cmd[1] = julia
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_attach = on_attach
|
on_attach = on_attach
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'nvimtools/none-ls.nvim',
|
'nvimtools/none-ls.nvim',
|
||||||
|
|
||||||
@@ -161,6 +162,7 @@ return { {
|
|||||||
dependencies = { "nvim-lua/plenary.nvim",
|
dependencies = { "nvim-lua/plenary.nvim",
|
||||||
"nvimtools/none-ls-extras.nvim",
|
"nvimtools/none-ls-extras.nvim",
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user