mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Add more to strict nulls (#11871)
* add more to strict nulls * maintain error handling properly * fix lint
This commit is contained in:
@@ -13,15 +13,17 @@ const languageRegistry = Registry.as<ILanguageAssociationRegistry>(ILanguageAsso
|
||||
|
||||
export function doHandleUpgrade(editor?: EditorInput): EditorInput | undefined {
|
||||
if (editor instanceof UntitledTextEditorInput || editor instanceof FileEditorInput) {
|
||||
let language: string;
|
||||
let language: string | undefined;
|
||||
if (editor instanceof UntitledTextEditorInput) {
|
||||
language = editor.getMode();
|
||||
} else {
|
||||
editor.getPreferredMode();
|
||||
language = editor.getPreferredMode();
|
||||
}
|
||||
const association = languageRegistry.getAssociationForLanguage(language);
|
||||
if (association && association.syncConvertinput) {
|
||||
return association.syncConvertinput(editor);
|
||||
if (language) {
|
||||
const association = languageRegistry.getAssociationForLanguage(language);
|
||||
if (association && association.syncConvertinput) {
|
||||
return association.syncConvertinput(editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
return editor;
|
||||
|
||||
Reference in New Issue
Block a user