Skip to content

Centralize fs usage. #8993

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

Merged

Conversation

ericsnowcurrently
Copy link

@ericsnowcurrently ericsnowcurrently commented Dec 10, 2019

(for #8995)

This is a partial un-revert of the recent FS changes. This change in particular only consolidates all FS-related operations to use of FileSystem objects.

@ericsnowcurrently ericsnowcurrently added the no-changelog No news entry required label Dec 10, 2019
@codecov-io
Copy link

codecov-io commented Dec 10, 2019

Codecov Report

Merging #8993 into master will increase coverage by 0.02%.
The diff coverage is 35.03%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8993      +/-   ##
==========================================
+ Coverage   57.45%   57.48%   +0.02%     
==========================================
  Files         551      550       -1     
  Lines       29316    29301      -15     
  Branches     4447     4439       -8     
==========================================
  Hits        16844    16844              
+ Misses      11533    11518      -15     
  Partials      939      939
Impacted Files Coverage Δ
src/client/common/platform/types.ts 100% <ø> (ø) ⬆️
src/client/datascience/jupyter/jupyterImporter.ts 16.47% <0%> (-0.98%) ⬇️
...datascience/jupyter/liveshare/hostJupyterServer.ts 12.35% <0%> (-0.15%) ⬇️
.../datascience/interactive-common/interactiveBase.ts 17.93% <0%> (-0.14%) ⬇️
...tascience/jupyter/liveshare/hostJupyterNotebook.ts 8.55% <0%> (ø) ⬆️
...rc/client/common/application/webPanels/webPanel.ts 14.28% <0%> (-1.59%) ⬇️
src/client/datascience/jupyter/jupyterNotebook.ts 4.87% <0%> (-0.22%) ⬇️
...rpreter/locators/services/baseVirtualEnvService.ts 28.3% <0%> (ø) ⬆️
src/client/workspaceSymbols/provider.ts 93.33% <100%> (ø) ⬆️
src/client/debugger/extension/adapter/logging.ts 100% <100%> (ø) ⬆️
... and 21 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 9976f85...5080b06. Read the comment docs.

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

🕐

@@ -54,6 +58,9 @@ export class FileSystem implements IFileSystem {
public readFile(filePath: string): Promise<string> {
return fs.readFile(filePath).then(buffer => buffer.toString());
Copy link

Choose a reason for hiding this comment

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

Would it be better to call fs.readFile with a encoding option? I believe in the normal fs that returns a string. Then you don't need to do the conversion.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, that is just left over from the existing code. Regardless, I'll update it. 😄

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

:shipit:

@ericsnowcurrently ericsnowcurrently merged commit 77dabe0 into microsoft:master Dec 17, 2019
@ericsnowcurrently ericsnowcurrently deleted the centralize-fs-usage branch December 17, 2019 22:04
@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants