Adding keepLines feature to the settings (#154790)

* Adding the keepLines feature into the settings so the user can format while keeping the original line positions in json documents

* update service

* update dependencies

Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
This commit is contained in:
Aiday Marlen Kyzy
2022-07-12 09:59:33 +02:00
committed by GitHub
parent c71e78d3d6
commit 47a1f80c65
7 changed files with 46 additions and 32 deletions

View File

@@ -57,6 +57,7 @@ type Settings = {
json?: {
schemas?: JSONSchemaSettings[];
format?: { enable?: boolean };
keepLines?: { enable?: boolean };
validate?: { enable?: boolean };
resultLimit?: number;
};
@@ -74,6 +75,7 @@ export type JSONSchemaSettings = {
export namespace SettingIds {
export const enableFormatter = 'json.format.enable';
export const enableKeepLines = 'json.format.keepLines';
export const enableValidation = 'json.validate.enable';
export const enableSchemaDownload = 'json.schemaDownload.enable';
export const maxItemsComputed = 'json.maxItemsComputed';
@@ -480,6 +482,7 @@ function getSettings(): Settings {
json: {
validate: { enable: configuration.get(SettingIds.enableValidation) },
format: { enable: configuration.get(SettingIds.enableFormatter) },
keepLines: { enable: configuration.get(SettingIds.enableKeepLines) },
schemas: [],
resultLimit: resultLimit + 1 // ask for one more so we can detect if the limit has been exceeded
}