Skip to content
Discussion options

You must be logged in to vote

Oh also, you should not write the receipt manually like that (except for ctx.receipt:with_primary_source()), the core installer takes care of the rest.

Packages are entirely isolated, so to install another pip package in the LSP environment you'll have to drop into the virtual environment of that package. Very hacky, untested, illustration of this:

local registry = require "mason-registry"
-- ...
    install = function(ctx)
        local pylsp = registry.get_package("python-lsp-server")
        assert(pylsp:is_installed(), "python-lsp-server is not installed")
        ctx.spawn[pylsp:get_install_path() .. "/venv/bin/python"] {
            "-m", "pip", "install", "python-lsp-black"

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@williamboman
Comment options

Answer selected by idanarye
@idanarye
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants