fix serialization error
This commit is contained in:
parent
0baba5e51e
commit
46877c9abc
3 changed files with 6 additions and 7 deletions
|
@ -204,10 +204,9 @@ export function registerTerminalActions() {
|
|||
});
|
||||
}
|
||||
async run(accessor: ServicesAccessor) {
|
||||
const terminalService = accessor.get(ITerminalService);
|
||||
const editorService = accessor.get(IEditorService);
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const input = TerminalEditorInput.copy(terminalService, instantiationService);
|
||||
const input = TerminalEditorInput.copy(instantiationService);
|
||||
await editorService.openEditor(input, { pinned: true, forceReload: true });
|
||||
}
|
||||
});
|
||||
|
|
|
@ -75,6 +75,6 @@ export class TerminalInputSerializer implements IEditorInputSerializer {
|
|||
}
|
||||
|
||||
public deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): TerminalEditorInput {
|
||||
throw new Error('not implemented');
|
||||
return TerminalEditorInput.copy(instantiationService);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,14 +27,14 @@ export class TerminalEditorInput extends EditorInput {
|
|||
}
|
||||
|
||||
constructor(
|
||||
instance: ITerminalInstance
|
||||
@ITerminalService terminalService: ITerminalService
|
||||
) {
|
||||
super();
|
||||
this._terminalInstance = instance;
|
||||
this._terminalInstance = terminalService.createTerminal();
|
||||
}
|
||||
|
||||
static copy(terminalService: ITerminalService, instantiationService: IInstantiationService): TerminalEditorInput {
|
||||
return new TerminalEditorInput(terminalService.createInstance({}));
|
||||
static copy(instantiationService: IInstantiationService): TerminalEditorInput {
|
||||
return instantiationService.createInstance(TerminalEditorInput);
|
||||
}
|
||||
|
||||
override getName() {
|
||||
|
|
Loading…
Reference in a new issue