mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-26 13:19:42 +00:00
[json] Allow "json.validate.enable": false in settings / disable JSON validation or error checking. Fixes #114775
This commit is contained in:
@@ -59,7 +59,8 @@ namespace ResultLimitReachedNotification {
|
||||
interface Settings {
|
||||
json?: {
|
||||
schemas?: JSONSchemaSettings[];
|
||||
format?: { enable: boolean };
|
||||
format?: { enable?: boolean };
|
||||
validate?: { enable?: boolean };
|
||||
resultLimit?: number;
|
||||
};
|
||||
http?: {
|
||||
@@ -76,6 +77,7 @@ export interface JSONSchemaSettings {
|
||||
|
||||
namespace SettingIds {
|
||||
export const enableFormatter = 'json.format.enable';
|
||||
export const enableValidation = 'json.validate.enable';
|
||||
export const enableSchemaDownload = 'json.schemaDownload.enable';
|
||||
export const maxItemsComputed = 'json.maxItemsComputed';
|
||||
}
|
||||
@@ -425,6 +427,7 @@ function getSchemaAssociations(_context: ExtensionContext): ISchemaAssociation[]
|
||||
}
|
||||
|
||||
function getSettings(): Settings {
|
||||
const configuration = workspace.getConfiguration();
|
||||
const httpSettings = workspace.getConfiguration('http');
|
||||
|
||||
const resultLimit: number = Math.trunc(Math.max(0, Number(workspace.getConfiguration().get(SettingIds.maxItemsComputed)))) || 5000;
|
||||
@@ -435,6 +438,8 @@ function getSettings(): Settings {
|
||||
proxyStrictSSL: httpSettings.get('proxyStrictSSL')
|
||||
},
|
||||
json: {
|
||||
validate: { enable: configuration.get(SettingIds.enableValidation) },
|
||||
format: { enable: configuration.get(SettingIds.enableFormatter) },
|
||||
schemas: [],
|
||||
resultLimit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user