mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

Sub-packages

Open williamboman opened this issue 3 years ago • 2 comments

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

williamboman avatar Sep 07 '22 17:09 williamboman

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()

znd4 avatar Jun 09 '23 18:06 znd4

Hello, I would to add styled components should I follow the same method in #166 Prettierd plugins

shubham-cpp avatar Dec 31 '23 04:12 shubham-cpp