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:
Anthony Dresser
2020-03-11 12:42:13 -07:00
committed by GitHub
parent edd396f0fe
commit dbc20c1f67
9 changed files with 156 additions and 24 deletions

View File

@@ -41,7 +41,7 @@ export async function setMode(accessor: ServicesAccessor, modeSupport: IModeSupp
if (newInputCreator) { // if we know how to handle the new language, tranform the input and replace the editor (e.x notebook, sql, etc)
const newInput = newInputCreator.convertInput(input || activeEditor);
if (newInput) { // the factory will return undefined if it doesn't know how to handle the input
await editorService.replaceEditors([{ editor: activeEditor, replacement: newInput }], activeControl.group);
await editorService.replaceEditors([{ editor: activeEditor, replacement: await newInput }], activeControl.group);
}
} else if (oldInputCreator) { // if we don't know handle to handle the new language but we know how to handle the current language, replace the editor with the reverted input (e.x sql -> text)
await editorService.replaceEditors([{ editor: activeEditor, replacement: input }], activeControl.group);