1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-07-03 23:13:39 +02:00

nvim/lua/user/plugins/ide/lsp.lua: update

This commit is contained in:
Henrik Hautakoski 2025-05-13 23:00:41 +02:00
parent 36939b006a
commit 681910f785

View file

@ -1,42 +1,8 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{
"williamboman/mason.nvim",
optional = true,
dependencies = {
{ "williamboman/mason-lspconfig.nvim", config = function () end }
}
},
-- LSP often return markdown that neovim parses.
-- make sure we have a plugin that can render markdown to nicer text
{
'MeanderingProgrammer/render-markdown.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "markdown", "markdown_inline" }
}
}
},
opts = {
overrides = {
buftype = {
-- LSP Hover = "nofile"
nofile = {
code = { left_pad = 0, right_pad = 0 },
},
},
},
}
}
},
--- @class LSPServerOptions : LSPFeatures --- @class LSPServerOptions : LSPFeatures
--- @field server_capabilities? lsp.ServerCapabilities --- @field server_capabilities? lsp.ServerCapabilities
--- @field on_save function | nil --- @field on_save function | nil
--- @field mason boolean | nil
--- @class LSPFeatures --- @class LSPFeatures
--- @field document_highlight? { enabled: boolean } --- @field document_highlight? { enabled: boolean }
@ -44,7 +10,7 @@ return {
--- @field inlay_hints? { enabled: boolean, exclude?: table } --- @field inlay_hints? { enabled: boolean, exclude?: table }
--- @class LSPOptions --- @class LSPOptions
opts = { local options = {
--- @type LSPFeatures --- @type LSPFeatures
features = { features = {
document_highlight = { document_highlight = {
@ -60,9 +26,10 @@ return {
}, },
--- @type { string: LSPServerOptions } --- @type { string: LSPServerOptions }
servers = {}, servers = {},
}, }
--- @param opts LSPOptions --- @param opts LSPOptions
config = function(_, opts) local config = function(_, opts)
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local utils = require("user.utils.lsp") local utils = require("user.utils.lsp")
local augroup = vim.api.nvim_create_augroup("Lsp", {}) local augroup = vim.api.nvim_create_augroup("Lsp", {})
@ -147,5 +114,45 @@ return {
handlers = { setup }, handlers = { setup },
}) })
end end
end, end
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{
"williamboman/mason.nvim",
version = "^1.0.0",
optional = true,
dependencies = {
{ "williamboman/mason-lspconfig.nvim", version = "^1.0.0", config = function () end }
}
},
-- LSP often return markdown that neovim parses.
-- make sure we have a plugin that can render markdown to nicer text
{
'MeanderingProgrammer/render-markdown.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "markdown", "markdown_inline" }
}
}
},
opts = {
overrides = {
buftype = {
-- LSP Hover = "nofile"
nofile = {
code = { left_pad = 0, right_pad = 0 },
},
},
},
}
}
},
opts = options,
config = config
} }