Ensure launchingFile
exists when setting working directory
#6577
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #6549
With fix, interactive window now reflects working directory of the launching file:
@DonJayamanne I saw that this line actually used to be
launchingFile && await this.fs.localFileExists(launchingFile)
and you changed it tolaunchingFile && (await this.fs.localDirectoryExists(path.dirname(launchingFile))
in https://github.com/microsoft/vscode-jupyter/pull/5911/files#diff-a0dd7eee8719435e87b786dfb43d089e73561a33ce842613a2fc7a3894bea959R968However relying on
path.dirname
causes problems with setting the current working directory for the interactive window and I would argue that we should always be checking whether thelaunchingFile
is valid, since otherwise it's possible for us to end up in states like this: #6549 (comment)Do you foresee any issues with this change?