fix: rm unused files
This commit is contained in:
@@ -2,6 +2,9 @@ if vim.loader then
|
||||
vim.loader.enable()
|
||||
end
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
_G.dd = function(...)
|
||||
require("utils.debug").dump(...)
|
||||
end
|
||||
|
||||
+36
-36
@@ -1,67 +1,67 @@
|
||||
{
|
||||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||
"LazyVim": { "branch": "main", "commit": "fe72424e77cb9c953084bbcaaa0eb7fe8056dc70" },
|
||||
"LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "9bc9a3a19dc6047d79d6073082f3b0deb7002c99" },
|
||||
"LazyVim": { "branch": "main", "commit": "642bcf168b9330dd98de9647e5d49a79a38e78a4" },
|
||||
"LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "9ad2209d3fe54f99e3df2c26fadd6f4a3ecae44c" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" },
|
||||
"catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" },
|
||||
"catppuccin": { "branch": "main", "commit": "56fb98218d22d5c326387bf9e4076227e7372e6b" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
|
||||
"conform.nvim": { "branch": "master", "commit": "bf109f061fc3cd75394b7823923187ae045cbf22" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "92c94c8c3c92ddd29e1181a0aebcc22f2fe96f71" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" },
|
||||
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" },
|
||||
"lspsaga.nvim": { "branch": "main", "commit": "b1b140aa20a0cf353cd3e282870429b48b30a169" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" },
|
||||
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "2ba17cecfde8b8c7c7c287909a1e4de895223df6" },
|
||||
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
|
||||
"mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
|
||||
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" },
|
||||
"mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" },
|
||||
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "98980b5300e7a5e7f93e8dbf81c98cc3daa55df7" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "8afbb06081ce1e4beb5b18945d14a608b10babeb" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "9a419c4fa772c4c61839a8f7fdd8e863679a8c94" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
|
||||
"neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" },
|
||||
"neotest": { "branch": "master", "commit": "e07fe8241112274aae9947b98d255763738a1d52" },
|
||||
"neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" },
|
||||
"neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
|
||||
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
|
||||
"nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
|
||||
"nvim-lint": { "branch": "master", "commit": "4dade85ff26e4bad40f895a6cc6762b7036237f4" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" },
|
||||
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "43b460a2bd02fd898e67f5f1f65dfd1cce26203a" },
|
||||
"nvim-lint": { "branch": "master", "commit": "2669aabb8362fdc36aced5ba864b7135636ea863" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d67715d3b746a19e951b6b0a99663fa909bb9e64" },
|
||||
"nvim-nio": { "branch": "master", "commit": "7054695117581bdb0183b8d27d8d82b4a2ac8958" },
|
||||
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "4a8901b0d5398b45e075fcdbf9b8fe546349cc14" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "1d23be1165c373a6026e42f3b3a5100126eaf81d" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "f7c09bd72e50e1795bd3afb9e2a2b157b4bfb3c3" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "722617e6726c1508adadf83d531f54987c703be0" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "ce37c771550443d0b026c7999deceec1fd57981b" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "48ffb8de688a22942940f50411d5928631368848" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "d5c4d9856320a07d04607c9b3a0523bd3f373328" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "3bece973c5d80e7da447157822d5b0e73558d361" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "221778e93bfaa58bce4be4e055ed2edecc26f799" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "fbe3a27378fdd51a8ddd04f57012455436916a62" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
|
||||
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@
|
||||
"news": {
|
||||
"NEWS.md": "2123"
|
||||
},
|
||||
"version": 2
|
||||
"version": 3
|
||||
}
|
||||
@@ -12,6 +12,9 @@ keymap.set('n', "<Leader>br", "<cmd>e!<cr>", {desc="reload" })
|
||||
keymap.set('n', "<Leader>bd", "<cmd>BufferClose<cr>", {desc="close buffer" })
|
||||
keymap.set({'n','v'}, "<Leader>b/", "<cmd>CommentToggle<CR>", {desc="toggle comment" })
|
||||
|
||||
-- <Leader>c
|
||||
keymap.set('n', "<Leader>cs", "<cmd>SymbolsOutline<cr>", { desc = "Symbols Outline" })
|
||||
|
||||
-- <Leader>D
|
||||
keymap.set('n', "<Leader>Dt", "<cmd>TroubleToggle<cr>", {desc="trouble" })
|
||||
keymap.set('n', "<Leader>Dw", "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", {desc="workspace" })
|
||||
@@ -64,23 +67,24 @@ keymap.set('n', '<Leader>h', ':set hlsearch!<CR>', { noremap = true, silent = tr
|
||||
|
||||
-- <Leader>l for lsp
|
||||
keymap.set('n', '<Leader>l', "", {desc="+Language"})
|
||||
keymap.set('n', '<Leader>la', "<cmd>Lspsaga code_action<cr>", {desc="Code Action" })
|
||||
keymap.set('n', '<Leader>lA', "<cmd>Lspsaga range_code_action<cr>", {desc="Selected Action" })
|
||||
keymap.set({'n','v'}, '<Leader>la', "<cmd>lua vim.lsp.buf.code_action()<cr>", {desc="Code Action" })
|
||||
--keymap.set('n', '<Leader>lA', "<cmd>Lspsaga range_code_action<cr>", {desc="Selected Action" })
|
||||
keymap.set('n', '<Leader>ld', "<cmd>Telescope lsp_document_diagnostics<cr>", {desc="Document Diagnostics" })
|
||||
keymap.set('n', '<Leader>lD', "<cmd>Telescope lsp_workspace_diagnostics<cr>", {desc="Workspace Diagnostics" })
|
||||
keymap.set('n', '<Leader>lf', "<cmd>LspFormatting<cr>", {desc="Format" })
|
||||
keymap.set('n', '<Leader>lF', "<cmd>Lspsaga lsp_finder<cr>", {desc="LSP Finder" })
|
||||
--keymap.set('n', '<Leader>lF', "<cmd>Lspsaga lsp_finder<cr>", {desc="LSP Finder" })
|
||||
keymap.set('n', '<Leader>li', "<cmd>lua vim.lsp.buf.implementation()<cr>", {desc="implement" })
|
||||
keymap.set('n', '<Leader>ll', "<cmd>lua vim.lsp.buf.hover()<cr>", {desc="hover" })
|
||||
keymap.set('n', '<Leader>lL', "<cmd>Lspsaga show_line_diagnostics<cr>", {desc="Line Diagnostics" })
|
||||
--keymap.set('n', '<Leader>lL', "<cmd>Lspsaga show_line_diagnostics<cr>", {desc="Line Diagnostics" })
|
||||
keymap.set('n', '<Leader>lk', "<cmd>: LspRestart<cr>", {desc="restart lsp server" })
|
||||
keymap.set('n', '<Leader>ln', "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", {desc="next diagnostic" })
|
||||
keymap.set('n', '<Leader>lo', "<cmd>: SymbolsOutline<cr>", {desc="symbols outline" })
|
||||
keymap.set('n', '<Leader>lp', "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", {desc="prev diagnostic" })
|
||||
keymap.set('n', '<Leader>lP', "<cmd>Lspsaga preview_definition<cr>", {desc="Preview Definition" })
|
||||
--keymap.set('n', '<Leader>lP', "<cmd>Lspsaga preview_definition<cr>", {desc="Preview Definition" })
|
||||
keymap.set('n', '<Leader>lq', "<cmd>Telescope quickfix<cr>", {desc="Quickfix" })
|
||||
keymap.set('n', '<Leader>lr', "<cmd>lua vim.lsp.buf.references()<cr>", {desc="references" })
|
||||
keymap.set('n', '<Leader>lR', "<cmd>Lspsaga rename<cr>", {desc="Rename" })
|
||||
keymap.set('n', '<leader>lR', "<cmd>lua vim.lsp.buf.rename()<cr>", { desc = "Rename" })
|
||||
--keymap.set('n', '<Leader>lR', "<cmd>Lspsaga rename<cr>", {desc="Rename" })
|
||||
keymap.set('n', '<Leader>lt', "<cmd>LspTypeDefinition<cr>", {desc="Type Definition" })
|
||||
keymap.set('n', '<Leader>lx', "<cmd>cclose<cr>", {desc="Close Quickfix" })
|
||||
keymap.set('n', '<Leader>ls', "<cmd>Telescope lsp_document_symbols<cr>", {desc="Document Symbols" })
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
-- npm i -g bash-language-server
|
||||
require'lspconfig'.bashls.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
filetypes = { "sh", "zsh" }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
-- npm install -g vscode-css-languageserver-bin
|
||||
require'lspconfig'.cssls.setup {
|
||||
cmd = {
|
||||
"node", DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js",
|
||||
"--stdio"
|
||||
},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
-- npm install -g dockerfile-language-server-nodejs
|
||||
require'lspconfig'.dockerls.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
root_dir = vim.loop.cwd
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
local nvim_lsp = require'lspconfig'
|
||||
local configs = require'lspconfig/configs'
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
configs.emmet_ls = {
|
||||
default_config = {
|
||||
cmd = {'emmet-ls', '--stdio'};
|
||||
filetypes = {'html', 'css'};
|
||||
root_dir = function()
|
||||
return vim.loop.cwd()
|
||||
end;
|
||||
settings = {};
|
||||
};
|
||||
}
|
||||
|
||||
nvim_lsp.emmet_ls.setup{
|
||||
-- on_attach = on_attach;
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
-- LSP
|
||||
require 'lspconfig'.gopls.setup {
|
||||
-- cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
|
||||
cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
nilness = true,
|
||||
unusedparams = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
staticcheck = false
|
||||
}
|
||||
},
|
||||
root_dir = require 'lspconfig'.util.root_pattern(".git", "go.mod", "go.work"),
|
||||
init_options = { usePlaceholders = true, completeUnimported = true },
|
||||
on_attach = require 'lsp'.common_on_attach
|
||||
}
|
||||
|
||||
--[[
|
||||
require'dap-install'.config("go_delve",{})
|
||||
|
||||
-- DAP
|
||||
local dap = require "dap"
|
||||
vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''})
|
||||
--vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
|
||||
|
||||
local M = {}
|
||||
|
||||
local ts_utils = require 'nvim-treesitter.ts_utils'
|
||||
|
||||
function M.get_node()
|
||||
local n = ts_utils.get_node_at_cursor()
|
||||
put(ts_utils.get_node_text(n))
|
||||
end
|
||||
|
||||
function M.get_node2()
|
||||
local current_node = ts_utils.get_node_at_cursor()
|
||||
if not current_node then
|
||||
return ""
|
||||
end
|
||||
|
||||
local expr = current_node
|
||||
|
||||
while expr do
|
||||
if expr:type() == 'function_definition' then
|
||||
put(expr:type())
|
||||
break
|
||||
end
|
||||
expr = expr:parent()
|
||||
end
|
||||
|
||||
if not expr then return "" end
|
||||
|
||||
put(ts_utils.get_node_text(expr))
|
||||
return (ts_utils.get_node_text(expr:child(1)))[1]
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
--[[
|
||||
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}"
|
||||
},
|
||||
-- works with go.mod packages and sub packagesfunction M.get_current_function_name() local current_node = ts_utils.get_node_at_cursor() if not current_node then return "" end
|
||||
|
||||
local expr = current_node
|
||||
|
||||
while expr do
|
||||
if expr:type() == 'function_definition' then
|
||||
break
|
||||
end
|
||||
expr = expr:parent()
|
||||
end
|
||||
|
||||
if not expr then return "" end
|
||||
|
||||
return (ts_utils.get_node_text(expr:child(1)))[1]
|
||||
end
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--[[
|
||||
local dap = require('dap')
|
||||
|
||||
dap.adapters.go = function(callback, config)
|
||||
local stdout = vim.loop.new_pipe(false)
|
||||
local handle
|
||||
local pid_or_err
|
||||
local port = 38697
|
||||
local opts = {
|
||||
stdio = {nil, stdout},
|
||||
args = {"dap", "-l", "127.0.0.1:" .. port},
|
||||
detached = true
|
||||
}
|
||||
handle, pid_or_err = vim.loop.spawn("dlv", opts, function(code)
|
||||
stdout:close()
|
||||
handle:close()
|
||||
if code ~= 0 then
|
||||
print('dlv exited with code', code)
|
||||
end
|
||||
end)
|
||||
assert(handle, 'Error running dlv: ' .. tostring(pid_or_err))
|
||||
stdout:read_start(function(err, chunk)
|
||||
assert(not err, err)
|
||||
if chunk then
|
||||
vim.schedule(function()
|
||||
require('dap.repl').append(chunk)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
-- Wait for delve to start
|
||||
vim.defer_fn(
|
||||
function()
|
||||
callback({type = "server", host = "127.0.0.1", port = port})
|
||||
end,
|
||||
100)
|
||||
end
|
||||
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}"
|
||||
},
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test", -- configuration for debugging test files
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "${file}"
|
||||
},
|
||||
-- works with go.mod packages and sub packages
|
||||
{
|
||||
type = "go",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}"
|
||||
}
|
||||
}
|
||||
]]
|
||||
@@ -1,9 +0,0 @@
|
||||
-- npm install -g vscode-html-languageserver-bin
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
require'lspconfig'.html.setup {
|
||||
cmd = {"node", DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
-- npm install -g typescript typescript-language-server
|
||||
-- require'snippets'.use_suggested_mappings()
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- capabilities.textDocument.completion.completionItem.snippetSupport = true;
|
||||
-- local on_attach_common = function(client)
|
||||
-- print("LSP Initialized")
|
||||
-- require'completion'.on_attach(client)
|
||||
-- require'illuminate'.on_attach(client)
|
||||
-- end
|
||||
|
||||
require'lspconfig'.tsserver.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server", "--stdio"},
|
||||
filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
|
||||
on_attach = require'lsp'.tsserver_on_attach,
|
||||
-- This makes sure tsserver is not used for formatting (I prefer prettier)
|
||||
-- on_attach = require'lsp'.common_on_attach,
|
||||
root_dir = require('lspconfig/util').root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
|
||||
settings = {documentFormatting = false},
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = O.tsserver.diagnostics.virtual_text,
|
||||
signs = O.tsserver.diagnostics.signs,
|
||||
underline = O.tsserver.diagnostics.underline,
|
||||
update_in_insert = true
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
-- npm install -g vscode-json-languageserver
|
||||
require'lspconfig'.jsonls.setup {
|
||||
cmd = {
|
||||
"node", DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
|
||||
"--stdio"
|
||||
},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
|
||||
commands = {
|
||||
Format = {
|
||||
function()
|
||||
vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0})
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
require'lspconfig'.texlab.setup{
|
||||
cmd = {DATA_PATH .. "/lspinstall/latex/texlab"},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
|
||||
local brew_path = "/usr/local/Cellar/lua-language-server/2.5.5/libexec"
|
||||
local sumneko_root_path = brew_path
|
||||
local sumneko_binary = brew_path .. "/bin/lua-language-server"
|
||||
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = vim.split(package.path, ';')
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'}
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true},
|
||||
maxPreload = 10000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
-- npm i -g pyright
|
||||
require'lspconfig'.pyright.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = O.python.diagnostics.virtual_text,
|
||||
signs = O.python.diagnostics.signs,
|
||||
underline = O.python.diagnostics.underline,
|
||||
update_in_insert = true
|
||||
})
|
||||
},
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
typeCheckingMode = O.python.analysis.type_checking,
|
||||
autoSearchPaths = O.python.analysis.auto_search_paths,
|
||||
useLibraryCodeForTypes = O.python.analysis.use_library_code_types
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
require'lspconfig'.rust_analyzer.setup{
|
||||
cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
-- npm install -g yaml-language-server
|
||||
require'lspconfig'.yamlls.setup{
|
||||
cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"},
|
||||
on_attach = require'lsp'.common_on_attach,
|
||||
}
|
||||
@@ -3,7 +3,7 @@ return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
go = { "gofmt"},
|
||||
go = { "goimports"},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'nvim-tree/nvim-web-devicons' -- optional
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user