summaryrefslogtreecommitdiff
path: root/lua/ache/plugins/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'lua/ache/plugins/lsp')
-rw-r--r--lua/ache/plugins/lsp/lspconfig.lua6
-rw-r--r--lua/ache/plugins/lsp/ltex-extra.lua31
-rw-r--r--lua/ache/plugins/lsp/mason-config.lua7
-rw-r--r--lua/ache/plugins/lsp/mason-lspconf.lua16
-rw-r--r--lua/ache/plugins/lsp/rust-tools.lua31
5 files changed, 69 insertions, 22 deletions
diff --git a/lua/ache/plugins/lsp/lspconfig.lua b/lua/ache/plugins/lsp/lspconfig.lua
index 59e9ceb..332652f 100644
--- a/lua/ache/plugins/lsp/lspconfig.lua
+++ b/lua/ache/plugins/lsp/lspconfig.lua
@@ -1,3 +1,7 @@
+--[
+-- Ensure that the LSP feature is up and runing.
+--]
+
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
@@ -121,7 +125,7 @@ return {
-- Configuration specific to svelte LSP server
lspconfig["svelte"].setup({
capabilities = capabilities,
- on_attach = function(client, bufnr)
+ on_attach = function(client, _)
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
callback = function(ctx)
diff --git a/lua/ache/plugins/lsp/ltex-extra.lua b/lua/ache/plugins/lsp/ltex-extra.lua
new file mode 100644
index 0000000..9ae2d3a
--- /dev/null
+++ b/lua/ache/plugins/lsp/ltex-extra.lua
@@ -0,0 +1,31 @@
+-- LanguageTool LSP.
+
+local ltex_extra_opts = {}
+local ltex_ls_opts = {
+ ltex = {
+ language = "fr",
+ },
+}
+
+return {
+ "barreiroleo/ltex_extra.nvim",
+ ft = { "markdown", "tex", "text" },
+ dependencies = { "neovim/nvim-lspconfig" },
+ -- yes, you can use the opts field, just I'm showing the setup explicitly
+ config = function()
+ require("ltex_extra").setup({
+ ltex_extra_opts,
+ server_opts = {
+ -- capabilities = capabilities,
+ --
+ filetypes = { "markdown", "text" },
+ flags = { debounce_text_changes = 300 },
+ cmd = { "ltex-ls" },
+ -- on_attach = function(client, bufnr)
+ -- -- your on_attach process
+ -- end,
+ settings = ltex_ls_opts,
+ },
+ })
+ end,
+}
diff --git a/lua/ache/plugins/lsp/mason-config.lua b/lua/ache/plugins/lsp/mason-config.lua
index a2a26e8..0352aef 100644
--- a/lua/ache/plugins/lsp/mason-config.lua
+++ b/lua/ache/plugins/lsp/mason-config.lua
@@ -1,3 +1,8 @@
+--[
+-- This plugin is responsable of having external tools correcly present on the system.
+-- Precisely, the configuration part.
+--]
+
return {
"williamboman/mason.nvim",
dependencies = {
@@ -24,7 +29,7 @@ return {
mason_lspconfig.setup({
lazy = true,
ensure_installed = {
- "tsserver",
+ -- "tsserver",
"html",
"cssls",
"ltex",
diff --git a/lua/ache/plugins/lsp/mason-lspconf.lua b/lua/ache/plugins/lsp/mason-lspconf.lua
index 267bbb2..06b5edf 100644
--- a/lua/ache/plugins/lsp/mason-lspconf.lua
+++ b/lua/ache/plugins/lsp/mason-lspconf.lua
@@ -1,8 +1,12 @@
+--[
+-- This plugin is responsable of having external tools correcly present on the system.
+--]
+
return {
- -- NOTE: mason is a dependencie of mason-lspconfig. Not the other way around.
- "williamboman/mason-lspconfig.nvim",
- dependencies = {
- "williamboman/mason.nvim",
- "neovim/nvim-lspconfig",
- },
+ -- NOTE: mason is a dependencie of mason-lspconfig. Not the other way around.
+ "williamboman/mason-lspconfig.nvim",
+ dependencies = {
+ "williamboman/mason.nvim",
+ "neovim/nvim-lspconfig",
+ },
}
diff --git a/lua/ache/plugins/lsp/rust-tools.lua b/lua/ache/plugins/lsp/rust-tools.lua
index ee94be5..fe5c97e 100644
--- a/lua/ache/plugins/lsp/rust-tools.lua
+++ b/lua/ache/plugins/lsp/rust-tools.lua
@@ -1,17 +1,20 @@
+--[
+-- I don't know, rust related.
+--]
return {
- "simrat39/rust-tools.nvim",
- config = function()
- local rt = require("rust-tools")
+ "simrat39/rust-tools.nvim",
+ config = function()
+ local rt = require("rust-tools")
- rt.setup({
- server = {
- on_attach = function(_, bufnr)
- -- Hover actions
- vim.keymap.set("n", "<C-!>", rt.hover_actions.hover_actions, { buffer = bufnr })
- -- Code action groups
- vim.keymap.set("n", "<leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
- end,
- },
- })
- end,
+ rt.setup({
+ server = {
+ on_attach = function(_, bufnr)
+ -- Hover actions
+ vim.keymap.set("n", "<C-!>", rt.hover_actions.hover_actions, { buffer = bufnr })
+ -- Code action groups
+ vim.keymap.set("n", "<leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
+ end,
+ },
+ })
+ end,
}