Open
Description
There seems to be no such method yet
Currently devtools is jumping through a lot of hoops to do this. It looks for package configs from the library containing the main file of the current root isolate.
This is not always correct (the main file might be exported from an imported package)
Also finding the .dart_tool/package_config.json via the dtd protocol is also troublesome, given that it has limited file access (cannot reach files outside the IDE root, which is not guaranteed to contain the package config if the ide is scoped to only parts of a pub workspace.)
Here is the current code: