Skip to content

Debug adapter maps some file paths to the wrong location #128880

@DanTup

Description

@DanTup

In the debug adapter, we map org-dartlang-sdk URIs onto local file paths so that the IDE can open them:

// '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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions