Skip to content

Commit

Permalink
render preferences features only for settings files
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jul 24, 2019
1 parent bc66a80 commit 07d0019
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
return Promise.resolve(null);
}

async createPreferencesEditorModel(uri: URI): Promise<IPreferencesEditorModel<any>> {
async createPreferencesEditorModel(uri: URI): Promise<IPreferencesEditorModel<any> | null> {
if (this.isDefaultSettingsResource(uri)) {
return this.createDefaultSettingsEditorModel(uri);
}
Expand All @@ -174,7 +174,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic

if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
const settingsUri = await this.getEditableSettingsURI(ConfigurationTarget.WORKSPACE_FOLDER, uri);
if (settingsUri) {
if (settingsUri && settingsUri.toString() === uri.toString()) {
return this.createEditableSettingsEditorModel(ConfigurationTarget.WORKSPACE_FOLDER, uri);
}
}
Expand All @@ -185,7 +185,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
return this.createEditableSettingsEditorModel(ConfigurationTarget.USER_REMOTE, uri);
}

return Promise.reject(`unknown resource: ${uri.toString()}`);
return null;
}

openRawDefaultSettings(): Promise<IEditor | null> {
Expand Down

0 comments on commit 07d0019

Please sign in to comment.