提交 9fc9a728 编写于 作者: I isidor

better adapter picking when multiple adapters registered for same language

fixes #41835
上级 c63c92b8
......@@ -403,6 +403,7 @@ export class ConfigurationManager implements IConfigurationManager {
}
const editor = this.editorService.getActiveEditor();
let candidates: Adapter[];
if (editor) {
const codeEditor = editor.getControl();
if (isCodeEditor(codeEditor)) {
......@@ -412,10 +413,16 @@ export class ConfigurationManager implements IConfigurationManager {
if (adapters.length === 1) {
return TPromise.as(adapters[0]);
}
if (adapters.length > 1) {
candidates = adapters;
}
}
}
return this.quickOpenService.pick([...this.adapters.filter(a => a.hasInitialConfiguration() || a.hasConfigurationProvider), { label: 'More...', separator: { border: true } }], { placeHolder: nls.localize('selectDebug', "Select Environment") })
if (!candidates) {
candidates = this.adapters.filter(a => a.hasInitialConfiguration() || a.hasConfigurationProvider);
}
return this.quickOpenService.pick([...candidates, { label: 'More...', separator: { border: true } }], { placeHolder: nls.localize('selectDebug', "Select Environment") })
.then(picked => {
if (picked instanceof Adapter) {
return picked;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册