@@ -124,9 +124,9 @@ local function parse_pubspec(pubspec_path)
124124 local content = vim .fn .readfile (pubspec_path )
125125 if not content or # content == 0 then return nil end
126126 local joined_content = table.concat (content , " \n " )
127- local ok , parsed = pcall (function ()
128- return require (" flutter-tools.utils.yaml_parser" ).parse (joined_content )
129- end )
127+ local ok , parsed = pcall (
128+ function () return require (" flutter-tools.utils.yaml_parser" ).parse (joined_content ) end
129+ )
130130 if ok and parsed then return parsed end
131131 return nil
132132end
@@ -158,19 +158,15 @@ function M.find_root(patterns, startpath)
158158 if not root then return nil end
159159
160160 local pubspec_path = M .join (root , " pubspec.yaml" )
161- if not is_pub_workspace_member (pubspec_path ) then
162- return root
163- end
161+ if not is_pub_workspace_member (pubspec_path ) then return root end
164162
165163 -- Workspace member, traverse upward to find the workspace root
166164 local parent = M .dirname (root )
167165 if not parent or parent == root then return root end
168166
169167 for dir in M .iterate_parents (parent ) do
170168 local workspace_pubspec = M .join (dir , " pubspec.yaml" )
171- if is_pub_workspace_root (workspace_pubspec ) then
172- return dir
173- end
169+ if is_pub_workspace_root (workspace_pubspec ) then return dir end
174170 end
175171
176172 return root
0 commit comments