Skip to content

Dart package:name/path.dart imports have no resolution rule (import recall 81% on dart-lang/http) #3597

Closed

Description

@squid-protocol

Problem

A Dart import 'package:http_profile/http_profile.dart' names <the http_profile package>/lib/http_profile.dart. The engine has no rule for the package: scheme. The token goes to the name search, and in a monorepo where the same file name exists in several packages, that search draws nothing.

Measured

tests/tools/import_graph_accuracy.py dart (dart-lang/http, added in #3594): precision 99.1%, recall 80.8%, 143 missed imports. For example, cupertino_http/lib/src/cupertino_client.dart → pkgs/http_profile/lib/http_profile.dart.

Fix direction

Treat package:name/rest as a path mirror: the target is a file whose path ends in name/lib/rest. Dart packages sit in a directory named after the package by convention (pkgs/http_profile/), so no pubspec parsing is needed, the same spirit as the JS/TS alias mirror in #3589. dart: stays external.

The 5 false positives here are a separate, cross-language issue: an import written inside a /// doc comment is captured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing engine

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions