File tree 1 file changed +4
-11
lines changed
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 11
11
12
12
local M = {}
13
13
14
- local function has_flutter_dependency_in_pubspec ()
15
- local pubspec = vim .fn .glob (" pubspec.yaml" )
16
- if pubspec == " " then return false end
17
- local pubspec_content = vim .fn .readfile (pubspec )
18
- local joined_content = table.concat (pubspec_content , " \n " )
19
-
20
- local flutter_dependency = string.match (joined_content , " flutter:\n [%s\t ]*sdk:[%s\t ]*flutter" )
21
- return flutter_dependency ~= nil
22
- end
23
-
24
14
function M .setup (config )
25
15
local opts = config .debugger
26
16
require (" flutter-tools.executable" ).get (function (paths )
27
- local is_flutter_project = has_flutter_dependency_in_pubspec ()
17
+ local root_patterns = { " .git" , " pubspec.yaml" }
18
+ local current_dir = vim .fn .expand (" %:p:h" )
19
+ local root_dir = path .find_root (root_patterns , current_dir ) or current_dir
20
+ local is_flutter_project = vim .loop .fs_stat (path .join (root_dir , " .metadata" ))
28
21
29
22
if is_flutter_project then
30
23
dap .adapters .dart = {
You can’t perform that action at this time.
0 commit comments