Skip to content

Fix #79428 - add "$WORKSPACE_FOLDER" for snippet#79764

Merged
jrieken merged 5 commits intomicrosoft:masterfrom
hunghw:issue-79428
Oct 7, 2019
Merged

Fix #79428 - add "$WORKSPACE_FOLDER" for snippet#79764
jrieken merged 5 commits intomicrosoft:masterfrom
hunghw:issue-79428

Conversation

@hunghw
Copy link
Contributor

@hunghw hunghw commented Aug 25, 2019

Add a new snippet variable WORKSPACE_FOLDER.

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

please add tests

@hunghw
Copy link
Contributor Author

hunghw commented Aug 28, 2019

@jrieken I added tests.

@jrieken jrieken added this to the September 2019 milestone Aug 29, 2019

if (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) {
return path.basename(workspaceIdentifier.path);
if (variable.name === 'WORKSPACE_NAME') {
Copy link
Member

Choose a reason for hiding this comment

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

this repeated-if-else is a little ugly, can't you change it be two methods, like _resolveWorkspaceName and _resoveWorkspacePath?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, I can do it later.

Copy link
Contributor Author

@hunghw hunghw left a comment

Choose a reason for hiding this comment

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

@jrieken I separate it into two functions.


if (isSingleFolderWorkspaceIdentifier(workspaceIdentifier)) {
return path.basename(workspaceIdentifier.path);
if (variable.name === 'WORKSPACE_NAME') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, I can do it later.

@jrieken jrieken modified the milestones: September 2019, October 2019 Oct 1, 2019
@jrieken jrieken merged commit 511137f into microsoft:master Oct 7, 2019
@hunghw hunghw deleted the issue-79428 branch October 29, 2019 16:15
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
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.

3 participants