summaryrefslogtreecommitdiff
path: root/lua/ache/plugins
diff options
context:
space:
mode:
authorache <ache@ache.one>2025-05-14 18:21:53 +0200
committerache <ache@ache.one>2025-05-14 18:21:53 +0200
commit20563c87f6e61817738dc282341fc3bd14253da7 (patch)
tree661d1985b5a0148516b914aef74207494a78843d /lua/ache/plugins
parentConfigure formatting (diff)
Remove config for lsp capabilities
Diffstat (limited to 'lua/ache/plugins')
-rw-r--r--lua/ache/plugins/lsp/lspconfig.lua80
-rw-r--r--lua/ache/plugins/lsp/mason-config.lua53
-rw-r--r--lua/ache/plugins/lsp/mason-lspconf.lua226
3 files changed, 242 insertions, 117 deletions
diff --git a/lua/ache/plugins/lsp/lspconfig.lua b/lua/ache/plugins/lsp/lspconfig.lua
index d859004..65cf1dd 100644
--- a/lua/ache/plugins/lsp/lspconfig.lua
+++ b/lua/ache/plugins/lsp/lspconfig.lua
@@ -4,6 +4,7 @@
return {
"neovim/nvim-lspconfig",
+ enabled = true,
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
@@ -126,6 +127,7 @@ return {
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
+ --[[
mason_lspconfig.setup_handlers({
-- default handler for installed servers
function(server_name)
@@ -135,87 +137,21 @@ return {
end,
["svelte"] = function()
-- Configuration specific to svelte LSP server
- lspconfig["svelte"].setup({
- capabilities = capabilities,
- on_attach = function(client, _)
- vim.api.nvim_create_autocmd("BufWritePost", {
- pattern = { "*.js", "*.mjs", "*.svelte" },
- callback = function(ctx)
- -- Here use ctx.match instead of ctx.file
- client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
- end,
- })
- end,
- })
+
end,
["ltex"] = function()
- lspconfig["ltex"].setup({
- filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
- settings = {
- ltex = {
- enabled = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
- language = { "en-GB", "fr-FR" },
- setenceCacheSize = 2000,
- additionalRules = {
- enablePickyRules = true,
- motherTongue = "fr-FR",
- },
- checkFrequency = "edit",
- },
- },
- })
+
end,
["lua_ls"] = function()
- lspconfig["lua_ls"].setup({
- capabilities = capabilities,
- settings = {
- Lua = {
- -- Make the language server recognize the "vim" global variable
- diagnostics = {
- globals = { "vim" },
- },
- completion = {
- callSnippet = "Replace",
- },
- },
- },
- })
+
end,
["harper_ls"] = function()
- lspconfig["harper_ls"].setup({
- settings = {
- ["harper-ls"] = {
- markdown = {
- IgnoreLinkTitle = true,
- },
- linters = {
- SpellCheck = true,
- SpelledNumbers = true,
- AnA = true,
- SentenceCapitalization = true,
- UnclosedQuotes = true,
- WrongQuotes = false,
- LongSentences = true,
- RepeatedWords = true,
- Spaces = true,
- Matcher = true,
- CorrectNumberSuffix = true,
- },
- isolateEnglish = true,
- },
- },
- })
+
end,
["pyright"] = function()
- lspconfig["pyright"].setup({
- capabilities = capabilities,
- settings = {
- python = {
- pythonPath = "/usr/bin/python",
- },
- },
- })
+
end,
})
+ --]]
end,
}
diff --git a/lua/ache/plugins/lsp/mason-config.lua b/lua/ache/plugins/lsp/mason-config.lua
index e19ada0..6fc48a9 100644
--- a/lua/ache/plugins/lsp/mason-config.lua
+++ b/lua/ache/plugins/lsp/mason-config.lua
@@ -4,52 +4,15 @@
return {
"williamboman/mason.nvim",
- dependencies = {
- "WhoIsSethDaniel/mason-tool-installer.nvim",
- "mfussenegger/nvim-dap",
- "jay-babu/mason-nvim-dap.nvim",
- "neovim/nvim-lspconfig",
- },
+ enabled = true,
config = function()
- local mason = require("mason")
-
- local mason_lspconfig = require("mason-lspconfig")
- local mason_tool_installer = require("mason-tool-installer")
- local mason_dap = require("mason-nvim-dap")
-
- mason.setup()
- mason_dap.setup({
- automatic_installation = true,
- ensure_installed = {
- "codelldb",
- },
- })
-
- mason_lspconfig.setup({
- lazy = true,
- automatic_installation = true,
- ensure_installed = {
- "html",
- "cssls",
- "harper_ls",
- "ltex",
- "svelte",
- "lua_ls",
- "pyright",
- "ruff",
- "rust_analyzer",
- },
- })
-
- mason_tool_installer.setup({
- ensure_installed = {
- "prettier", -- Web related formatter
- "stylua", -- Lua formater
- "isort", -- Python formater
- "black", -- Python formater too
- -- "ruff", -- Python linter
- "eslint_d", -- JavaScript linter
- "llm-ls",
+ require("mason").setup({
+ ui = {
+ icons = {
+ package_installed = "✓",
+ package_pending = "➜",
+ package_uninstalled = "✗",
+ },
},
})
end,
diff --git a/lua/ache/plugins/lsp/mason-lspconf.lua b/lua/ache/plugins/lsp/mason-lspconf.lua
index 03d564b..3f8b67a 100644
--- a/lua/ache/plugins/lsp/mason-lspconf.lua
+++ b/lua/ache/plugins/lsp/mason-lspconf.lua
@@ -5,8 +5,234 @@
return {
-- NOTE: mason is a dependencie of mason-lspconfig. Not the other way around.
"williamboman/mason-lspconfig.nvim",
+ enabled = true,
dependencies = {
"williamboman/mason.nvim",
+ "WhoIsSethDaniel/mason-tool-installer.nvim",
+ "mfussenegger/nvim-dap",
+ "jay-babu/mason-nvim-dap.nvim",
"neovim/nvim-lspconfig",
},
+ config = function()
+ local mason_lspconfig = require("mason-lspconfig")
+ local mason_tool_installer = require("mason-tool-installer")
+ local mason_dap = require("mason-nvim-dap")
+ local lspconfig = require("lspconfig")
+ local capabilities = require("cmp_nvim_lsp").default_capabilities()
+
+ mason_dap.setup({
+ automatic_installation = true,
+ ensure_installed = {
+ "codelldb",
+ },
+ --[[
+ handlers = {
+ -- cette première fonction est le "gestionnaire par défaut"
+ -- elle s'applique à chaque serveur linguistique sans "gestionnaire personnalisé"
+ function(server_name)
+ require("lspconfig")[server_name].setup({})
+ end,
+ },
+ --]]
+ })
+
+ mason_lspconfig.setup({
+ lazy = false,
+ automatic_installation = true,
+ automatic_enable = {
+ exclude = { "harper_ls" },
+ },
+ ensure_installed = {
+ "html",
+ "cssls",
+ -- "harper_ls",
+ "ltex",
+ "svelte",
+ "lua_ls",
+ "pyright",
+ "ruff",
+ "rust_analyzer",
+ },
+ handlers = {
+ -- default handler for installed servers
+ function(server_name)
+ lspconfig[server_name].setup({
+ capabilities = capabilities,
+ })
+ end,
+ ["svelte"] = function()
+ -- Configuration specific to svelte LSP server
+ lspconfig["svelte"].setup({
+ capabilities = capabilities,
+ on_attach = function(client, _)
+ vim.api.nvim_create_autocmd("BufWritePost", {
+ pattern = { "*.js", "*.mjs", "*.svelte" },
+ callback = function(ctx)
+ -- Here use ctx.match instead of ctx.file
+ client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
+ end,
+ })
+ end,
+ })
+ end,
+ ["ltex"] = function()
+ lspconfig["ltex"].setup({
+ filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
+ settings = {
+ ltex = {
+ enabled = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
+ language = { "en-GB", "fr-FR" },
+ setenceCacheSize = 2000,
+ additionalRules = {
+ enablePickyRules = true,
+ motherTongue = "fr-FR",
+ },
+ checkFrequency = "edit",
+ },
+ },
+ })
+ end,
+ ["lua_ls"] = function()
+ lspconfig["lua_ls"].setup({
+ capabilities = capabilities,
+ settings = {
+ Lua = {
+ -- Make the language server recognize the "vim" global variable
+ diagnostics = {
+ globals = { "vim" },
+ },
+ completion = {
+ callSnippet = "Replace",
+ },
+ },
+ },
+ })
+ end,
+ ["harper_ls"] = function()
+ lspconfig["harper_ls"].setup({
+ settings = {
+ ["harper-ls"] = {
+ markdown = {
+ IgnoreLinkTitle = true,
+ },
+ linters = {
+ SpellCheck = true,
+ SpelledNumbers = true,
+ AnA = true,
+ SentenceCapitalization = true,
+ UnclosedQuotes = true,
+ WrongQuotes = false,
+ LongSentences = true,
+ RepeatedWords = true,
+ Spaces = true,
+ Matcher = true,
+ CorrectNumberSuffix = true,
+ },
+ isolateEnglish = true,
+ },
+ },
+ })
+ end,
+ ["pyright"] = function()
+ lspconfig["pyright"].setup({
+ capabilities = capabilities,
+ settings = {
+ python = {
+ pythonPath = "/usr/bin/python",
+ },
+ },
+ })
+ end,
+ },
+ })
+
+ mason_tool_installer.setup({
+ ensure_installed = {
+ "prettier", -- Web related formatter
+ "stylua", -- Lua formater
+ -- "isort", -- Python formater
+ -- "black", -- Python formater too
+ "ruff", -- Python linter
+ "eslint_d", -- JavaScript linter
+ "llm-ls",
+ "shfmt",
+ },
+ })
+
+ lspconfig["svelte"].setup({
+ -- capabilities = capabilities,
+ on_attach = function(client, _)
+ vim.api.nvim_create_autocmd("BufWritePost", {
+ pattern = { "*.js", "*.mjs", "*.svelte" },
+ callback = function(ctx)
+ -- Here use ctx.match instead of ctx.file
+ client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
+ end,
+ })
+ end,
+ })
+
+ lspconfig["lua_ls"].setup({
+ -- capabilities = capabilities,
+ settings = {
+ Lua = {
+ -- Make the language server recognize the "vim" global variable
+ diagnostics = {
+ globals = { "vim" },
+ },
+ completion = {
+ callSnippet = "Replace",
+ },
+ },
+ },
+ })
+ lspconfig["harper_ls"].setup({
+ filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
+ settings = {
+ ["harper-ls"] = {
+ markdown = {
+ IgnoreLinkTitle = true,
+ },
+ linters = {
+ SpellCheck = true,
+ SpelledNumbers = false,
+ AnA = true,
+ SentenceCapitalization = true,
+ UnclosedQuotes = false,
+ WrongQuotes = false,
+ LongSentences = true,
+ RepeatedWords = true,
+ Spaces = true,
+ Matcher = false,
+ CorrectNumberSuffix = true,
+ },
+ isolateEnglish = true,
+ },
+ },
+ })
+ lspconfig["pyright"].setup({
+ -- capabilities = capabilities,
+ settings = {
+ python = {
+ pythonPath = "/usr/bin/python",
+ },
+ },
+ })
+
+ lspconfig["ltex"].setup({
+ filetypes = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
+ settings = {
+ ltex = {
+ enabled = { "latex", "typst", "typ", "bib", "markdown", "plaintex", "tex" },
+ language = { "en-GB", "fr-FR" },
+ setenceCacheSize = 2000,
+ additionalRules = {
+ enablePickyRules = true,
+ motherTongue = "fr-FR",
+ },
+ checkFrequency = "edit",
+ },
+ },
+ })
+ end,
}