Skip to content
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

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

Merged
merged 5 commits into from Oct 7, 2019

Conversation

@hunghw
Copy link
Contributor

hunghw commented Aug 25, 2019

Add a new snippet variable WORKSPACE_FOLDER.

Copy link
Member

jrieken left a comment

please add tests

@hunghw hunghw force-pushed the hunghw:issue-79428 branch from 82661b7 to 631eee4 Aug 28, 2019
@hunghw

This comment has been minimized.

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
@@ -272,13 +274,31 @@ export class WorkspaceBasedVariableResolver implements VariableResolver {
}

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

This comment has been minimized.

Copy link
@jrieken

jrieken Sep 4, 2019

Member

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

This comment has been minimized.

Copy link
@hunghw

hunghw Sep 11, 2019

Author Contributor

sure, I can do it later.

Copy link
Contributor Author

hunghw left a comment

@jrieken I separate it into two functions.

@@ -272,13 +274,31 @@ export class WorkspaceBasedVariableResolver implements VariableResolver {
}

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

This comment has been minimized.

Copy link
@hunghw

hunghw Sep 11, 2019

Author Contributor

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
2 checks passed
2 checks passed
VS Code #20190912.52 succeeded
Details
license/cla All CLA requirements met.
Details
@hunghw hunghw deleted the hunghw:issue-79428 branch Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.