Skip to content

Commit

Permalink
Create webview.web.contribution
Browse files Browse the repository at this point in the history
Fixes #106516

Creates an explicit contribution file for web. This makes sure we only don't register the `IWebviewService` twice. Not 100% sure this fixes the issue since I couldn't repo the original bug with our oss builds
  • Loading branch information
mjbvz committed Sep 11, 2020
1 parent 02e6fa2 commit cc899f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { WebviewEditorInputFactory } from 'vs/workbench/contrib/webview/browser/
import { HideWebViewEditorFindCommand, ReloadWebviewAction, ShowWebViewEditorFindWidgetAction, WebViewEditorFindNextCommand, WebViewEditorFindPreviousCommand } from '../browser/webviewCommands';
import { WebviewEditor } from './webviewEditor';
import { WebviewInput } from './webviewEditorInput';
import { WebviewService } from './webviewService';
import { IWebviewWorkbenchService, WebviewEditorService } from './webviewWorkbenchService';

(Registry.as<IEditorRegistry>(EditorExtensions.Editors)).registerEditor(EditorDescriptor.create(
Expand All @@ -30,7 +29,6 @@ Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactor
WebviewEditorInputFactory.ID,
WebviewEditorInputFactory);

registerSingleton(IWebviewService, WebviewService, true);
registerSingleton(IWebviewWorkbenchService, WebviewEditorService, true);

registerAction2(ShowWebViewEditorFindWidgetAction);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
import { WebviewService } from './webviewService';

registerSingleton(IWebviewService, WebviewService, true);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Lazy } from 'vs/base/common/lazy';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { isEqual } from 'vs/base/common/resources';
import { EditorActivation } from 'vs/platform/editor/common/editor';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { GroupIdentifier } from 'vs/workbench/common/editor';
import { IWebviewService, WebviewContentOptions, WebviewExtensionDescription, WebviewIcons, WebviewOptions, WebviewOverlay } from 'vs/workbench/contrib/webview/browser/webview';
Expand Down Expand Up @@ -312,5 +311,3 @@ export class WebviewEditorService implements IWebviewWorkbenchService {
}, options, extension);
}
}

registerSingleton(IWebviewWorkbenchService, WebviewEditorService, true);
3 changes: 1 addition & 2 deletions src/vs/workbench/workbench.web.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ import 'vs/workbench/contrib/preferences/browser/keyboardLayoutPicker';
import 'vs/workbench/contrib/debug/browser/extensionHostDebugService';

// Webview
import 'vs/workbench/contrib/webview/browser/webviewService';
import 'vs/workbench/contrib/webview/browser/webviewWorkbenchService';
import 'vs/workbench/contrib/webview/browser/webview.web.contribution';

// Terminal
import 'vs/workbench/contrib/terminal/browser/terminal.web.contribution';
Expand Down

0 comments on commit cc899f1

Please sign in to comment.