mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
chore: add deno lsp support and upgrade to version 2.0.0
This commit is contained in:
@@ -1,52 +1,65 @@
|
||||
-- Quickstart configs for Nvim LSP
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
require("lazyvim.util").lsp.on_attach(function(_, buffer)
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
require("lazyvim.util").lsp.on_attach(function(_, buffer)
|
||||
-- stylua: ignore
|
||||
vim.keymap.set("n", "g0", "<cmd>Telescope lsp_document_symbols<cr>", { buffer = buffer, desc = "Document Symbols" })
|
||||
vim.keymap.set("n", "cc", "<cmd>lua vim.lsp.buf.code_action()<cr>", { buffer = buffer, desc = "Code Action" })
|
||||
end)
|
||||
end,
|
||||
opts = {
|
||||
inlay_hints = { enabled = false },
|
||||
servers = {
|
||||
astro = {},
|
||||
cssls = {},
|
||||
cssmodules_ls = {},
|
||||
diagnosticls = {},
|
||||
emmet_ls = {},
|
||||
graphql = {},
|
||||
html = {},
|
||||
jsonls = {},
|
||||
lua_ls = {},
|
||||
nixd = {},
|
||||
svelte = {},
|
||||
tsserver = {},
|
||||
yamlls = {},
|
||||
},
|
||||
},
|
||||
setup = function()
|
||||
local nvim_lsp = require("lspconfig")
|
||||
nvim_lsp.nixd.setup({
|
||||
cmd = { "nixd" },
|
||||
setttings = {
|
||||
nixd = {
|
||||
expr = "import <nixpkgs> { }",
|
||||
},
|
||||
formattting = {
|
||||
command = { "nixpkgs-fmt" },
|
||||
},
|
||||
options = {
|
||||
nixos = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.k-on.options',
|
||||
},
|
||||
home_manager = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."ruixi@k-on".options',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
vim.keymap.set("n", "cc", "<cmd>lua vim.lsp.buf.code_action()<cr>", { buffer = buffer, desc = "Code Action" })
|
||||
end)
|
||||
end,
|
||||
opts = {
|
||||
inlay_hints = { enabled = false },
|
||||
servers = {
|
||||
astro = {},
|
||||
cssls = {},
|
||||
cssmodules_ls = {},
|
||||
denols = {},
|
||||
diagnosticls = {},
|
||||
emmet_ls = {},
|
||||
graphql = {},
|
||||
html = {},
|
||||
jsonls = {},
|
||||
lua_ls = {},
|
||||
nixd = {},
|
||||
svelte = {},
|
||||
tsserver = {},
|
||||
yamlls = {},
|
||||
},
|
||||
},
|
||||
setup = function()
|
||||
local nvim_lsp = require("lspconfig")
|
||||
|
||||
nvim_lsp.nixd.setup({
|
||||
cmd = { "nixd" },
|
||||
settings = {
|
||||
nixd = {
|
||||
expr = "import <nixpkgs> { }",
|
||||
},
|
||||
formatting = {
|
||||
command = { "nixpkgs-fmt" },
|
||||
},
|
||||
options = {
|
||||
nixos = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.k-on.options',
|
||||
},
|
||||
home_manager = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."ruixi@k-on".options',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
nvim_lsp.denols.setup({
|
||||
on_attach = on_attach,
|
||||
root_dir = nvim_lsp.util.root_pattern("deno.json", "deno.jsonc"),
|
||||
})
|
||||
|
||||
nvim_lsp.tsserver.setup({
|
||||
on_attach = on_attach,
|
||||
root_dir = nvim_lsp.util.root_pattern("package.json"),
|
||||
single_file_support = false,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ return {
|
||||
"css-lsp",
|
||||
"cssmodules-language-server",
|
||||
"delve",
|
||||
"deno",
|
||||
"diagnostic-languageserver",
|
||||
"emmet-ls",
|
||||
"eslint-lsp",
|
||||
|
||||
Reference in New Issue
Block a user