diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index a4b03af..cbbbfdd 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -48,6 +48,7 @@ "leap.nvim": { "branch": "main", "commit": "626be4c4ec040aeaf6466c9aae17ee0ab09f1a5b" }, "libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, + "lsp-timeout.nvim": { "branch": "main", "commit": "6325906730330105a9adc41d0ceb8499b3072e2b" }, "lsp-virtual-improved.nvim": { "branch": "master", "commit": "db9cd544b7febdf4c48374e351b3903143b4477d" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "e00dcf8a6019a88139626c1668dccdc295abd324" }, "lsp_lines.nvim": { "branch": "main", "commit": "dbfd8e96ec2696e1ceedcd23fd70e842256e3dea" }, diff --git a/vim/.vim/lua/config/lsp-google.lua b/vim/.vim/lua/config/lsp-google.lua index 2128a0c..709a0e6 100644 --- a/vim/.vim/lua/config/lsp-google.lua +++ b/vim/.vim/lua/config/lsp-google.lua @@ -13,7 +13,6 @@ function M.setup(capabilities) "--forward_sync_responses", -- "--debug_relay", }, - offset_encoding = "utf-8", filetypes = { "c", "cpp", @@ -39,7 +38,6 @@ function M.setup(capabilities) "--lint_on_save=false", "--max_qps=10", }, - offset_encoding = "utf-8", filetypes = { "c", "cpp", @@ -97,7 +95,7 @@ function M.setup(capabilities) end lspconfig.ciderlsp.setup({ - capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), + gapabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), on_attach = cider_on_attach, handlers = cider_lsp_handlers, }) diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index 4953aa4..4cda489 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -12,12 +12,6 @@ return { { "nvim-lua/plenary.nvim", lazy = false }, { "squk/java-syntax.vim", ft = "java" }, { "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" }, - { - "ray-x/go.nvim", - ft = "go", - cond = not use_google(), - dependencies = { "ray-x/guihua.lua" }, - }, { "andymass/vim-matchup", event = "VimEnter" }, { "jghauser/mkdir.nvim", event = "BufWritePre" }, -- Session management diff --git a/vim/.vim/lua/plugins/lsp.lua b/vim/.vim/lua/plugins/lsp.lua index 061be25..bb33a6b 100644 --- a/vim/.vim/lua/plugins/lsp.lua +++ b/vim/.vim/lua/plugins/lsp.lua @@ -44,7 +44,7 @@ return { "hinell/lsp-timeout.nvim", event = { "LspAttach" }, dependencies = { "neovim/nvim-lspconfig" }, - cond = not use_google(), + -- cond = not use_google(), config = function() vim.g.lspTimeoutConfig = { filetypes = { @@ -56,14 +56,18 @@ return { } end, }, + { + "ray-x/go.nvim", + ft = "go", + -- cond = not use_google(), + dependencies = { "ray-x/guihua.lua" }, + }, { "neovim/nvim-lspconfig", dependencies = { "hrsh7th/nvim-cmp", "nvim-lua/lsp-status.nvim", "VonHeikemen/lsp-zero.nvim", - "ray-x/go.nvim", - "ray-x/guihua.lua", }, keys = { { "rn", "lua vim.lsp.buf.rename()" }, @@ -92,6 +96,7 @@ return { local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) capabilities = vim.tbl_extend("keep", capabilities or {}, lsp_status.capabilities) + capabilities.offsetEncoding = { "utf-16" } local lspconfig = require("lspconfig") local configs = require("lspconfig.configs") @@ -107,21 +112,25 @@ return { vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]]) -- Golang - if not use_google then - require("go").setup({ - lsp_cfg = { - capabilities = capabilities, - }, - }) - local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {}) - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*.go", - callback = function() - require("go.format").goimport() - end, - group = format_sync_grp, - }) - end + -- if not use_google then + require("go").setup({ + capabilities = capabilities, + -- root_dir = function(fname) + -- return string.match(fname, "(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$") + -- end, + -- lsp_cfg = {}, + }) + + -- Run gofmt + goimports on save + local format_sync_grp = vim.api.nvim_create_augroup("goimports", {}) + vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + require("go.format").goimports() + end, + group = format_sync_grp, + }) + -- end end, }, } diff --git a/vim/.vim/lua/plugins/rust.lua b/vim/.vim/lua/plugins/rust.lua index 379c6b3..ed80185 100644 --- a/vim/.vim/lua/plugins/rust.lua +++ b/vim/.vim/lua/plugins/rust.lua @@ -2,6 +2,15 @@ return { { "vxpm/ferris.nvim", ft = "rust", + config = function() + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.offsetEncoding = { "utf-16" } + require("lspconfig").rust_analyzer.setup({ + -- offset_encoding = "utf-8", + -- capabilities, + settings = { ["rust-analyzer"] = {} }, + }) + end, }, {