Skip to content

Add Directory.Exists() check to SetInitialWorkingDirectoryAsync() #1851

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
merged 1 commit into from
Jul 6, 2022

Conversation

andyleejordan
Copy link
Member

There was an edge case where, after setting and un-setting the powershell.cwd property in the VS Code client, instead of being null the setting would be the empty string "". The client did not care about this, and so left the server to silently crash on startup. We previously assumed that by the time the server started, the directory would be validated by the client, but this was wrong. So now we check its existence first.

Resolves #1849 (with a regression test too).

There was an edge case where, after setting and un-setting the
`powershell.cwd` property in the VS Code client, instead of being `null`
the setting would be the empty string `""`. The client did not care
about this, and so left the server to silently crash on startup. We
previously assumed that by the time the server started, the directory
would be validated by the client, but this was wrong. So now we check
its existence first.
@andyleejordan andyleejordan requested a review from a team July 5, 2022 23:08
@ghost ghost added Area-Startup Issue-Bug A bug to squash. labels Jul 5, 2022
@andyleejordan andyleejordan enabled auto-merge (squash) July 5, 2022 23:08
@andyleejordan
Copy link
Member Author

Also working on improving the client-side of this too.

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

LGTM!

@andyleejordan andyleejordan merged commit b30934e into main Jul 6, 2022
@andyleejordan andyleejordan deleted the andschwa/set-initial-dir branch July 6, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Extension won't start with invalid (empty string) powershell.cwd
2 participants