I've searched open issues for similar requests
Is your feature request related to a problem? Please describe.
When integrating mason.nvim with other plugins or editor configurations, there are cases where it is useful to know which mason registry package provides a given executable.
This is conceptually similar to the pacman -Qo command in Arch Linux and other package managers, which provides a lookup from an executable to the package that provides it.
At the moment, mason.nvim does not expose a public API to query this information directly.
Describe the solution you'd like
I would like to see a public API that allows us to determine which mason registry package provides a given executable.
The exact shape of the solution is flexible; for example, it could be exposed as a lookup table derived from registry data, or as a function that returns the corresponding package name for a given executable.
Describe potential alternatives you've considered
As potential alternatives, there are approaches such as:
- maintaining a mapping between executables and packages on the plugin or editor configuration side
- building such a mapping by traversing the registry using the existing public APIs
The latter is already technically possible today. However, it requires the same logic to be reimplemented in each downstream project.
In addition, this approach assumes a sufficient understanding of mason’s APIs and the registry specifications, which may not be obvious to all users.
Additional context
This proposal aims to organize information that already exists in the mason registry and to provide a way to look up the relationship between executables and packages.
This approach would make it easier for downstream projects to implement more consistent and maintainable integrations without requiring deep familiarity with mason.nvim’s APIs or registry specifications.
If this direction sounds reasonable, I would be happy to submit a pull request.
I've searched open issues for similar requests
Is your feature request related to a problem? Please describe.
When integrating mason.nvim with other plugins or editor configurations, there are cases where it is useful to know which mason registry package provides a given executable.
This is conceptually similar to the
pacman -Qocommand in Arch Linux and other package managers, which provides a lookup from an executable to the package that provides it.At the moment, mason.nvim does not expose a public API to query this information directly.
Describe the solution you'd like
I would like to see a public API that allows us to determine which mason registry package provides a given executable.
The exact shape of the solution is flexible; for example, it could be exposed as a lookup table derived from registry data, or as a function that returns the corresponding package name for a given executable.
Describe potential alternatives you've considered
As potential alternatives, there are approaches such as:
The latter is already technically possible today. However, it requires the same logic to be reimplemented in each downstream project.
In addition, this approach assumes a sufficient understanding of mason’s APIs and the registry specifications, which may not be obvious to all users.
Additional context
This proposal aims to organize information that already exists in the mason registry and to provide a way to look up the relationship between executables and packages.
This approach would make it easier for downstream projects to implement more consistent and maintainable integrations without requiring deep familiarity with mason.nvim’s APIs or registry specifications.
If this direction sounds reasonable, I would be happy to submit a pull request.