|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 | 6 | import { getErrorMessage } from 'vs/base/common/errors';
|
7 |
| -import { Emitter } from 'vs/base/common/event'; |
| 7 | +import { Emitter, Event } from 'vs/base/common/event'; |
8 | 8 | import { parse } from 'vs/base/common/json';
|
9 | 9 | import { Disposable, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle';
|
10 | 10 | import * as network from 'vs/base/common/network';
|
@@ -46,6 +46,8 @@ import { ResourceSet } from 'vs/base/common/map';
|
46 | 46 | import { isEqual } from 'vs/base/common/resources';
|
47 | 47 | import { IURLService } from 'vs/platform/url/common/url';
|
48 | 48 | import { compareIgnoreCase } from 'vs/base/common/strings';
|
| 49 | +import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; |
| 50 | +import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress'; |
49 | 51 |
|
50 | 52 | const emptyEditableSettingsContent = '{\n}';
|
51 | 53 |
|
@@ -85,7 +87,9 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
85 | 87 | @ILabelService private readonly labelService: ILabelService,
|
86 | 88 | @IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
|
87 | 89 | @ITextEditorService private readonly textEditorService: ITextEditorService,
|
88 |
| - @IURLService urlService: IURLService |
| 90 | + @IURLService urlService: IURLService, |
| 91 | + @IExtensionService private readonly extensionService: IExtensionService, |
| 92 | + @IProgressService private readonly progressService: IProgressService |
89 | 93 | ) {
|
90 | 94 | super();
|
91 | 95 | // The default keybindings.json updates based on keyboard layouts, so here we make sure
|
@@ -627,10 +631,24 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
627 | 631 | return false;
|
628 | 632 | }
|
629 | 633 |
|
630 |
| - const openSettingsOptions: IOpenSettingsOptions = {}; |
631 | 634 | const settingInfo = uri.path.split('/').filter(part => !!part);
|
632 |
| - if ((settingInfo.length > 0) && this.getSetting(settingInfo[0])) { |
633 |
| - openSettingsOptions.query = settingInfo[0]; |
| 635 | + const settingId = ((settingInfo.length > 0) ? settingInfo[0] : undefined); |
| 636 | + if (!settingId) { |
| 637 | + this.openSettings(); |
| 638 | + return true; |
| 639 | + } |
| 640 | + |
| 641 | + let setting = this.getSetting(settingId); |
| 642 | + |
| 643 | + if (!setting && this.extensionService.extensions.length === 0) { |
| 644 | + // wait for extension points to be processed |
| 645 | + await this.progressService.withProgress({ location: ProgressLocation.Window }, () => Event.toPromise(this.extensionService.onDidRegisterExtensions)); |
| 646 | + setting = this.getSetting(settingId); |
| 647 | + } |
| 648 | + |
| 649 | + const openSettingsOptions: IOpenSettingsOptions = {}; |
| 650 | + if (setting) { |
| 651 | + openSettingsOptions.query = settingId; |
634 | 652 | }
|
635 | 653 |
|
636 | 654 | this.openSettings(openSettingsOptions);
|
|
0 commit comments