UNPKG

coc-sh

Version:
29 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.activate = void 0; const tslib_1 = require("tslib"); const path_1 = tslib_1.__importDefault(require("path")); const fs_1 = tslib_1.__importDefault(require("fs")); const coc_nvim_1 = require("coc.nvim"); async function activate(context) { const config = coc_nvim_1.workspace.getConfiguration().get('sh', {}); if (config.enable === false) { return; } const serverOptions = { command: (config.commandPath || require.resolve('bash-language-server/out/cli.js')), args: ['start'], transport: coc_nvim_1.TransportKind.stdio }; const clientOptions = { documentSelector: ['sh'] }; const client = new coc_nvim_1.LanguageClient('sh', 'bash-language-server', serverOptions, clientOptions); context.subscriptions.push(coc_nvim_1.services.registLanguageClient(client), coc_nvim_1.commands.registerCommand("sh.version", async () => { const rootDir = path_1.default.join(__dirname, '..'); const { version } = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(rootDir, 'package.json'), 'utf-8')); coc_nvim_1.window.showInformationMessage(`Version: ${version} [node: ${process.versions.node}]`); })); } exports.activate = activate; //# sourceMappingURL=extension.js.map