Browse Source

feat(neovim): move `mason-lspconfig` package management to `Brewfile`

Joe 1 year ago
parent
commit
3954e985eb

+ 28 - 2
.config/brew/Brewfile

@@ -3,6 +3,12 @@ tap "homebrew/bundle"
 tap "homebrew/services"
 tap "koekeishiya/formulae"
 tap "waydabber/betterdisplay"
+# AWS Cloud Development Kit - framework for defining AWS infra as code
+brew "aws-cdk"
+# Pyright fork with various improvements and built-in pylance features
+brew "basedpyright"
+# Language Server for Bash
+brew "bash-language-server"
 # Object-file caching compiler wrapper
 brew "ccache"
 # Cross-platform make
@@ -33,8 +39,12 @@ brew "fzf"
 brew "gh"
 # Distributed revision control system
 brew "git"
+# Interpreted, interactive, object-oriented programming language
+brew "python@3.13"
 # Open source programming language to build simple/reliable/efficient software
 brew "go"
+# Language server for the Go language
+brew "gopls"
 # GitHub Markdown previewer
 brew "grip"
 # Lightweight and flexible command-line JSON processor
@@ -47,16 +57,22 @@ brew "lazygit"
 brew "leveldb"
 # Postgres C API library
 brew "libpq"
+# Interpreted, interactive, object-oriented programming language
+brew "python@3.12"
 # C library SSHv1/SSHv2 client and server protocols
 brew "libssh"
 # Clone of ls with colorful output, file type icons, and more
 brew "lsd"
+# Language Server for the Lua language
+brew "lua-language-server"
 # Package manager for the Lua programming language
 brew "luarocks"
 # Bare libuv bindings for lua
 brew "luv"
 # Utility for directing compilation
 brew "make"
+# Language Server Protocol for Markdown
+brew "marksman"
 # Text-based UI library
 brew "ncurses"
 # Ambitious Vim-fork focused on extensibility and agility
@@ -71,8 +87,6 @@ brew "pgformatter"
 brew "postgresql@16"
 # Code formatter for JavaScript, CSS, JSON, GraphQL, Markdown, YAML
 brew "prettier"
-# Interpreted, interactive, object-oriented programming language
-brew "python@3.13"
 # Generic machine emulator and virtualizer
 brew "qemu"
 # Search tool like grep and The Silver Searcher
@@ -81,18 +95,30 @@ brew "ripgrep"
 brew "ruff"
 # Safe, concurrent, practical language
 brew "rust"
+# Experimental Rust compiler front-end for IDEs
+brew "rust-analyzer"
 # Autoformat shell script source code
 brew "shfmt"
 # Command-line tool to customize Spotify client
 brew "spicetify-cli"
+# Language Server for SQL
+brew "sql-language-server"
+# TOML toolkit written in Rust
+brew "taplo"
 # Terminal multiplexer
 brew "tmux"
+# Language Server Protocol implementation for TypeScript wrapping tsserver
+brew "typescript-language-server"
 # Maintained ctags implementation
 brew "universal-ctags"
+# Language servers for HTML, CSS, JavaScript, and JSON extracted from vscode
+brew "vscode-langservers-extracted"
 # Executes a program periodically, showing output fullscreen
 brew "watch"
 # Internet file retriever
 brew "wget"
+# Language Server for Yaml Files
+brew "yaml-language-server"
 # Fish-like fast/unobtrusive autosuggestions for zsh
 brew "zsh-autosuggestions"
 # Fish shell like syntax highlighting for zsh

+ 8 - 28
.config/nvim/custom/proj-conf/lua/proj-conf/lsp/init.lua

@@ -5,20 +5,13 @@ return {
     default = {
         "default_lsp"
     },
-    default_lsp = { "default_arduino_language_server_config",
+    default_lsp = {
         "default_bashls_config", "default_basedpyright_config_and_typechecking",
-        "default_clangd_config", "default_cssls_config", "default_denols_config",
-        "default_gopls_config", "default_html_config", "default_jsonls_config",
-        "default_kotlin_language_server_config", "default_lemminx_config",
-        "default_lua_ls_config", "default_marksman_config",
-        "default_rust_analyzer_config", "default_sqlls_config",
-        "default_taplo_config", "default_terraformls_config",
-        "default_tsserver_config", "default_yamlls_config" },
-    default_arduino_language_server_config = function()
-        lspconfig.arduino_language_server.setup({
-            capabilities = capabilities
-        })
-    end,
+        "default_cssls_config", "default_denols_config", "default_gopls_config",
+        "default_html_config", "default_jsonls_config", "default_lua_ls_config",
+        "default_marksman_config", "default_rust_analyzer_config",
+        "default_sqlls_config", "default_taplo_config", "default_ts_ls_config",
+        "default_yamlls_config" },
     default_bashls_config = function()
         lspconfig.bashls.setup({ capabilities = capabilities })
     end,
@@ -39,9 +32,6 @@ return {
             }
         })
     end,
-    default_clangd_config = function()
-        lspconfig.clangd.setup({ capabilities = capabilities })
-    end,
     default_cssls_config = function()
         lspconfig.cssls.setup({ capabilities = capabilities })
     end,
@@ -71,13 +61,6 @@ return {
     default_jsonls_config = function()
         lspconfig.jsonls.setup({ capabilities = capabilities })
     end,
-    default_kotlin_language_server_config = function()
-        lspconfig.kotlin_language_server.setup(
-            { capabilities = capabilities })
-    end,
-    default_lemminx_config = function()
-        lspconfig.lemminx.setup({ capabilities = capabilities })
-    end,
     default_lua_ls_config = function()
         lspconfig.lua_ls.setup({
             capabilities = capabilities,
@@ -114,10 +97,7 @@ return {
     default_taplo_config = function()
         lspconfig.taplo.setup({ capabilities = capabilities })
     end,
-    default_terraformls_config = function()
-        lspconfig.terraformls.setup({ capabilities = capabilities })
-    end,
-    default_tsserver_config = function()
+    default_ts_ls_config = function()
         local inlayHints = {
             includeInlayEnumMemberValueHints = true,
             includeInlayFunctionLikeReturnTypeHints = true,
@@ -127,7 +107,7 @@ return {
             includeInlayPropertyDeclarationTypeHints = true,
             includeInlayVariableTypeHints = true
         }
-        lspconfig.tsserver.setup({
+        lspconfig.ts_ls.setup({
             capabilities = capabilities,
             javascript = { inlayHints = inlayHints },
             typescript = { inlayHints = inlayHints },

+ 1 - 24
.config/nvim/lua/plugins/lsp.lua

@@ -3,19 +3,7 @@ return {
         "neovim/nvim-lspconfig",
         enabled = true,
         lazy = false,
-        dependencies = { "williamboman/mason-lspconfig.nvim" },
         config = function(_, _)
-            -- Install and configure servers
-            require("mason").setup()
-            require("mason-lspconfig").setup({
-                ensure_installed = {
-                    "arduino_language_server", "basedpyright", "bashls", "clangd",
-                    "cssls", "denols", "gopls", "html", "jsonls",
-                    "kotlin_language_server", "lemminx", "lua_ls", "marksman",
-                    "ruff", "rust_analyzer", "sqlls", "taplo", "terraformls",
-                    "tsserver", "yamlls"
-                }
-            })
             -- Configuration on attach
             vim.api.nvim_create_autocmd("LspAttach", {
                 group = vim.api.nvim_create_augroup("UserLspConfig", {}),
@@ -36,16 +24,5 @@ return {
                 end
             })
         end
-    }, {
-    "williamboman/mason-lspconfig.nvim",
-    enabled = true,
-    lazy = false,
-    automatic_installation = true,
-    dependencies = { "williamboman/mason.nvim" }
-}, {
-    "williamboman/mason.nvim",
-    enabled = true,
-    lazy = false,
-    build = ":MasonUpdate"
-}
+    }
 }