-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix formatter #126
Fix formatter #126
Conversation
src/server.ts
Outdated
@@ -230,6 +231,9 @@ connection.onDidChangeConfiguration((change) => { | |||
if (settings.yaml.format.bracketSpacing === false) { | |||
yamlFormatterSettings.bracketSpacing = false; | |||
} | |||
if (settings.yaml.format.enable) { | |||
yamlFormatterSettings.enable = settings.yaml.format.enable || true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misunderstanding something here, but will this ever set yamlFormatterSettings.enable
to false
?
If settings.yaml.format.enable
is false
, won't this code block just be ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And won't the || true
ensure that this would always be set to true
anyway?
But I'm bad at Javascript so maybe this actually works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And at Typescript :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Good catch! I must not have had my coffee yet when I made the PR
This PR fixes the formatter so that it respects the yaml.format.enable setting.