From a5f14eabd00804f94b4d930f1cb698ce1284fbff Mon Sep 17 00:00:00 2001 From: chriswang521 Date: Wed, 29 May 2024 16:50:59 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E7=A7=BB=E9=99=A4webview=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=9A=84=E5=87=A0=E4=B8=AA=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webview/browser/webview.contribution.ts | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/vs/workbench/contrib/webview/browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/browser/webview.contribution.ts index 6fde8271..fc693b9a 100644 --- a/src/vs/workbench/contrib/webview/browser/webview.contribution.ts +++ b/src/vs/workbench/contrib/webview/browser/webview.contribution.ts @@ -6,9 +6,9 @@ import { getActiveElement } from 'vs/base/browser/dom'; import { MultiCommand, RedoCommand, SelectAllCommand, UndoCommand } from 'vs/editor/browser/editorExtensions'; import { CopyAction, CutAction, PasteAction } from 'vs/editor/contrib/clipboard/browser/clipboard'; -import * as nls from 'vs/nls'; -import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +// import * as nls from 'vs/nls'; +// import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; +// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IWebviewService, IWebview } from 'vs/workbench/contrib/webview/browser/webview'; import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -48,38 +48,38 @@ overrideCommandForWebview(CutAction, webview => webview.cut()); export const PreventDefaultContextMenuItemsContextKeyName = 'preventDefaultContextMenuItems'; -if (CutAction) { - MenuRegistry.appendMenuItem(MenuId.WebviewContext, { - command: { - id: CutAction.id, - title: nls.localize('cut', "Cut"), - }, - group: '5_cutcopypaste', - order: 1, - when: ContextKeyExpr.not(PreventDefaultContextMenuItemsContextKeyName), - }); -} +// if (CutAction) { +// MenuRegistry.appendMenuItem(MenuId.WebviewContext, { +// command: { +// id: CutAction.id, +// title: nls.localize('cut', "Cut"), +// }, +// group: '5_cutcopypaste', +// order: 1, +// when: ContextKeyExpr.not(PreventDefaultContextMenuItemsContextKeyName), +// }); +// } -if (CopyAction) { - MenuRegistry.appendMenuItem(MenuId.WebviewContext, { - command: { - id: CopyAction.id, - title: nls.localize('copy', "Copy"), - }, - group: '5_cutcopypaste', - order: 2, - when: ContextKeyExpr.not(PreventDefaultContextMenuItemsContextKeyName), - }); -} +// if (CopyAction) { +// MenuRegistry.appendMenuItem(MenuId.WebviewContext, { +// command: { +// id: CopyAction.id, +// title: nls.localize('copy', "Copy"), +// }, +// group: '5_cutcopypaste', +// order: 2, +// when: ContextKeyExpr.not(PreventDefaultContextMenuItemsContextKeyName), +// }); +// } -if (PasteAction) { - MenuRegistry.appendMenuItem(MenuId.WebviewContext, { - command: { - id: PasteAction.id, - title: nls.localize('paste', "Paste"), - }, - group: '5_cutcopypaste', - order: 3, - when: ContextKeyExpr.not(PreventDefaultContextMenuItemsContextKeyName), - }); -} +// if (PasteAction) { +// MenuRegistry.appendMenuItem(MenuId.WebviewContext, { +// command: { +// id: PasteAction.id, +// title: nls.localize('paste', "Paste"), +// }, +// group: '5_cutcopypaste', +// order: 3, +// when: ContextKeyExpr.not(PreventDefaultContextMenuItemsContextKeyName), +// }); +// }