-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
In the debug adapter, we map org-dartlang-sdk URIs onto local file paths so that the IDE can open them:
flutter/packages/flutter_tools/lib/src/debug_adapters/flutter_base_adapter.dart
Lines 99 to 105 in 40bb615
| // 'dart:ui' maps to /flutter/lib/ui | |
| final String flutterRoot = fileSystem.path.join(flutterSdkRoot, 'bin', 'cache', 'pkg', 'sky_engine', 'lib', 'ui'); | |
| orgDartlangSdkMappings[flutterRoot] = Uri.parse('org-dartlang-sdk:///flutter/lib/ui'); | |
| // The rest of the Dart SDK maps to /third_party/dart/sdk | |
| final String dartRoot = fileSystem.path.join(flutterSdkRoot, 'bin', 'cache', 'pkg', 'sky_engine'); | |
| orgDartlangSdkMappings[dartRoot] = Uri.parse('org-dartlang-sdk:///third_party/dart/sdk'); |
@CoderDake discovered that some mappings were not working in VS Code, for example dart:core-patch/growable_array.dart.
It turns out that growable_array.dart exists here:
flutter/bin/cache/dart-sdk/lib/_internal/vm/lib/growable_array.dart
but not here:
flutter/bin/cache/pkg/sky_engine/lib/_internal/vm/lib/growable_array.dart
This means the IDE fails to find the file.
Are we mapping to the wrong location? Should we be mapping to dart-sdk instead of pkg/sky_engine (except for ui which only exists in sky_engine)? Or are there other differences between these locations (other than sky_engine missing lots of files)? Do we need to conditionally map some URIs to one and some to the other (besides ui)?
I can make the change, but I'd like to ensure I understand the differences between these folders before I do, but I'm not where I can find the answer to that (@christopherfujino is this something you know, or can point me in the right direction?)