Skip to content
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

Merged
merged 3 commits into from
Mar 20, 2019
Merged

Fix formatter #126

merged 3 commits into from
Mar 20, 2019

Conversation

JPinkney
Copy link
Contributor

This PR fixes the formatter so that it respects the yaml.format.enable setting.

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;
Copy link

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?

Copy link

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And at Typescript :)

Copy link
Contributor Author

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

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 70.908% when pulling 767e655 on fixFormatter into 99f85cb on master.

@JPinkney JPinkney merged commit 817a4a3 into master Mar 20, 2019
@evidolob evidolob deleted the fixFormatter branch August 11, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants