Files
sci-gui-agent-benchmark/vscodeEvalExtension/src/extension.ts
2024-01-12 16:14:41 +08:00

33 lines
1.4 KiB
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';
import * as fs from 'fs-extra';
// 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) {
// 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
let OpenProject = vscode.commands.registerCommand('eval.OpenProject', () => {
if (vscode.workspace.workspaceFolders) {
fs.writeFileSync("/home/user/OpenProject.txt", vscode.workspace.workspaceFolders[0].name);
} else {
fs.writeFileSync("/home/user/OpenProject.txt", "");
}
});
let GetColorTheme = vscode.commands.registerCommand('eval.GetColorTheme', () => {
fs.writeFileSync("/home/user/GetColorTheme.txt", String(vscode.window.activeColorTheme.kind)); // ==2
});
let GetBreakPoint = vscode.commands.registerCommand('eval.GetBreakPoint', () => {
fs.writeFileSync("/home/user/GetBreakPoint.txt", String(vscode.debug.breakpoints.length)); // ==1
});
context.subscriptions.push(OpenProject, GetColorTheme, GetBreakPoint);
}
// This method is called when your extension is deactivated
export function deactivate() {}