From 45c4f228944953e310b9d8ddc2c4b2fd35e26b21 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 4 Oct 2019 17:56:41 -0700 Subject: [PATCH] Fixing more issues related to #81574 --- src/vs/workbench/browser/parts/editor/editorWidgets.ts | 2 +- src/vs/workbench/common/editor/untitledEditorInput.ts | 4 ++-- src/vs/workbench/common/editor/untitledEditorModel.ts | 4 ++-- src/vs/workbench/contrib/files/browser/views/emptyView.ts | 6 +++--- .../services/untitled/common/untitledEditorService.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorWidgets.ts b/src/vs/workbench/browser/parts/editor/editorWidgets.ts index 1588d1a9341..1a311045ad9 100644 --- a/src/vs/workbench/browser/parts/editor/editorWidgets.ts +++ b/src/vs/workbench/browser/parts/editor/editorWidgets.ts @@ -31,7 +31,7 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget { constructor( private editor: ICodeEditor, private label: string, - keyBindingAction: string, + keyBindingAction: string | null, @IKeybindingService keybindingService: IKeybindingService, @IThemeService private readonly themeService: IThemeService ) { diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 1ed96be6723..f9f8962e62d 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -36,8 +36,8 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport private readonly resource: URI, private readonly _hasAssociatedFilePath: boolean, private preferredMode: string, - private readonly initialValue: string, - private preferredEncoding: string, + private readonly initialValue: string | undefined, + private preferredEncoding: string | undefined, @IInstantiationService private readonly instantiationService: IInstantiationService, @ITextFileService private readonly textFileService: ITextFileService, @ILabelService private readonly labelService: ILabelService diff --git a/src/vs/workbench/common/editor/untitledEditorModel.ts b/src/vs/workbench/common/editor/untitledEditorModel.ts index 3c6570c29a1..cc609638996 100644 --- a/src/vs/workbench/common/editor/untitledEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledEditorModel.ts @@ -39,8 +39,8 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin private readonly preferredMode: string, private readonly resource: URI, private _hasAssociatedFilePath: boolean, - private readonly initialValue: string, - private preferredEncoding: string, + private readonly initialValue: string | undefined, + private preferredEncoding: string | undefined, @IModeService modeService: IModeService, @IModelService modelService: IModelService, @IBackupFileService private readonly backupFileService: IBackupFileService, diff --git a/src/vs/workbench/contrib/files/browser/views/emptyView.ts b/src/vs/workbench/contrib/files/browser/views/emptyView.ts index 8b54ec0abe8..c6954daaa0c 100644 --- a/src/vs/workbench/contrib/files/browser/views/emptyView.ts +++ b/src/vs/workbench/contrib/files/browser/views/emptyView.ts @@ -6,7 +6,6 @@ import * as nls from 'vs/nls'; import * as errors from 'vs/base/common/errors'; import * as DOM from 'vs/base/browser/dom'; -import { IAction } from 'vs/base/common/actions'; import { Button } from 'vs/base/browser/ui/button/button'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -84,8 +83,9 @@ export class EmptyView extends ViewletPanel { if (!this.actionRunner) { return; } - const actionClass = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? AddRootFolderAction : OpenFolderAction; - const action = this.instantiationService.createInstance(actionClass, actionClass.ID, actionClass.LABEL); + const action = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE + ? this.instantiationService.createInstance(AddRootFolderAction, AddRootFolderAction.ID, AddRootFolderAction.LABEL) + : this.instantiationService.createInstance(OpenFolderAction, OpenFolderAction.ID, OpenFolderAction.LABEL); this.actionRunner.run(action).then(() => { action.dispose(); }, err => { diff --git a/src/vs/workbench/services/untitled/common/untitledEditorService.ts b/src/vs/workbench/services/untitled/common/untitledEditorService.ts index 8800aded809..2e9781c71c9 100644 --- a/src/vs/workbench/services/untitled/common/untitledEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledEditorService.ts @@ -243,7 +243,7 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor } } - const input = this.instantiationService.createInstance(UntitledEditorInput, untitledResource, hasAssociatedFilePath, mode, initialValue, encoding); + const input = this.instantiationService.createInstance(UntitledEditorInput, untitledResource, !!hasAssociatedFilePath, mode, initialValue, encoding); const contentListener = input.onDidModelChangeContent(() => this._onDidChangeContent.fire(untitledResource)); const dirtyListener = input.onDidChangeDirty(() => this._onDidChangeDirty.fire(untitledResource)); -- GitLab