Skip to content

Commit

Permalink
refactor: LSP
Browse files Browse the repository at this point in the history
  • Loading branch information
henry40408 committed May 17, 2024
1 parent af9390f commit 3ae082d
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions home-manager/common/neovim/lua/plugins/astrolsp.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE

-- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine
-- Configuration documentation can be found with `:h astrolsp`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
Expand All @@ -12,16 +10,16 @@ return {
opts = {
-- Configuration table of features provided by AstroLSP
features = {
autoformat = true, -- enable or disable auto formatting on start
codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
autoformat = true, -- enable or disable auto formatting on start
codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting
},
-- customize lsp formatting options
formatting = {
-- control auto formatting on save
format_on_save = {
enabled = true, -- enable or disable format on save globally
enabled = true, -- enable or disable format on save globally
allow_filetypes = { -- enable format on save for specified filetypes only
-- "go",
},
Expand All @@ -40,12 +38,28 @@ return {
},
-- enable servers that you already have installed without mason
servers = {
-- "pyright"
"docker_compose_language_service",
"dockerls",
"eslint",
"jsonls",
"lua_ls",
"marksman",
"nil_ls",
"pyright",
"ruff",
"rust_analyzer",
"taplo",
"tsserver",
"volar",
},
-- customize language server configuration options passed to `lspconfig`
---@diagnostic disable: missing-fields
config = {
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
nil_ls = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
-- customize how language servers are attached
handlers = {
Expand Down

0 comments on commit 3ae082d

Please # to comment.