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

Work around VSC issue with formatting on save #624 #635

Merged
merged 90 commits into from
Jan 29, 2018
Merged

Work around VSC issue with formatting on save #624 #635

merged 90 commits into from
Jan 29, 2018

Conversation

MikhailArkhipov
Copy link

Fixes #624, #590, #124, #492

@codecov
Copy link

codecov bot commented Jan 25, 2018

Codecov Report

Merging #635 into master will increase coverage by 0.17%.
The diff coverage is 74.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #635      +/-   ##
==========================================
+ Coverage   60.69%   60.86%   +0.17%     
==========================================
  Files         232      232              
  Lines       10502    10549      +47     
  Branches     1830     1838       +8     
==========================================
+ Hits         6374     6421      +47     
  Misses       4122     4122              
  Partials        6        6
Impacted Files Coverage Δ
src/client/common/application/types.ts 100% <ø> (ø) ⬆️
src/client/common/types.ts 100% <ø> (ø) ⬆️
src/client/common/application/documentManager.ts 23.8% <100%> (+8.02%) ⬆️
src/client/formatters/yapfFormatter.ts 95.23% <100%> (-0.22%) ⬇️
src/client/formatters/helper.ts 100% <100%> (ø) ⬆️
src/client/formatters/autoPep8Formatter.ts 95% <100%> (ø) ⬆️
src/client/extension.ts 94.03% <100%> (ø) ⬆️
src/client/common/application/workspace.ts 23.8% <16.66%> (+9.52%) ⬆️
src/client/common/editor.ts 67.19% <73.41%> (-2.42%) ⬇️
src/client/formatters/baseFormatter.ts 70.96% <88.88%> (+4.86%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36b3050...d9c7d3d. Read the comment docs.

/**
* An event that is emitted when a [text document](#TextDocument) is saved to disk.
*/
readonly onDidSaveTextDocument: Event<TextDocument>;

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

It is part of the workspace in vscode, it might be worth matching vsc interfaces so it is easier to find?

Choose a reason for hiding this comment

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

Then should we move everything from DocumentManager into workspace? I thought it would be better to move stuff related to editors into a separate class. Just as we did with the Application class.

Copy link
Author

Choose a reason for hiding this comment

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

Moved

if (this.formatterMadeChanges
&& this.contentBeforeFormatting
&& !document.isDirty
&& this.contentBeforeFormatting === document.getText()) {

Choose a reason for hiding this comment

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

Cant we use document.version to detect changes, instead of checking if file contents match.

Copy link
Author

Choose a reason for hiding this comment

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

I'll check if it is properly changed.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@MikhailArkhipov MikhailArkhipov merged commit 94cd778 into microsoft:master Jan 29, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Work around VSC issue with formatting on save
2 participants