Public Access
lsp refactor
This commit is contained in:
+9
-9
@@ -1,22 +1,22 @@
|
|||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" },
|
"LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
|
"blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" },
|
||||||
"gruvbox": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" },
|
"gruvbox": { "branch": "main", "commit": "00e38a379bab3389e187b3953566d67d494dfddd" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
|
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "60eaff7a470b8e78ddff09d847d17a011f560759" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "f54e3c11fc9ebfcfc27e696182b0295b071d0811" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
|
||||||
"neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" },
|
"neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" },
|
||||||
"none-ls-extras.nvim": { "branch": "main", "commit": "924fe88a9983c7d90dbb31fc4e3129a583ea0a90" },
|
"none-ls-extras.nvim": { "branch": "main", "commit": "924fe88a9983c7d90dbb31fc4e3129a583ea0a90" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "db2a48b79cfcdab8baa5d3f37f21c78b6705c62e" },
|
"none-ls.nvim": { "branch": "main", "commit": "db2a48b79cfcdab8baa5d3f37f21c78b6705c62e" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
|
"nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "03bc581e05e81d33808b42b2d7e76d70adb3b595" },
|
"nvim-lspconfig": { "branch": "master", "commit": "0112e1f77983141e1453bd37d124302f1c876c46" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "0f051e9813a36481f48ca1f833897210dbcfffde" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
|
"nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
||||||
|
|||||||
+31
-49
@@ -7,61 +7,43 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
config = function()
|
opts = {
|
||||||
require("mason-lspconfig").setup({
|
ensure_installed = {
|
||||||
ensure_installed = { "lua_ls", "ts_ls", "svelte", "tailwindcss", "cssls", "tinymist", },
|
"lua_ls",
|
||||||
automatic_enable = true,
|
"ts_ls",
|
||||||
})
|
"svelte",
|
||||||
end,
|
"tailwindcss",
|
||||||
|
"cssls",
|
||||||
|
"tinymist",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local original_capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
local capabilities = require("blink.cmp").get_lsp_capabilities(original_capabilities)
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
lspconfig.lua_ls.setup({
|
local mason_lspconfig = require("mason-lspconfig")
|
||||||
capabilities = capabilities,
|
local mason_servers = mason_lspconfig.get_installed_servers()
|
||||||
})
|
|
||||||
lspconfig.ts_ls.setup({
|
local manual_servers = {
|
||||||
capabilities = capabilities,
|
"sourcekit",
|
||||||
})
|
}
|
||||||
lspconfig.svelte.setup({
|
|
||||||
capabilities = capabilities,
|
for _, server in ipairs(vim.tbl_extend("force", mason_servers, manual_servers)) do
|
||||||
})
|
lspconfig[server].setup({
|
||||||
lspconfig.tailwindcss.setup({
|
capabilities = capabilities,
|
||||||
capabilities = capabilities,
|
})
|
||||||
})
|
end
|
||||||
lspconfig.cssls.setup({
|
|
||||||
capabilities = capabilities,
|
local map = vim.keymap.set
|
||||||
settings = {
|
map("n", "gd", vim.lsp.buf.definition, {})
|
||||||
css = {
|
map("n", "K", vim.lsp.buf.hover, {})
|
||||||
lint = {
|
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
|
||||||
unknownAtRules = "ignore",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
scss = {
|
|
||||||
lint = {
|
|
||||||
unknownAtRules = "ignore",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
less = {
|
|
||||||
lint = {
|
|
||||||
unknownAtRules = "ignore",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
lspconfig.sourcekit.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
lspconfig.tinymist.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = true,
|
virtual_text = true,
|
||||||
|
|||||||
+26
-26
@@ -15,32 +15,32 @@ vim.keymap.set("n", "k", "gk", { noremap = true, silent = true })
|
|||||||
vim.keymap.set("v", "j", "gj", { noremap = true, silent = true })
|
vim.keymap.set("v", "j", "gj", { noremap = true, silent = true })
|
||||||
vim.keymap.set("v", "k", "gk", { noremap = true, silent = true })
|
vim.keymap.set("v", "k", "gk", { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Spellchecker
|
-- -- Spellchecker
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
-- vim.api.nvim_create_autocmd("FileType", {
|
||||||
callback = function()
|
-- callback = function()
|
||||||
local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
-- local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
||||||
local filetype = vim.api.nvim_buf_get_option(0, "filetype")
|
-- local filetype = vim.api.nvim_buf_get_option(0, "filetype")
|
||||||
|
--
|
||||||
local skip_buftypes = { "nofile", "prompt", "terminal" }
|
-- local skip_buftypes = { "nofile", "prompt", "terminal" }
|
||||||
local skip_filetypes = { "cmp_menu", "cmp_doc", "TelescopePrompt", "NvimTree" }
|
-- local skip_filetypes = { "cmp_menu", "cmp_doc", "TelescopePrompt", "NvimTree" }
|
||||||
|
--
|
||||||
-- If current buffer is in skip list, do nothing
|
-- -- If current buffer is in skip list, do nothing
|
||||||
for _, bt in ipairs(skip_buftypes) do
|
-- for _, bt in ipairs(skip_buftypes) do
|
||||||
if buftype == bt then
|
-- if buftype == bt then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
for _, ft in ipairs(skip_filetypes) do
|
-- for _, ft in ipairs(skip_filetypes) do
|
||||||
if filetype == ft then
|
-- if filetype == ft then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
-- Else, enable spellcheck
|
-- -- Else, enable spellcheck
|
||||||
vim.opt_local.spell = true
|
-- vim.opt_local.spell = true
|
||||||
vim.opt_local.spelllang = "en"
|
-- vim.opt_local.spelllang = "en"
|
||||||
end,
|
-- end,
|
||||||
})
|
-- })
|
||||||
|
|
||||||
-- Toggle spell check with <leader>sc
|
-- Toggle spell check with <leader>sc
|
||||||
vim.keymap.set("n", "<leader>sc", function()
|
vim.keymap.set("n", "<leader>sc", function()
|
||||||
|
|||||||
Reference in New Issue
Block a user