editorReplacer -> editorOverride (#16041)

* editorReplacer -> editorOverride

* Update lifecycle phsae

* add back input factories

* Add comment

* add back tests

* comments

* fix log

* comments
This commit is contained in:
Charles Gagnon
2021-07-09 08:46:50 -07:00
committed by GitHub
parent 7ba0e49673
commit 8f202d91b6
19 changed files with 253 additions and 509 deletions

View File

@@ -21,6 +21,10 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories);
export class NotebookEditorInputAssociation implements ILanguageAssociation {
/**
* The language IDs that are associated with Notebooks. These are case sensitive for comparing with what's
* registered in the ModeService registry.
*/
static readonly languages = [NotebookLanguage.Notebook, NotebookLanguage.Ipynb];
constructor(@IInstantiationService private readonly instantiationService: IInstantiationService, @IConfigurationService private readonly configurationService: IConfigurationService) { }
@@ -40,6 +44,10 @@ export class NotebookEditorInputAssociation implements ILanguageAssociation {
return undefined;
}
syncConvertinput(activeEditor: IEditorInput): NotebookInput | DiffNotebookInput | undefined {
return this.convertInput(activeEditor);
}
createBase(activeEditor: NotebookInput): IEditorInput {
return activeEditor.textInput;
}
@@ -65,7 +73,7 @@ export class FileNoteBookEditorInputSerializer implements IEditorInputSerializer
}
}
export class UntitledNoteBookEditorInputFactory implements IEditorInputSerializer {
export class UntitledNotebookEditorInputSerializer implements IEditorInputSerializer {
serialize(editorInput: UntitledNotebookInput): string {
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
if (factory) {