[json] make result limit configurable. Fixes #84259

This commit is contained in:
Martin Aeschlimann 2019-12-04 15:12:42 +01:00
parent ef121d2d87
commit 669d0ab44e
3 changed files with 10 additions and 2 deletions

View file

@ -351,6 +351,8 @@ function getSchemaAssociation(_context: ExtensionContext): ISchemaAssociations {
function getSettings(): Settings {
let httpSettings = workspace.getConfiguration('http');
let resultLimit: number = Math.trunc(Math.max(0, Number(workspace.getConfiguration().get('json.maxItemsComputed')))) || 5000;
let settings: Settings = {
http: {
proxy: httpSettings.get('proxy'),
@ -358,7 +360,7 @@ function getSettings(): Settings {
},
json: {
schemas: [],
resultLimit: 5000
resultLimit
}
};
let schemaSettingsById: { [schemaId: string]: JSONSchemaSettings } = Object.create(null);

View file

@ -90,6 +90,11 @@
"default": true,
"description": "%json.colorDecorators.enable.desc%",
"deprecationMessage": "%json.colorDecorators.enable.deprecationMessage%"
},
"json.maxItemsComputed": {
"type": "number",
"default": 5000,
"description": "%json.maxItemsComputed.desc%"
}
}
},

View file

@ -11,5 +11,6 @@
"json.colorDecorators.enable.desc": "Enables or disables color decorators",
"json.colorDecorators.enable.deprecationMessage": "The setting `json.colorDecorators.enable` has been deprecated in favor of `editor.colorDecorators`.",
"json.schemaResolutionErrorMessage": "Unable to resolve schema.",
"json.clickToRetry": "Click to retry."
"json.clickToRetry": "Click to retry.",
"json.maxItemsComputed.desc": "The maximum number of outline symbols and folding regions computed (limited for performance reasons)."
}