This commit is contained in:
2024-08-30 13:25:59 -07:00
parent ed2cd40f59
commit 24e700065e
5 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,37 @@
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();

View File

@ -1,6 +1,7 @@
// 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 copyHelper from './copyHelper';
import * as kanbanHelper from './kanbanHelper';
import * as markdownHelper from './markdownHelper';
import * as promiseLinesHelper from './promiseLinesHelper';
@ -37,6 +38,7 @@ export async function activate(extensionContext: vscode.ExtensionContext) {
// context.subscriptions.push(disposable);
const commands = [
vscode.commands.registerCommand("copyHelper.copySyntaxInLight", copyHelper.copySyntaxInLight),
vscode.commands.registerCommand("kanban.refreshBoth", () => { kanbanHelper.refreshBoth(extensionContext); }),
vscode.commands.registerCommand("kanban.refreshSidebar", refreshSidebar),
vscode.commands.registerCommand("kanban.refreshWebView", () => { refreshWebView(extensionContext); }),