commit 6b7d2a87d4c7e615086a463121334461df57152c
parent 5bd65fca024dcf4a7cf9b42e0f809e8b9c6c27b0
Author: Tomas Nemec <owl@gtms.dev>
Date: Tue, 28 Jan 2025 07:50:54 +0100
update
Diffstat:
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/lua/tms/lsp/dart.lua b/lua/tms/lsp/dart.lua
@@ -30,16 +30,20 @@ local capabilities = {
},
}
-local function root_dir(path)
- path = path or vim.fs.dirname(vim.api.nvim_buf_get_name(0))
- local matches = vim.fs.find('pubspec.yaml',
- { path = path, upward = true, limit = math.huge, stop = vim.uv.os_homedir() })
- return vim.fs.dirname(matches[#matches])
-end
+local root_dir = vim.fs.dirname(
+ vim.fs.find('pubspec.yaml', { upward = true, stop = vim.uv.os_homedir() })[1]);
function M.start()
vim.lsp.start {
name = 'dartls',
+ -- cmd = { --
+ -- 'docker', 'run', '--rm', '-i',
+ -- '-v', string.format('.:%s', root_dir),
+ -- '-w', root_dir,
+ -- '-p', '10000:10000',
+ -- 'dart:3.6.0', 'dart', 'language-server', '--protocol=lsp', '--port=10000',
+ -- -- '--instrumentation-log-file=/tmp/dart-plugin-log',
+ -- },
cmd = { --
'dart',
'language-server',
@@ -47,7 +51,7 @@ function M.start()
'--port=10000',
-- '--instrumentation-log-file=/tmp/dart-plugin-log',
},
- root_dir = vim.fs.dirname(vim.fs.find('pubspec.yaml', { upward = true, stop = vim.uv.os_homedir() })[1]),
+ root_dir = root_dir,
capabilities = vim.tbl_deep_extend('force', require 'tms.lsp'.capabilities(), capabilities),
init_options = {
closingLabels = true,