From 24e700065ea334f459f562941eeea7be5767ed13 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Fri, 30 Aug 2024 13:25:59 -0700 Subject: [PATCH] ## 1.7.0 --- type-script-helper/.gitignore | 3 ++- type-script-helper/README.md | 6 +++++ type-script-helper/package.json | 7 +++++- type-script-helper/src/copyHelper.ts | 37 ++++++++++++++++++++++++++++ type-script-helper/src/extension.ts | 2 ++ 5 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 type-script-helper/src/copyHelper.ts diff --git a/type-script-helper/.gitignore b/type-script-helper/.gitignore index 8384abe..2957cf3 100644 --- a/type-script-helper/.gitignore +++ b/type-script-helper/.gitignore @@ -3,4 +3,5 @@ *.vsix dist node_modules -out \ No newline at end of file +out +src/*.js* \ No newline at end of file diff --git a/type-script-helper/README.md b/type-script-helper/README.md index f60c44d..827dfd6 100644 --- a/type-script-helper/README.md +++ b/type-script-helper/README.md @@ -150,3 +150,9 @@ None ----------------------------------------------------------------------------------------------------------- - Wrap directory in quotes + +## 1.7.0 Fri Aug 30 2024 11:13:09 GMT-0700 (Mountain Standard Time) +----------------------------------------------------------------------------------------------------------- + +- Copy Syntax In Light Theme +- [Copy-Syntax-in-Light](https://github.com/Ahmed-Adel-Morsi/Copy-Syntax-in-Light) diff --git a/type-script-helper/package.json b/type-script-helper/package.json index 6ae07ca..90cff58 100644 --- a/type-script-helper/package.json +++ b/type-script-helper/package.json @@ -27,6 +27,11 @@ } }, "commands": [ + { + "category": "Helper", + "command": "copyHelper.copySyntaxInLight", + "title": "Copy Syntax In Light Theme" + }, { "category": "Helper", "command": "open-in-new-window.open", @@ -259,5 +264,5 @@ "webpack": "webpack --config ./build/node-extension.webpack.config.js", "watch": "concurrently \"rollup -c -w\" \"webpack --watch --config ./build/node-extension.webpack.config.js\"" }, - "version": "1.6.4" + "version": "1.7.0" } diff --git a/type-script-helper/src/copyHelper.ts b/type-script-helper/src/copyHelper.ts new file mode 100644 index 0000000..ab11830 --- /dev/null +++ b/type-script-helper/src/copyHelper.ts @@ -0,0 +1,37 @@ +import * as vscode from 'vscode'; + +async function copySyntaxInLightLogic(): Promise { + 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(); \ No newline at end of file diff --git a/type-script-helper/src/extension.ts b/type-script-helper/src/extension.ts index d06186f..c0dc2f4 100644 --- a/type-script-helper/src/extension.ts +++ b/type-script-helper/src/extension.ts @@ -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); }),