From 084e74f86f31796fd4a8144c5d346da01a3992d2 Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Mon, 8 Nov 2021 09:53:56 -0500 Subject: chore: update lsp installer --- lua/lvim/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 6531c04a..7195bb0f 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -4,7 +4,7 @@ local commit = { nlsp_settings = "29f49afe27b43126d45a05baf3161a28b929f2f1", null_ls = "64b269b51c7490660dcb2008f59ae260f2cdbbe4", fix_cursor_hold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", - lsp_installer = "6cb24638a42f6f750f1bac40cf9f18dcb0d0d489", + lsp_installer = "c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d", nvim_notify = "ee79a5e2f8bde0ebdf99880a98d1312da83a3caa", structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", popup = "f91d80973f80025d4ed00380f2e06c669dfda49d", -- cgit v1.2.3 From ee4d580bb2e1dbe7fdb90e8dca5d6296a50eba53 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:55:53 +0100 Subject: fix: update the uninstallation script (#1924) --- utils/installer/uninstall.sh | 69 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/utils/installer/uninstall.sh b/utils/installer/uninstall.sh index 09923bb1..31007984 100755 --- a/utils/installer/uninstall.sh +++ b/utils/installer/uninstall.sh @@ -1,11 +1,58 @@ -#!/bin/sh -USER_BIN_DIR="$HOME/.local/bin" -if [ -d "/data/data/com.termux" ]; then - sudo() { - eval "$@" - } - USER_BIN_DIR="$HOME/../usr/bin" -fi -rm -rf ~/.local/share/lunarvim -sudo rm "$USER_BIN_DIR"/lvim -rm -rf ~/.local/share/applications/lvim.desktop +#!/usr/bin/env bash +set -eo pipefail + +ARGS_REMOVE_BACKUPS=0 + +declare -r XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}" +declare -r XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}" +declare -r XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}" + +declare -r LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}" +declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}" + +# TODO: Use a dedicated cache directory #1256 +declare -r LUNARVIM_CACHE_DIR="$XDG_CACHE_HOME/nvim" + +LVIM_BIN="$(which lvim 2>/dev/null)" + +declare -a __lvim_dirs=( + "$LUNARVIM_CONFIG_DIR" + "$LUNARVIM_RUNTIME_DIR" + "$LUNARVIM_CACHE_DIR" +) + +function usage() { + echo "Usage: uninstall.sh []" + echo "" + echo "Options:" + echo " -h, --help Print this help message" + echo " --remove-backups Remove old backup folders as well" +} + +function parse_arguments() { + while [ "$#" -gt 0 ]; do + case "$1" in + --remove-backups) + ARGS_REMOVE_BACKUPS=1 + ;; + -h | --help) + usage + exit 0 + ;; + esac + shift + done +} + +function main() { + parse_arguments "$@" + for dir in "${__lvim_dirs[@]}"; do + rm -rf "$dir" + if [ "$ARGS_REMOVE_BACKUPS" -eq 1 ]; then + rm -rf "$dir.bak" + fi + done + rm -f "$LVIM_BIN" +} + +main "$@" -- cgit v1.2.3 From b23533f4c50e8c62480f51bf4a51a126ada8fb51 Mon Sep 17 00:00:00 2001 From: Chase Colman Date: Tue, 9 Nov 2021 17:41:25 +0800 Subject: fix(cmp): if possible jump in the snippet after completion fix(cmp): update cmp to fix textwidth calculation and indent bugs --- lua/lvim/core/cmp.lua | 3 +++ lua/lvim/plugins.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lvim/core/cmp.lua b/lua/lvim/core/cmp.lua index 375f7605..89159ebb 100644 --- a/lua/lvim/core/cmp.lua +++ b/lua/lvim/core/cmp.lua @@ -283,6 +283,9 @@ M.config = function() [""] = cmp.mapping.abort(), [""] = cmp.mapping(function(fallback) if cmp.visible() and cmp.confirm(lvim.builtin.cmp.confirm_opts) then + if jumpable() then + luasnip.jump(1) + end return end diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 7195bb0f..353270e9 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -11,7 +11,7 @@ local commit = { plenary = "96e821e8001c21bc904d3c15aa96a70c11462c5f", telescope = "078a48db9e0720b07bfcb8b59342c5305a1d1fdc", telescope_fzf_native = "59e38e1661ffdd586cb7fc22ca0b5a05c7caf988", - nvim_cmp = "1774ff0f842146521c63707245d3de5db2bb3732", + nvim_cmp = "ca6386854982199a532150cf3bd711395475ebd2", friendly_snippets = "94f1d917435c71bc6494d257afa90d4c9449aed2", autopairs = "f858ab38b532715dbaf7b2773727f8622ba04322", treesitter = "47cfda2c6711077625c90902d7722238a8294982", -- cgit v1.2.3 From 1ea5361475aca76290695fdd11dcda78a578e8f3 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Tue, 9 Nov 2021 18:59:27 +0100 Subject: fix(ci): blacklist 'sorbet' (#1936) --- lua/lvim/core/which-key.lua | 5 ++++- lua/lvim/lsp/config.lua | 1 + tests/lsp_spec.lua | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lua/lvim/core/which-key.lua b/lua/lvim/core/which-key.lua index b036e376..254f2ec2 100644 --- a/lua/lvim/core/which-key.lua +++ b/lua/lvim/core/which-key.lua @@ -207,7 +207,10 @@ M.config = function() "lua vim.fn.execute('edit ' .. require('lvim.core.log').get_path())", "Open the default logfile", }, - l = { "lua require('lvim.core.terminal').toggle_log_view(vim.lsp.get_log_path())", "view lsp log" }, + l = { + "lua require('lvim.core.terminal').toggle_log_view(vim.lsp.get_log_path())", + "view lsp log", + }, L = { "lua vim.fn.execute('edit ' .. vim.lsp.get_log_path())", "Open the LSP logfile" }, n = { "lua require('lvim.core.terminal').toggle_log_view(os.getenv('NVIM_LOG_FILE'))", diff --git a/lua/lvim/lsp/config.lua b/lua/lvim/lsp/config.lua index ccc524ee..ce7ed891 100644 --- a/lua/lvim/lsp/config.lua +++ b/lua/lvim/lsp/config.lua @@ -55,6 +55,7 @@ return { "phpactor", "pylsp", "rome", + "sorbet", "sqlls", "sqls", "stylelint_lsp", diff --git a/tests/lsp_spec.lua b/tests/lsp_spec.lua index b3bb59ab..17e72577 100644 --- a/tests/lsp_spec.lua +++ b/tests/lsp_spec.lua @@ -60,11 +60,19 @@ a.describe("lsp workflow", function() require("lvim.lsp").setup() for _, file in ipairs(vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1)) do - local count = 0 - for _ in io.lines(file) do - count = count + 1 + local content = {} + for entry in io.lines(file) do + table.insert(content, entry) end - assert.equal(count, 1) + local err_msg = "" + if #content > 1 then + err_msg = string.format( + "found more than one server for [%q]: \n{\n %q \n}", + file:match "[^/]*.lua$", + table.concat(content, ", ") + ) + end + assert.equal(err_msg, "") end end) end) -- cgit v1.2.3 From e42581c21904f64510051db65cb5e0bd204238d5 Mon Sep 17 00:00:00 2001 From: Chase Colman <5411+chase@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:56:52 +0800 Subject: fix(lsp): correct map and prevent highlight leak of diagnostic signs in 0.6 (#1934) --- lua/lvim/lsp/handlers.lua | 10 ---------- lua/lvim/lsp/init.lua | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lua/lvim/lsp/handlers.lua b/lua/lvim/lsp/handlers.lua index 59f15c1c..27ce8589 100644 --- a/lua/lvim/lsp/handlers.lua +++ b/lua/lvim/lsp/handlers.lua @@ -36,16 +36,6 @@ function M.setup() if not vim.api.nvim_buf_is_loaded(bufnr) then return end - - local sign_names = { - "DiagnosticSignError", - "DiagnosticSignWarn", - "DiagnosticSignInfo", - "DiagnosticSignHint", - } - for i, sign in ipairs(lvim.lsp.diagnostics.signs.values) do - vim.fn.sign_define(sign_names[i], { texthl = sign_names[i], text = sign.text, numhl = "" }) - end vim_diag.show(namespace, bufnr, diagnostics, config) else vim.lsp.diagnostic.save(diagnostics, bufnr, ctx.client_id) diff --git a/lua/lvim/lsp/init.lua b/lua/lvim/lsp/init.lua index 45ba04e0..d00f75c6 100644 --- a/lua/lvim/lsp/init.lua +++ b/lua/lvim/lsp/init.lua @@ -136,6 +136,13 @@ function M.get_common_opts() } end +local LSP_DEPRECATED_SIGN_MAP = { + ["LspDiagnosticsSignError"] = "DiagnosticSignError", + ["LspDiagnosticsSignWarning"] = "DiagnosticSignWarn", + ["LspDiagnosticsSignHint"] = "DiagnosticSignHint", + ["LspDiagnosticsSignInformation"] = "DiagnosticSignInfo", +} + function M.setup() Log:debug "Setting up LSP support" @@ -144,7 +151,13 @@ function M.setup() return end + local is_neovim_nightly = vim.fn.has "nvim-0.5.1" > 0 + for _, sign in ipairs(lvim.lsp.diagnostics.signs.values) do + local lsp_sign_name = LSP_DEPRECATED_SIGN_MAP[sign.name] + if is_neovim_nightly and lsp_sign_name then + vim.fn.sign_define(lsp_sign_name, { texthl = lsp_sign_name, text = sign.text, numhl = lsp_sign_name }) + end vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name }) end -- cgit v1.2.3 From 4ac00ed342d4ae6d909d7ffea9db27f0722ee2bd Mon Sep 17 00:00:00 2001 From: ChristianChiarulli Date: Wed, 10 Nov 2021 02:27:40 -0500 Subject: chore: update lsp-installer --- lua/lvim/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 353270e9..b2709209 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -4,7 +4,7 @@ local commit = { nlsp_settings = "29f49afe27b43126d45a05baf3161a28b929f2f1", null_ls = "64b269b51c7490660dcb2008f59ae260f2cdbbe4", fix_cursor_hold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", - lsp_installer = "c9dbc8afc2d56227ed0cba5a3348b8dd170e3a1d", + lsp_installer = "37d9326f4ca4093b04eabdb697fec3764e226f88", nvim_notify = "ee79a5e2f8bde0ebdf99880a98d1312da83a3caa", structlog = "6f1403a192791ff1fa7ac845a73de9e860f781f1", popup = "f91d80973f80025d4ed00380f2e06c669dfda49d", -- cgit v1.2.3 From 605c14e49996f635234b1157a96580448deb1160 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Wed, 10 Nov 2021 11:04:11 +0100 Subject: chore: bump lspconfig and null versions --- lua/lvim/plugins.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index b2709209..77ed1ebf 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -1,8 +1,8 @@ local commit = { packer = "7f62848f3a92eac61ae61def5f59ddb5e2cc6823", - lsp_config = "6224c54a9945a52bf43a8bc1a42a112084590c0b", + lsp_config = "903a1fbca91b74e6fbc905366ce38364b9d7ba98", nlsp_settings = "29f49afe27b43126d45a05baf3161a28b929f2f1", - null_ls = "64b269b51c7490660dcb2008f59ae260f2cdbbe4", + null_ls = "3bf64acca268f3d7e0455501b82cf3f02f38c292", fix_cursor_hold = "0e4e22d21975da60b0fd2d302285b3b603f9f71e", lsp_installer = "37d9326f4ca4093b04eabdb697fec3764e226f88", nvim_notify = "ee79a5e2f8bde0ebdf99880a98d1312da83a3caa", -- cgit v1.2.3