"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.openPlayground = openPlayground;
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());
}
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