summaryrefslogtreecommitdiff
path: root/.config/coc/extensions/node_modules/coc-go/lib/utils/playground.js
blob: 9fef7962f5afd41dcb9065d5bc4b64f774acbea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.openPlayground = void 0;
const coc_nvim_1 = require("coc.nvim");
const tools_1 = require("./tools");
const binaries_1 = require("../binaries");
async function openPlayground(document) {
    return runGoplay(document.getText());
}
exports.openPlayground = openPlayground;
async function runGoplay(code) {
    try {
        const stdout = await (0, tools_1.execTool)(binaries_1.GOPLAY, ['-'], code);
        coc_nvim_1.window.showMessage(stdout);
        return true;
    }
    catch (err) {
        coc_nvim_1.window.showMessage(`${err}`, "error");
        return false;
    }
}
//# sourceMappingURL=playground.js.map