2024-08-30 13:25:59 -07:00

37 lines
1.1 KiB
TypeScript

import * as vscode from 'vscode';
async function copySyntaxInLightLogic(): Promise<any> {
try {
// Get the current configuration
const config = vscode.workspace.getConfiguration();
// Get the current color theme
const currentTheme = config.get("workbench.colorTheme");
// Set the color theme to "Default Light+"
await config.update(
"workbench.colorTheme",
"Default Light Modern",
vscode.ConfigurationTarget.Global
);
// Copy Selected Text
await vscode.commands.executeCommand(
"editor.action.clipboardCopyAction"
);
// Show success message
vscode.window.showInformationMessage("Text copied in Light Mode");
// Switch back to dark theme
await config.update(
"workbench.colorTheme",
currentTheme,
vscode.ConfigurationTarget.Global
);
} catch (error) {
vscode.window.showErrorMessage(`Error: ${error}`);
}
}
export const copySyntaxInLight = () => copySyntaxInLightLogic();