Skip to content

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

Merged
Mikhail Arkhipov (MikhailArkhipov) merged 90 commits into
microsoft:masterfrom
MikhailArkhipov:lint
Jan 29, 2018
Merged

Mikhail Arkhipov (MikhailArkhipov) merged 90 commits into
microsoft:masterfrom
MikhailArkhipov:lint

Conversation

@MikhailArkhipov

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jan 25, 2018 •

Copy link
Copy Markdown

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.

Comment thread src/client/common/application/types.ts Outdated
/**
* An event that is emitted when a [text document](#TextDocument) is saved to disk.
*/
readonly onDidSaveTextDocument: Event<TextDocument>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How about moving this into the DocumentManager class? (feels like it would be better in there)
https://github.com/MikhailArkhipov/vscode-python/blob/ae81702242e20902c5076f975043c416b427b82d/src/client/common/application/documentManager.ts

Copy link
Copy Markdown
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?

Copy link
Copy Markdown

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
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved

Comment thread src/client/providers/formatProvider.ts Outdated
if (this.formatterMadeChanges
&& this.contentBeforeFormatting
&& !document.isDirty
&& this.contentBeforeFormatting === document.getText()) {

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

@MikhailArkhipov
Mikhail Arkhipov (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