resolveInProcess method

String? resolveInProcess(
  1. String tool, {
  2. String? scope,
})

The registered name tool reaches when called from inside scope.

A bundle's own tools are registered as <bundleId>.<name> (platform spec 04 name isolation), and the bundle calls them by the name it declared: the id it runs under can be chosen at install, so it cannot write its own full name. Inside a bundle the short name is tried in that bundle's namespace first; the full name, and any tool outside the bundle, resolve as written. Null when nothing is registered under either.

Implementation

String? resolveInProcess(String tool, {String? scope}) {
  if (scope != null && scope.isNotEmpty) {
    final own = '$scope.$tool';
    if (_inProcess.containsKey(own)) return own;
  }
  return _inProcess.containsKey(tool) ? tool : null;
}