mason.nvim
mason.nvim copied to clipboard
Sub-packages
Some packages have extensions/plugins that need to be installed in the same location as the main package. This is currently not possible in Mason as packages are installed in an isolated manner. By introducing the concept of sub-packages we'd be able to enable installing such extension packages. There are a few considerations to be made (off the top of my head):
- DX: In which interfaces should sub-packages surface? Should you be able to install a sub-package if the main package is not yet installed? Or are these only unlocked once the main package is installed?
- How to handle management of sub-packages.
- How to handle updating the main package - in which fashion should sub-packages be carried over to the new installation?
- https://github.com/williamboman/mason.nvim/issues/161
- https://github.com/williamboman/mason.nvim/issues/359
- https://github.com/williamboman/mason.nvim/issues/383
- https://github.com/williamboman/mason.nvim/issues/179
workaround snippet (requires plenary.nvim):
local function mason_package_path(package)
local path = vim.fn.resolve(vim.fn.stdpath("data") .. "/mason/packages/" .. package)
return path
end
-- depends on package manager / language
local command = "./venv/bin/pip"
local args = { "install", "pylsp-rope", "python-lsp-ruff", "pyls-isort", "python-lsp-black" }
require("plenary.job")
:new({
command = command,
args = args,
cwd = mason_package_path("python-lsp-server"),
})
:start()
Hello, I would to add styled components should I follow the same method in #166 Prettierd plugins