Skip to content

Commit 14f2123

Browse files
authored
fix: open with the only editor directly (microsoft#102660)
1 parent 2cf34ee commit 14f2123

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/vs/workbench/services/editor/common/editorOpenWith.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ export async function openEditorWith(
4949
return;
5050
}
5151

52-
const overrideToUse = typeof id === 'string' && allEditorOverrides.find(([_, entry]) => entry.id === id);
52+
let overrideToUse;
53+
if (typeof id === 'string') {
54+
overrideToUse = allEditorOverrides.find(([_, entry]) => entry.id === id);
55+
} else if (allEditorOverrides.length === 1) {
56+
overrideToUse = allEditorOverrides[0];
57+
}
5358
if (overrideToUse) {
5459
return overrideToUse[0].open(input, overrideOptions, group, OpenEditorContext.NEW_EDITOR)?.override;
5560
}

0 commit comments

Comments
 (0)