Skip to content

Commit 51dc319

Browse files
committed
Move webview editor into own module
This splits the core `webview` element services from the `webview` editor services.
1 parent 5801561 commit 51dc319

17 files changed

Lines changed: 56 additions & 45 deletions

build/lib/i18n.resources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@
206206
"name": "vs/workbench/contrib/webview",
207207
"project": "vscode-workbench"
208208
},
209+
{
210+
"name": "vs/workbench/contrib/webviewPanel",
211+
"project": "vscode-workbench"
212+
},
209213
{
210214
"name": "vs/workbench/contrib/customEditor",
211215
"project": "vscode-workbench"

src/vs/workbench/api/browser/mainThreadCustomEditors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import { CustomDocumentBackupData } from 'vs/workbench/contrib/customEditor/brow
2929
import { ICustomEditorModel, ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor';
3030
import { CustomTextEditorModel } from 'vs/workbench/contrib/customEditor/common/customTextEditorModel';
3131
import { WebviewExtensionDescription } from 'vs/workbench/contrib/webview/browser/webview';
32-
import { WebviewInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput';
33-
import { IWebviewWorkbenchService } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
32+
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
33+
import { IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
3434
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
3535
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
3636
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';

src/vs/workbench/api/browser/mainThreadWebviewPanels.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { editorGroupToViewColumn, EditorViewColumn, viewColumnToEditorGroup } fr
1313
import { IEditorInput } from 'vs/workbench/common/editor';
1414
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
1515
import { WebviewIcons } from 'vs/workbench/contrib/webview/browser/webview';
16-
import { WebviewInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput';
17-
import { ICreateWebViewShowOptions, IWebviewWorkbenchService, WebviewInputOptions } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
16+
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
17+
import { ICreateWebViewShowOptions, IWebviewWorkbenchService, WebviewInputOptions } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
1818
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
1919
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
2020
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';

src/vs/workbench/api/browser/mainThreadWebviews.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
1515
import { IProductService } from 'vs/platform/product/common/productService';
1616
import * as extHostProtocol from 'vs/workbench/api/common/extHost.protocol';
1717
import { Webview, WebviewExtensionDescription, WebviewOverlay } from 'vs/workbench/contrib/webview/browser/webview';
18-
import { WebviewInputOptions } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
18+
import { WebviewInputOptions } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
1919

2020
export class MainThreadWebviews extends Disposable implements extHostProtocol.MainThreadWebviewsShape {
2121

src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } fr
1313
import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
1414
import { CustomEditorInputFactory } from 'vs/workbench/contrib/customEditor/browser/customEditorInputFactory';
1515
import { ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor';
16-
import { WebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewEditor';
16+
import { WebviewEditor } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditor';
1717
import { CustomEditorInput } from './customEditorInput';
1818
import { CustomEditorContribution, CustomEditorService } from './customEditors';
1919

src/vs/workbench/contrib/customEditor/browser/customEditorInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
1818
import { GroupIdentifier, IEditorInput, IRevertOptions, ISaveOptions, Verbosity } from 'vs/workbench/common/editor';
1919
import { ICustomEditorModel, ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor';
2020
import { IWebviewService, WebviewOverlay } from 'vs/workbench/contrib/webview/browser/webview';
21-
import { IWebviewWorkbenchService, LazilyResolvedWebviewEditorInput } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
21+
import { IWebviewWorkbenchService, LazilyResolvedWebviewEditorInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
2222
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
2323
import { AutoSaveMode, IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
2424

src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
99
import { IEditorInput } from 'vs/workbench/common/editor';
1010
import { CustomEditorInput } from 'vs/workbench/contrib/customEditor/browser/customEditorInput';
1111
import { IWebviewService, WebviewExtensionDescription, WebviewContentPurpose } from 'vs/workbench/contrib/webview/browser/webview';
12-
import { reviveWebviewExtensionDescription, SerializedWebview, WebviewEditorInputFactory, DeserializedWebview } from 'vs/workbench/contrib/webview/browser/webviewEditorInputFactory';
13-
import { IWebviewWorkbenchService, WebviewInputOptions } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
12+
import { reviveWebviewExtensionDescription, SerializedWebview, WebviewEditorInputFactory, DeserializedWebview } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInputFactory';
13+
import { IWebviewWorkbenchService, WebviewInputOptions } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
1414
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
1515

1616
export interface CustomDocumentBackupData {

src/vs/workbench/contrib/update/browser/releaseNotesEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
1818
import { IRequestService, asText } from 'vs/platform/request/common/request';
1919
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
2020
import { IProductService } from 'vs/platform/product/common/productService';
21-
import { IWebviewWorkbenchService } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
21+
import { IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
2222
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
23-
import { WebviewInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput';
23+
import { WebviewInput } from 'vs/workbench/contrib/webviewPanel/browser/webviewEditorInput';
2424
import { KeybindingParser } from 'vs/base/common/keybindingParser';
2525
import { CancellationToken } from 'vs/base/common/cancellation';
2626
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';

src/vs/workbench/contrib/webview/browser/baseWebviewElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
1515
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
1616
import { WebviewThemeDataProvider } from 'vs/workbench/contrib/webview/browser/themeing';
1717
import { WebviewContentOptions, WebviewExtensionDescription, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview';
18-
import { areWebviewInputOptionsEqual } from 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
18+
import { areWebviewInputOptionsEqual } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService';
1919
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2020

2121
export const enum WebviewMessageChannels {

src/vs/workbench/contrib/webview/browser/webview.contribution.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,7 @@
55

66
import { MultiCommand, RedoCommand, SelectAllCommand, UndoCommand } from 'vs/editor/browser/editorExtensions';
77
import { CopyAction, CutAction, PasteAction } from 'vs/editor/contrib/clipboard/clipboard';
8-
import { localize } from 'vs/nls';
9-
import { registerAction2 } from 'vs/platform/actions/common/actions';
10-
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
11-
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
12-
import { Registry } from 'vs/platform/registry/common/platform';
13-
import { EditorDescriptor, Extensions as EditorExtensions, IEditorRegistry } from 'vs/workbench/browser/editor';
14-
import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor';
158
import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/browser/webview';
16-
import { WebviewEditorInputFactory } from 'vs/workbench/contrib/webview/browser/webviewEditorInputFactory';
17-
import { HideWebViewEditorFindCommand, ReloadWebviewAction, ShowWebViewEditorFindWidgetAction, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand } from '../browser/webviewCommands';
18-
import { WebviewEditor } from './webviewEditor';
19-
import { WebviewInput } from './webviewEditorInput';
20-
import { IWebviewWorkbenchService, WebviewEditorService } from './webviewWorkbenchService';
21-
22-
(Registry.as<IEditorRegistry>(EditorExtensions.Editors)).registerEditor(EditorDescriptor.create(
23-
WebviewEditor,
24-
WebviewEditor.ID,
25-
localize('webview.editor.label', "webview editor")),
26-
[new SyncDescriptor(WebviewInput)]);
27-
28-
Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories).registerEditorInputFactory(
29-
WebviewEditorInputFactory.ID,
30-
WebviewEditorInputFactory);
31-
32-
registerSingleton(IWebviewWorkbenchService, WebviewEditorService, true);
33-
34-
registerAction2(ShowWebViewEditorFindWidgetAction);
35-
registerAction2(HideWebViewEditorFindCommand);
36-
registerAction2(WebViewEditorFindNextCommand);
37-
registerAction2(WebViewEditorFindPreviousCommand);
38-
registerAction2(ReloadWebviewAction);
399

4010

4111
const PRIORITY = 100;

0 commit comments

Comments
 (0)