p-doom/crowd-code-dataset-0.2 huggingface dataset:
[tab] src/extension.ts (typescript)
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

	console.log('Crowd Pilot extension activated');

	// 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<string[]>('commandsToSkipShell', []);
	if (!commandsToSkipShell.includes('crowd-pilot.testRun')) {
		commandsToSkipShell.push('crowd-pilot.testRun');
		config.update('commandsToSkipShell', commandsToSkipShell, vscode.ConfigurationTarget.Global);
		console.log('Added testRun to commandsToSkipShell');
	}

	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
export function deactivate() {}
[content] src/extension.ts (typescript)
		const updated = [...commandsToSkipShell, 'crowd-pilot.testRun'];
		config.update('commandsToSkipShell', updated, vscode.ConfigurationTarget.Global, false)
			.then(() => {
				console.log('[Crowd Pilot] Successfully updated commandsToSkipShell');
				// Verify it was set
				const verifyConfig = vscode.workspace.getConfiguration('terminal.integrated');
				const verify = verifyConfig.get<string[]>('commandsToSkipShell', []);
				console.log('[Crowd Pilot] Verified commandsToSkipShell:', JSON.stringify(verify));
				if (!verify.includes('crowd-pilot.testRun')) {
					console.error('[Crowd Pilot] ERROR: Configuration update did not persist!');
				}
			})
			.catch((err) => {
				console.error('[Crowd Pilot] ERROR updating commandsToSkipShell:', err);
			});
	} else {
		console.log('[Crowd Pilot] testRun already in commandsToSkipShell');
[content] src/extension.ts (typescript)
		commandsToSkipShell.push('crowd-pilot.testRun');
		config.update('commandsToSkipShell', commandsToSkipShell, vscode.ConfigurationTarget.Global);
		console.log('Added testRun to commandsToSkipShell');
[content] src/extension.ts (typescript)
	// Diagnostic command to check keybinding configuration
	const checkConfig = vscode.commands.registerCommand('crowd-pilot.checkConfig', () => {
		const config = vscode.workspace.getConfiguration('terminal.integrated');
		const commandsToSkipShell = config.get<string[]>('commandsToSkipShell', []);
		const hasCommand = commandsToSkipShell.includes('crowd-pilot.testRun');
		
		const message = `commandsToSkipShell: ${JSON.stringify(commandsToSkipShell)}
` +
			`Contains 'crowd-pilot.testRun': ${hasCommand}`;
		
		console.log('[Crowd Pilot] Config check:', message);
		vscode.window.showInformationMessage(message, { modal: true });
	});
[content] src/extension.ts (typescript)
		const updated = [...commandsToSkipShell, 'crowd-pilot.testRun'];
		config.update('commandsToSkipShell', updated, vscode.ConfigurationTarget.Global, false)
			.then(() => {
				console.log('[Crowd Pilot] Successfully updated commandsToSkipShell');
				// Verify it was set
				const verifyConfig = vscode.workspace.getConfiguration('terminal.integrated');
				const verify = verifyConfig.get<string[]>('commandsToSkipShell', []);
				console.log('[Crowd Pilot] Verified commandsToSkipShell:', JSON.stringify(verify));
				if (!verify.includes('crowd-pilot.testRun')) {
					console.error('[Crowd Pilot] ERROR: Configuration update did not persist!');
				}
			}, (err: unknown) => {
				console.error('[Crowd Pilot] ERROR updating commandsToSkipShell:', err);
			});
	} else {
		console.log('[Crowd Pilot] testRun already in commandsToSkipShell');
[tab] package.json (json)
{
  "name": "crowd-pilot",
  "displayName": "crowd-pilot-extension",
  "description": "Teaching language models to code like humans.",
  "version": "0.0.1",
  "engines": {
    "vscode": "^1.99.3"
  },
  "categories": [
    "Other"
  ],
  "activationEvents": [],
  "main": "./out/extension.js",
  "contributes": {
    "commands": [
      {
        "command": "crowd-pilot.testRun",
        "title": "Test Run"
      },
      {
        "command": "crowd-pilot.checkConfig",
        "title": "Check Keybinding Config"
      }
    ],
    "keybindings": [
      {
        "command": "crowd-pilot.testRun",
        "key": "tab",
        "mac": "tab",
        "when": "editorTextFocus || terminalFocus"
      }
    ]
  },
  "scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "watch": "tsc -watch -p ./",
    "pretest": "npm run compile && npm run lint",
    "lint": "eslint src",
    "test": "vscode-test"
  },
  "devDependencies": {
    "@types/vscode": "^1.105.0",
    "@types/mocha": "^10.0.10",
    "@types/node": "22.x",
    "@typescript-eslint/eslint-plugin": "^8.45.0",
    "@typescript-eslint/parser": "^8.45.0",
    "eslint": "^9.36.0",
    "typescript": "^5.9.3",
    "@vscode/test-cli": "^0.0.11",
    "@vscode/test-electron": "^2.5.2"
  }
}
[content] src/extension.ts (typescript)
		// Log context information
		const activeEditor = vscode.window.activeTextEditor;
		const activeTerminal = vscode.window.activeTerminal;
		const contextInfo = {
			hasActiveEditor: !!activeEditor,
			hasActiveTerminal: !!activeTerminal,
			activeTerminalName: activeTerminal?.name,
			terminalCount: vscode.window.terminals.length,
		};
		console.log('[Crowd Pilot] testRun command executed', JSON.stringify(contextInfo));
[content] src/extension.ts (typescript)
	// Diagnostic command to check keybinding configuration and context
	const checkConfig = vscode.commands.registerCommand('crowd-pilot.checkConfig', () => {
		const config = vscode.workspace.getConfiguration('terminal.integrated');
		const commandsToSkipShell = config.get<string[]>('commandsToSkipShell', []);
		const hasCommand = commandsToSkipShell.includes('crowd-pilot.testRun');
		
		const activeEditor = vscode.window.activeTextEditor;
		const activeTerminal = vscode.window.activeTerminal;
		
		const message = `commandsToSkipShell: ${JSON.stringify(commandsToSkipShell)}
` +
			`Contains 'crowd-pilot.testRun': ${hasCommand}
` +
			`Active Editor: ${activeEditor ? 'Yes' : 'No'}
` +
			`Active Terminal: ${activeTerminal ? activeTerminal.name : 'No'}
` +
			`Terminal Count: ${vscode.window.terminals.length}`;
		
		console.log('[Crowd Pilot] Config check:', message);
		vscode.window.showInformationMessage(message, { modal: true });
	});
[content] src/extension.ts (typescript)
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

	console.log('Crowd Pilot extension activated');

	// 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<string[]>('commandsToSkipShell', []);
	if (!commandsToSkipShell.includes('crowd-pilot.testRun')) {
		commandsToSkipShell.push('crowd-pilot.testRun');
		config.update('commandsToSkipShell', commandsToSkipShell, vscode.ConfigurationTarget.Global);
		console.log('Added testRun to commandsToSkipShell');
	}

	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
export function deactivate() {}