summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/getchoo/lsp/config.lua
diff options
context:
space:
mode:
authorseth <[email protected]>2022-08-24 15:37:06 -0400
committerseth <[email protected]>2022-08-24 15:37:06 -0400
commit8fef927ede6733c20a53c4b0c13d2ab4cb08b604 (patch)
treec5eae97847773355ffd3f2afcc84c7c9c2a5b387 /.config/nvim/lua/getchoo/lsp/config.lua
parentee45c4211d79dfb3b62531cc4f974ac3932e5131 (diff)
refactor lsp config
Diffstat (limited to '.config/nvim/lua/getchoo/lsp/config.lua')
-rw-r--r--.config/nvim/lua/getchoo/lsp/config.lua117
1 files changed, 0 insertions, 117 deletions
diff --git a/.config/nvim/lua/getchoo/lsp/config.lua b/.config/nvim/lua/getchoo/lsp/config.lua
deleted file mode 100644
index 60ece4d..0000000
--- a/.config/nvim/lua/getchoo/lsp/config.lua
+++ /dev/null
@@ -1,117 +0,0 @@
---
--- config for lsp server
---
-local null_ls = require("null-ls")
-local diagnostics = null_ls.builtins.diagnostics
-local formatting = null_ls.builtins.formatting
-
-local M = {}
-
-vim.g.coq_settings = { auto_start = "shut-up" }
-
-local sources = {
- lsp_servers = { "rust_analyzer", "pyright", "bashls" },
- null_ls = {
- diagnostics.alex,
- diagnostics.codespell,
- diagnostics.flake8,
- formatting.black,
- formatting.codespell,
- formatting.prettier,
- formatting.rustfmt,
- formatting.stylua,
- },
- mason = {
- "alex",
- "black",
- "codespell",
- "flake8",
- "prettier",
- "stylua",
- },
-}
-
--- configure lsp servers
-local all_config = {}
-local servers = {}
-for _, server in ipairs(sources.lsp_servers) do
- servers[server] = all_config
-end
-
-servers["sumneko_lua"] = {
- settings = {
- Lua = {
- runtime = {
- version = "LuaJIT",
- },
- diagnostics = {
- globals = { "vim" },
- },
- workspace = {
- library = vim.api.nvim_get_runtime_file("", true),
- },
- telemetry = {
- enable = false,
- },
- },
- },
-}
-
-M.lsp_servers = servers
-
--- only use null-ls for formatting
-
---- for neovim >= 8
---- local lsp_formatting = function(bufnr)
---- vim.lsp.buf.format({
---- filter = function(client)
---- return client.name == "null-ls"
---- end,
---- bufnr = bufnr,
---- })
---- end
-
-local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-local on_attach = function(client, bufnr)
- if client.supports_method("textDocument/formatting") then
- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
- vim.api.nvim_create_autocmd("BufWritePre", {
- group = augroup,
- buffer = bufnr,
- callback = function()
- local params = require("vim.lsp.util").make_formatting_params({})
- client.request("textDocument/formatting", params, nil, bufnr)
- -- lsp_formatting(bufnr) -- neovim >= 8
- end,
- })
- end
-end
-
-M.null_ls = {
- on_attach = on_attach,
- sources = sources.null_ls,
-}
-
-M.mason_tool_installer = {
- ensure_installed = sources.mason,
-}
-
-M.mason_lsp = {
- automatic_installation = true,
-}
-
--- etc plugins
-M.bufferline = {
- options = {
- numbers = "ordinal",
- diagnostics = "nvim_lsp",
- always_show_bufferline = false,
- },
-}
-M.tree = {}
-M.treesitter = {
- auto_install = true,
-}
-M.trouble = {}
-
-return M