aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry/index/php-debug-adapter/init.lua
blob: 7aafd17d12386a452eba84e891678fbdbc54fd80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local Pkg = require "mason-core.package"
local _ = require "mason-core.functional"
local github = require "mason-core.managers.github"
local path = require "mason-core.path"

return Pkg.new {
    name = "php-debug-adapter",
    desc = [[PHP Debug Adapter 🐞⛔]],
    homepage = "https://github.com/xdebug/vscode-php-debug",
    languages = { Pkg.Lang.PHP },
    categories = { Pkg.Cat.DAP },
    ---@async
    ---@param ctx InstallContext
    install = function(ctx)
        github
            .unzip_release_file({
                repo = "xdebug/vscode-php-debug",
                asset_file = _.compose(_.format "php-debug-%s.vsix", _.gsub("^v", "")),
            })
            .with_receipt()
        ctx.fs:rmrf(path.concat { "extension", "images" })
        ctx:link_bin(
            "php-debug-adapter",
            ctx:write_node_exec_wrapper("php-debug-adapter", path.concat { "extension", "out", "phpDebug.js" })
        )
    end,
}