commit ae591c4ca1f4ae18675fd7350290c4dbbdbe5d89
parent e24f17491806f8e6b20e63df8b7f2e0c5d83d279
Author: Tomas Nemec <nemec@medoro.org>
Date: Thu, 5 Jun 2025 09:48:43 +0200
update
Diffstat:
9 files changed, 75 insertions(+), 72 deletions(-)
diff --git a/after/lsp/bashls.lua b/after/lsp/bashls.lua
@@ -0,0 +1,3 @@
+return {
+ filetypes = { 'bash', 'sh', 'zsh' },
+}
diff --git a/after/lsp/dartls.lua b/after/lsp/dartls.lua
@@ -0,0 +1,70 @@
+local capabilities = {
+ textDocument = {
+ hover = {
+ dynamicRegistration = false
+ },
+ inlayHint = {
+ dynamicRegistration = false
+ },
+ rename = {
+ dynamicRegistration = false,
+ },
+ codeAction = {
+ dynamicRegistration = false
+ },
+ rangeFormatting = {
+ dynamicRegistration = false
+ },
+ formatting = {
+ dynamicRegistration = false
+ },
+ definition = {
+ dynamicRegistration = false
+ }
+ },
+ workspace = {
+ workspaceEdit = { documentChanges = true },
+ fileOperations = { willRename = true }
+ },
+}
+
+return {
+ -- cmd = { --
+ -- 'docker', 'run', '--rm', '-i',
+ -- '-v', string.format('.:%s', root_dir),
+ -- '-w', root_dir,
+ -- '-p', '10000:10000',
+ -- 'dart:3.4.0', 'dart', 'language-server', '--protocol=lsp', '--diagnostic-port=10000',
+ -- -- '--instrumentation-log-file=/tmp/dart-plugin-log',
+ -- },
+ -- cmd = vim.lsp.rpc.connect('localhost', 10000),
+ cmd = { --
+ 'dart',
+ 'language-server',
+ '--protocol=lsp',
+ '--port=10000',
+ -- '--instrumentation-log-file=/tmp/dart-plugin-log',
+ },
+ capabilities = vim.tbl_deep_extend('force', vim.lsp.protocol.make_client_capabilities(), capabilities),
+ init_options = {
+ closingLabels = true,
+ outline = false,
+ flutterOutline = false,
+ },
+ settings = { dart = { completeFunctionCalls = true, showTodos = true } },
+ handlers = {
+ -- ['dart/textDocument/publishClosingLabels'] = require 'dart-tools.lsp.labels'.handler(),
+ ['dart/textDocument/super'] = function(_, result, ctx)
+ local client = vim.lsp.get_client_by_id(ctx.client_id)
+ if client then
+ vim.lsp.util.show_document(result, client.offset_encoding)
+ end
+ end,
+ ['dart/textDocument/imports'] = function(_, result, ctx)
+ local client = vim.lsp.get_client_by_id(ctx.client_id)
+ if client then
+ vim.lsp.util.show_document(result, client.offset_encoding)
+ end
+ end,
+ },
+}
diff --git a/lsp/html.lua b/after/lsp/html.lua
diff --git a/lsp/intelephense.lua b/after/lsp/intelephense.lua
diff --git a/lsp/jsonls.lua b/after/lsp/jsonls.lua
diff --git a/lsp/lua_ls.lua b/after/lsp/lua_ls.lua
diff --git a/lsp/yamlls.lua b/after/lsp/yamlls.lua
diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua
@@ -1,6 +1,6 @@
-vim.lsp.enable { 'gopls', 'lua_ls', 'dartls', 'zls' }
+vim.lsp.enable { 'gopls', 'lua_ls', 'dartls', 'zls', 'yamlls', 'bashls' }
-local lsp_group = vim.api.nvim_create_augroup('my.lsp', {
+local lsp_group = vim.api.nvim_create_augroup('my.lsp', {
clear = false
})
diff --git a/lsp/dartls.lua b/lsp/dartls.lua
@@ -1,70 +0,0 @@
-local capabilities = {
- textDocument = {
- hover = {
- dynamicRegistration = false
- },
- inlayHint = {
- dynamicRegistration = false
- },
- rename = {
- dynamicRegistration = false,
- },
- codeAction = {
- dynamicRegistration = false
- },
- rangeFormatting = {
- dynamicRegistration = false
- },
- formatting = {
- dynamicRegistration = false
- },
- definition = {
- dynamicRegistration = false
- }
- },
- workspace = {
- workspaceEdit = { documentChanges = true },
- fileOperations = { willRename = true }
- },
-}
-
-return {
- -- cmd = { --
- -- 'docker', 'run', '--rm', '-i',
- -- '-v', string.format('.:%s', root_dir),
- -- '-w', root_dir,
- -- '-p', '10000:10000',
- -- 'dart:3.4.0', 'dart', 'language-server', '--protocol=lsp', '--diagnostic-port=10000',
- -- -- '--instrumentation-log-file=/tmp/dart-plugin-log',
- -- },
- -- cmd = vim.lsp.rpc.connect('localhost', 10000),
- cmd = { --
- 'dart',
- 'language-server',
- '--protocol=lsp',
- '--port=10000',
- -- '--instrumentation-log-file=/tmp/dart-plugin-log',
- },
- capabilities = vim.tbl_deep_extend('force', vim.lsp.protocol.make_client_capabilities(), capabilities),
- init_options = {
- closingLabels = true,
- outline = false,
- flutterOutline = false,
- },
- settings = { dart = { completeFunctionCalls = true, showTodos = true } },
- handlers = {
- ['dart/textDocument/publishClosingLabels'] = require 'dart-tools.lsp.labels'.handler(),
- ['dart/textDocument/super'] = function(_, result, ctx)
- local client = vim.lsp.get_client_by_id(ctx.client_id)
- if client then
- vim.lsp.util.show_document(result, client.offset_encoding)
- end
- end,
- ['dart/textDocument/imports'] = function(_, result, ctx)
- local client = vim.lsp.get_client_by_id(ctx.client_id)
- if client then
- vim.lsp.util.show_document(result, client.offset_encoding)
- end
- end,
- },
-}