提交 63cca55c 编写于 作者: J Johannes Rieken

only show picker when there is more than one formatter

上级 50dfb542
......@@ -105,12 +105,11 @@ export abstract class FormattingConflicts {
}
static async select<T extends (DocumentFormattingEditProvider | DocumentRangeFormattingEditProvider)>(formatter: T[], document: ITextModel, mode: FormattingMode): Promise<T | undefined> {
if (formatter.length === 0) {
return undefined;
}
const { value: selector } = FormattingConflicts._selectors.iterator().next();
if (selector) {
return await selector(formatter, document, mode);
if (formatter.length > 1) {
const { value: selector } = FormattingConflicts._selectors.iterator().next();
if (selector) {
return await selector(formatter, document, mode);
}
}
return formatter[0];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册