Package name of provided service


I’m using services in code-links, but I was wondering if there’s a way to discover which package is actually providing the service. It doesn’t seem to get passed to my function.

I anticipate having multiple providers that generate a link in the same area. For example I might have one plugin sees require('sub-atom') and links to the code in your node_modules, another might see that and link out to npm. If I have the package name that each provider came from I can provide preferences so that the user can favor one over the other when there are conflicts.

I hesitate to just require that the service pass its own name because there’s no way to enforce that it is consistent.


It was a specific design decision to make them “services” rather than “package hooks”. This way if you have a package that provides the foo service then packages that consume the foo service can just consume it and go, they don’t have to guess which package provides it.

See the discussion on this Issue for the full back-and-forth: