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

Use workspaceFolder token instead of workspaceRoot #267

Merged
merged 14 commits into from
Nov 22, 2017

Conversation

DonJayamanne
Copy link

Fixes #258

@@ -39,6 +40,22 @@ suite('Multiroot Python Path Settings Updater', () => {
assert.equal(folderValue, pythonPath, 'Workspace Python Path not updated');
});

test('Updating Workspace Folder Python Path should work with relative paths', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Should there be an assert that the path is actually relative since it's opaque here in the code that it's relative? That way if workspace3Uri changes we will know this test is no longer valid.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, don't quite understand what you're saying.

Copy link
Author

Choose a reason for hiding this comment

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

By relative, i mean the python path is relative. As you can see I'm prefixing the name of the python executable with a / (meaning it is relative to current workspace).

const pythonExec = `/xWorkspacePythonPath${new Date().getMilliseconds()}`;

Copy link
Member

Choose a reason for hiding this comment

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

So leaving off the slash makes it an absolute path? I guess what's tripping up my brain is that a leading / on UNIX makes something absolute.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, my mistake, will make the tests clearer. Don't want to explain it, hopefully you'll understand the comments and code, if not then i'll revise it.

Copy link
Author

Choose a reason for hiding this comment

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

@brettcannon Fixed, please check again

@@ -58,14 +75,33 @@ suite('Multiroot Python Path Settings Updater', () => {
assert.equal(folderValue, pythonPath, 'Workspace Python Path not updated');
});

test('Python Path should be relative to workspace', async () => {
// tslint:disable-next-line:no-invalid-template-strings
test('Python Paths containing ${workspaceRoot should be resolved as ${workspaceFolder}', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

${workspaceRoot} (missing the close curly brace).

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@DonJayamanne DonJayamanne merged commit a975862 into microsoft:master Nov 22, 2017
@DonJayamanne DonJayamanne deleted the useWorkspaceFolderToken branch November 27, 2017 17:49
DonJayamanne added a commit that referenced this pull request Dec 14, 2017
* upstream/master:
  Fixes #22 to Detect anaconda from known locations  (#221)
  Use workspaceFolder token instead of workspaceRoot (#267)
  Fix registry lookup response (#224)
  Fix issues when running without debugging and debugged code terminates (#249)
@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
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.

${workspaceFolder} variable not working
3 participants