mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
Query editor input titles (#9512)
* address untitled editor file name differences; remove feature for updating title for untitled to content * add tests for new methods * fix tests * fix up tests * remove unncessary await * revert changes to title for content
This commit is contained in:
@@ -20,8 +20,8 @@ export function doHandleUpgrade(editor?: EditorInput): EditorInput | undefined {
|
||||
editor.getPreferredMode();
|
||||
}
|
||||
const association = languageRegistry.getAssociationForLanguage(language);
|
||||
if (association) {
|
||||
return association.convertInput(editor);
|
||||
if (association && association.syncConvertinput) {
|
||||
return association.syncConvertinput(editor);
|
||||
}
|
||||
}
|
||||
return editor;
|
||||
|
||||
@@ -12,7 +12,12 @@ export type InputCreator = (servicesAccessor: ServicesAccessor, activeEditor: IE
|
||||
export type BaseInputCreator = (activeEditor: IEditorInput) => IEditorInput;
|
||||
|
||||
export interface ILanguageAssociation {
|
||||
convertInput(activeEditor: IEditorInput): EditorInput | undefined;
|
||||
convertInput(activeEditor: IEditorInput): Promise<EditorInput | undefined> | EditorInput | undefined;
|
||||
/**
|
||||
* Used for scenarios when we need to synchrounly create inputs, currently only for handling upgrades
|
||||
* and planned to be removed eventually
|
||||
*/
|
||||
syncConvertinput?(activeEditor: IEditorInput): EditorInput | undefined;
|
||||
createBase(activeEditor: IEditorInput): IEditorInput;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user