[tab] out/extension.js (javascript)
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.activate = activate;
exports.deactivate = deactivate;
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
const vscode = __importStar(require("vscode"));
// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
function activate(context) {
    // Use the console to output diagnostic information (console.log) and errors (console.error)
    // This line of code will only be executed once when your extension is activated
    console.log('Congratulations, your extension "crowd-pilot" is now active!');
    // Configure terminal to allow tab keybinding to work
    // This makes the command skip the shell so VS Code can intercept tab in terminals
    const config = vscode.workspace.getConfiguration('terminal.integrated');
    const commandsToSkipShell = config.get('commandsToSkipShell', []);
    if (!commandsToSkipShell.includes('crowd-pilot.testRun')) {
        commandsToSkipShell.push('crowd-pilot.testRun');
        config.update('commandsToSkipShell', commandsToSkipShell, vscode.ConfigurationTarget.Global);
    }
    // The command has been defined in the package.json file
    // Now provide the implementation of the command with registerCommand
    // The commandId parameter must match the command field in package.json
    const disposable = vscode.commands.registerCommand('crowd-pilot.helloWorld', () => {
        // The code you place here will be executed every time your command is executed
        // Display a message box to the user
        vscode.window.showInformationMessage('Hello World from crowd-pilot-extension!');
    });
    context.subscriptions.push(disposable);
    const testRun = vscode.commands.registerCommand('crowd-pilot.testRun', async () => {
        const editor = vscode.window.activeTextEditor;
        const doc = editor.document;
        const term = vscode.window.terminals[0] ?? vscode.window.createTerminal('Test');
        const git = vscode.extensions.getExtension('vscode.git')?.exports?.getAPI(1);
        const repo = git?.repositories?.[0];
        // Emit a few actions:
        await vscode.window.showTextDocument(doc);
        editor.selections = [new vscode.Selection(0, 0, 0, 0)];
        await editor.edit(e => e.insert(new vscode.Position(0, 0), 'hello world
'));
        term.show();
        term.sendText('echo VSCode test');
        //await repo?.pull();
        vscode.window.showInformationMessage('All actions emitted');
    });
    context.subscriptions.push(testRun);
}
// This method is called when your extension is deactivated
function deactivate() { }
//# sourceMappingURL=extension.js.map