2026-03-24 13:40:29 +00:00

34 lines
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.activate = activate;
exports.deactivate = deactivate;
const vscode = require("vscode");
const node_1 = require("vscode-languageclient/node");
let client;
function activate(context) {
const cfg = vscode.workspace.getConfiguration("prometeuPbs");
const serverPath = cfg.get("serverPath");
if (!serverPath) {
vscode.window.showErrorMessage("Prometeu PBS: configure 'prometeuPbs.serverPath' com o caminho do bin prometeu-lsp.");
return;
}
const serverOptions = {
command: serverPath,
args: []
};
const clientOptions = {
documentSelector: [{ scheme: "file", language: "pbs" }]
};
client = new node_1.LanguageClient("prometeuPbsLsp", "Prometeu PBS LSP", serverOptions, clientOptions);
// ✅ O client é “parável” no deactivate, não o start() Promise
context.subscriptions.push({
dispose: () => {
void client?.stop();
}
});
void client.start();
}
function deactivate() {
return client?.stop();
}
//# sourceMappingURL=extension.js.map