aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksa Vuckovic <aleksa@vuckovic.cc>2023-02-24 01:35:43 +0100
committerAleksa Vuckovic <aleksa@vuckovic.cc>2023-02-24 01:35:43 +0100
commit2a5f8920d10c4a85586ae6d697f233ce52144a10 (patch)
tree2bb4342359ae57d3b9cdff6cd35740d2b6f5882b
parent506fa11fc88dbacf80d1ba93d88e65244966050c (diff)
nvim-lsp-installer replaced with mason.nvim
-rw-r--r--lua/user/lsp/ccls.lua6
-rw-r--r--lua/user/lsp/handlers.lua1
-rw-r--r--lua/user/lsp/init.lua4
-rw-r--r--lua/user/lsp/lsp-installer.lua53
-rw-r--r--lua/user/lsp/mason.lua9
-rw-r--r--lua/user/lsp/settings/bashls.lua1
-rw-r--r--lua/user/lsp/settings/pylsp.lua1
-rw-r--r--lua/user/lsp/settings/sumneko_lua.lua16
-rw-r--r--lua/user/lsp/settings/texlab.lua1
-rw-r--r--lua/user/plugins.lua2
10 files changed, 11 insertions, 83 deletions
diff --git a/lua/user/lsp/ccls.lua b/lua/user/lsp/ccls.lua
index f8817dc..94fe2a0 100644
--- a/lua/user/lsp/ccls.lua
+++ b/lua/user/lsp/ccls.lua
@@ -16,11 +16,6 @@ end
if string.match(vim.fn.expand('%:p'),"/home/aleksa/mygit/oldrepos/mykernel/") then
extraArgs_opt = { "--sysroot=/opt/aleksa", "--gcc-toolchain=/opt/aleksa/usr/bin/i686-aleksa-gcc", };
---[[
- vim.opt["shiftwidth"]=4;
- vim.opt["tabstop"]=4;
- vim.opt["expandtab"]=true;
-]]
vim.notify("mykernel");
end
@@ -49,7 +44,6 @@ lspconfig.ccls.setup {
debounce_text_changes = 150,
};
init_options = {
- compilationDatabaseDirectory = "build";
cache = {
directory = "/tmp/ccls-cache";
};
diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua
index 085f449..b741928 100644
--- a/lua/user/lsp/handlers.lua
+++ b/lua/user/lsp/handlers.lua
@@ -1,6 +1,5 @@
local M = {}
--- TODO: backfill this to template
M.setup = function()
local signs = {
{ name = "DiagnosticSignError", text = "" },
diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua
index 744c4ec..92ae9bf 100644
--- a/lua/user/lsp/init.lua
+++ b/lua/user/lsp/init.lua
@@ -3,7 +3,5 @@ if not status_ok then
return
end
-require "user.lsp.lsp-installer"
-require("user.lsp.handlers").setup()
-
+require "user.lsp.mason"
require "user.lsp.ccls"
diff --git a/lua/user/lsp/lsp-installer.lua b/lua/user/lsp/lsp-installer.lua
deleted file mode 100644
index 84ada28..0000000
--- a/lua/user/lsp/lsp-installer.lua
+++ /dev/null
@@ -1,53 +0,0 @@
-local servers = { "bashls", "pylsp", "texlab", "sumneko_lua" }
-
-local status, lsp_installer_servers = pcall(require, "nvim-lsp-installer.servers")
-if not status then
- return
-end
-
-for _, server in pairs(servers) do
- local _, requested_server = lsp_installer_servers.get_server(server)
- if not requested_server:is_installed() then
- -- Queue the server to be installed
- requested_server:install()
- end
-end
-
-
-local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
-if not status_ok then
- return
-end
-
--- Register a handler that will be called for all installed servers.
--- Alternatively, you may also register handlers on specific server instances instead (see example below).
-lsp_installer.on_server_ready(function(server)
- local opts = {
- on_attach = require("user.lsp.handlers").on_attach,
- capabilities = require("user.lsp.handlers").capabilities,
- }
-
- if server.name == "bashls" then
- local bashls_opts = require("user.lsp.settings.bashls")
- opts = vim.tbl_deep_extend("force", bashls_opts, opts)
- end
-
- if server.name == "texlab" then
- local texlab_opts = require("user.lsp.settings.texlab")
- opts = vim.tbl_deep_extend("force", texlab_opts, opts)
- end
-
- if server.name == "sumneko_lua" then
- local sumneko_opts = require("user.lsp.settings.sumneko_lua")
- opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
- end
-
- if server.name == "pylsp" then
- local pylsp_opts = require("user.lsp.settings.pylsp")
- opts = vim.tbl_deep_extend("force", pylsp_opts, opts)
- end
-
- -- This setup() function is exactly the same as lspconfig's setup function.
- -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
- server:setup(opts)
-end)
diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua
new file mode 100644
index 0000000..af77151
--- /dev/null
+++ b/lua/user/lsp/mason.lua
@@ -0,0 +1,9 @@
+require("mason").setup({
+ ui = {
+ icons = {
+ package_installed = "✓",
+ package_pending = "➜",
+ package_uninstalled = "✗"
+ }
+ }
+})
diff --git a/lua/user/lsp/settings/bashls.lua b/lua/user/lsp/settings/bashls.lua
deleted file mode 100644
index a564707..0000000
--- a/lua/user/lsp/settings/bashls.lua
+++ /dev/null
@@ -1 +0,0 @@
-return {}
diff --git a/lua/user/lsp/settings/pylsp.lua b/lua/user/lsp/settings/pylsp.lua
deleted file mode 100644
index a564707..0000000
--- a/lua/user/lsp/settings/pylsp.lua
+++ /dev/null
@@ -1 +0,0 @@
-return {}
diff --git a/lua/user/lsp/settings/sumneko_lua.lua b/lua/user/lsp/settings/sumneko_lua.lua
deleted file mode 100644
index 0ac454a..0000000
--- a/lua/user/lsp/settings/sumneko_lua.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-return {
- settings = {
-
- Lua = {
- diagnostics = {
- globals = { "vim" },
- },
- workspace = {
- library = {
- [vim.fn.expand("$VIMRUNTIME/lua")] = true,
- [vim.fn.stdpath("config") .. "/lua"] = true,
- },
- },
- },
- },
-}
diff --git a/lua/user/lsp/settings/texlab.lua b/lua/user/lsp/settings/texlab.lua
deleted file mode 100644
index a564707..0000000
--- a/lua/user/lsp/settings/texlab.lua
+++ /dev/null
@@ -1 +0,0 @@
-return {}
diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua
index 44eac6b..227de7f 100644
--- a/lua/user/plugins.lua
+++ b/lua/user/plugins.lua
@@ -44,7 +44,7 @@ return packer.startup(function(use)
-- LSP
use "neovim/nvim-lspconfig"
- use "williamboman/nvim-lsp-installer"
+ use "williamboman/mason.nvim"
-- Colorsheme
use "morhetz/gruvbox"