提交 45c4f228 编写于 作者: M Matt Bierner

Fixing more issues related to #81574

上级 8e944be1
......@@ -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
) {
......
......@@ -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
......
......@@ -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,
......
......@@ -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<string, string, IAction>(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 => {
......
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册