Skip to content

Commit 3b79ef3

Browse files
authored
Merge pull request #96 from iquiw/fix-bracketSpacing
Enable to set bracketSpacing option to false
2 parents 1a51f31 + fb603ce commit 3b79ef3

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/server.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,21 @@ connection.onDidChangeConfiguration((change) => {
218218
configureHttpRequests(settings.http && settings.http.proxy, settings.http && settings.http.proxyStrictSSL);
219219

220220
specificValidatorPaths = [];
221-
yamlConfigurationSettings = settings.yaml && settings.yaml.schemas;
222-
yamlShouldValidate = settings.yaml && settings.yaml.validate;
223-
yamlShouldHover = settings.yaml && settings.yaml.hover;
224-
yamlShouldCompletion = settings.yaml && settings.yaml.completion;
221+
if (settings.yaml) {
222+
yamlConfigurationSettings = settings.yaml.schemas;
223+
yamlShouldValidate = settings.yaml.validate;
224+
yamlShouldHover = settings.yaml.hover;
225+
yamlShouldCompletion = settings.yaml.completion;
226+
customTags = settings.yaml.customTags ? settings.yaml.customTags : [];
227+
yamlFormatterSettings = {
228+
singleQuote: settings.yaml.format.singleQuote || false,
229+
proseWrap: settings.yaml.format.proseWrap || "preserve"
230+
};
231+
if (settings.yaml.format.bracketSpacing === false) {
232+
yamlFormatterSettings.bracketSpacing = false;
233+
}
234+
}
225235
schemaConfigurationSettings = [];
226-
customTags = settings.yaml && settings.yaml.customTags ? settings.yaml.customTags : [];
227-
yamlFormatterSettings = settings.yaml && {
228-
singleQuote: settings.yaml.format.singleQuote || false,
229-
bracketSpacing: settings.yaml.format.bracketSpacing || true,
230-
proseWrap: settings.yaml.format.proseWrap || "preserve"
231-
};
232236

233237
for(let url in yamlConfigurationSettings){
234238
let globPattern = yamlConfigurationSettings[url];

0 commit comments

Comments
 (0)