Skip to content

Commit 9e27503

Browse files
authored
Add a fast check to determine if a preferences renderer needs to be created (microsoft#165825)
Add a fast check to determine if a preferences renderer needs to be created (microsoft#164171)
1 parent 8e9fc56 commit 9e27503

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export class SettingsEditorContribution extends Disposable {
3535
this.currentRenderer = undefined;
3636

3737
const model = this.editor.getModel();
38-
if (model) {
38+
if (model && /\.(json|code-workspace)$/.test(model.uri.path)) {
39+
// Fast check: the preferences renderer can only appear
40+
// in settings files or workspace files
3941
const settingsModel = await this.preferencesService.createPreferencesEditorModel(model.uri);
4042
if (settingsModel instanceof SettingsEditorModel && this.editor.getModel()) {
4143
this.disposables.add(settingsModel);

0 commit comments

Comments
 (0)