nvim/coc/extensions/node_modules/coc-go/lib/utils/playground.js

22 lines
696 B
JavaScript
Raw Normal View History

2021-03-09 22:18:08 +00:00
"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 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