mirror of
https://github.com/pnx/dotfiles
synced 2026-08-29 06:08:12 +02:00
nvim/lua/user/plugins/ide/lsp.lua: update
This commit is contained in:
parent
36939b006a
commit
681910f785
1 changed files with 122 additions and 115 deletions
|
|
@ -1,50 +1,16 @@
|
|||
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
|
||||
--- @field server_capabilities? lsp.ServerCapabilities
|
||||
--- @field on_save function | nil
|
||||
|
||||
--- @class LSPFeatures
|
||||
--- @field document_highlight? { enabled: boolean }
|
||||
--- @field codelens? { enabled: boolean }
|
||||
--- @field inlay_hints? { enabled: boolean, exclude?: table }
|
||||
--- @class LSPServerOptions : LSPFeatures
|
||||
--- @field server_capabilities? lsp.ServerCapabilities
|
||||
--- @field on_save function | nil
|
||||
--- @field mason boolean | nil
|
||||
|
||||
--- @class LSPOptions
|
||||
opts = {
|
||||
--- @class LSPFeatures
|
||||
--- @field document_highlight? { enabled: boolean }
|
||||
--- @field codelens? { enabled: boolean }
|
||||
--- @field inlay_hints? { enabled: boolean, exclude?: table }
|
||||
|
||||
--- @class LSPOptions
|
||||
local options = {
|
||||
--- @type LSPFeatures
|
||||
features = {
|
||||
document_highlight = {
|
||||
|
|
@ -60,9 +26,10 @@ return {
|
|||
},
|
||||
--- @type { string: LSPServerOptions }
|
||||
servers = {},
|
||||
},
|
||||
--- @param opts LSPOptions
|
||||
config = function(_, opts)
|
||||
}
|
||||
|
||||
--- @param opts LSPOptions
|
||||
local config = function(_, opts)
|
||||
local lspconfig = require("lspconfig")
|
||||
local utils = require("user.utils.lsp")
|
||||
local augroup = vim.api.nvim_create_augroup("Lsp", {})
|
||||
|
|
@ -147,5 +114,45 @@ return {
|
|||
handlers = { setup },
|
||||
})
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue