提交 1e663934 编写于 作者: J Johannes Rieken

💄

上级 21d9fa7c
......@@ -201,7 +201,7 @@ async function showFormatterPick(accessor: ServicesAccessor, model: ITextModel,
const overrides = { resource: model.uri, overrideIdentifier: model.getModeId() };
const defaultFormatter = configService.getValue<string>(DefaultFormatter.configName, overrides);
let autoFocusPick;
let defaultFormatterPick: IIndexedPick | undefined;
const picks = formatters.map((provider, index) => {
const isDefault = ExtensionIdentifier.equals(provider.extensionId, defaultFormatter);
......@@ -213,7 +213,7 @@ async function showFormatterPick(accessor: ServicesAccessor, model: ITextModel,
if (isDefault) {
// autofocus default pick
autoFocusPick = pick;
defaultFormatterPick = pick;
}
return pick;
......@@ -223,7 +223,12 @@ async function showFormatterPick(accessor: ServicesAccessor, model: ITextModel,
label: nls.localize('config', "Configure Default Formatter...")
};
const pick = await quickPickService.pick([...picks, { type: 'separator' }, configurePick], { placeHolder: nls.localize('format.placeHolder', "Select a formatter"), activeItem: autoFocusPick });
const pick = await quickPickService.pick([...picks, { type: 'separator' }, configurePick],
{
placeHolder: nls.localize('format.placeHolder', "Select a formatter"),
activeItem: defaultFormatterPick
}
);
if (!pick) {
// dismissed
return undefined;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册