dart lsp
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
local M = {}
|
||||
|
||||
-- This function returns project local dart, or fallsback to global
|
||||
function M.executable(path)
|
||||
local directory = vim.fn.isdirectory(path) == 1 and path or vim.fs.dirname(path)
|
||||
local root = vim.fs.root(directory, { "pubspec.yaml" })
|
||||
|
||||
if root then
|
||||
local fvm_dart = root .. "/.fvm/flutter_sdk/bin/dart"
|
||||
if vim.fn.executable(fvm_dart) == 1 then
|
||||
return fvm_dart
|
||||
end
|
||||
end
|
||||
|
||||
return "dart"
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user