aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry/index/mockdebug/init.lua
blob: 4b539a7255d3db8bb47cd82ec98698a58a71603b (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
28
29
30
31
local Pkg = require "mason-core.package"
local github = require "mason-core.managers.github"
local git = require "mason-core.managers.git"
local path = require "mason-core.path"
local _ = require "mason-core.functional"
local Optional = require "mason-core.optional"

return Pkg.new {
    name = "mockdebug",
    desc = _.dedent [[
        Mock Debug simulates a debug adapter. It supports step, continue, breakpoints, exceptions, and variable access
        but it is not connected to any real debugger.
    ]],
    homepage = "https://github.com/microsoft/vscode-mock-debug",
    languages = {},
    categories = { Pkg.Cat.DAP },
    ---@async
    ---@param ctx InstallContext
    install = function(ctx)
        local source = github.tag { repo = "microsoft/vscode-mock-debug" }
        source.with_receipt()
        git.clone { "https://github.com/microsoft/vscode-mock-debug", version = Optional.of(source.tag) }
        ctx.spawn.npm { "install" }
        ctx.spawn.npm { "run", "compile" }
        ctx.spawn.npm { "install", "--production" }
        ctx:link_bin(
            "mock-debug-adapter",
            ctx:write_node_exec_wrapper("mock-debug-adapter", path.concat { "out", "debugAdapter.js" })
        )
    end,
}