getProjectRoots method

Future<UriList> getProjectRoots({
  1. int depth = defaultGetProjectRootsDepth,
})

Gets the project roots contained within the current set of IDE workspace roots.

A project root is any directory that contains a 'pubspec.yaml' file. If IDE workspace roots are not set, or if there are no project roots within the IDE workspace roots, this method will return an empty UriList.

depth is the maximum depth that each IDE workspace root directory tree will be searched for project roots.

The returned uris will be file:// Uris.

Implementation

Future<UriList> getProjectRoots({
  int depth = defaultGetProjectRootsDepth,
}) async {
  final result = await call(
    kFileSystemServiceName,
    'getProjectRoots',
    params: {'depth': depth},
  );
  return UriList.fromDTDResponse(result);
}