-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
complete support of variable substitution #5835
Conversation
I am verifying it. |
What should happen when a variable is not available from the shell?
|
That's a great point! It should be an empty string for sure. |
I have verified the followinngs I could understand from the description; they work. Verified variables:
Executed module: console.log('ARGS:');
for (const e of process.argv.splice(2)) {
console.log(e);
} Running
Running
I did no verify the case sensitivity/insensitivity:
|
I've noticed that VS Code always convert env var name to lower case on windows: https://github.com/microsoft/vscode/blob/0a34756cae4fc67739e60c708b04637089f8bb0d/src/vs/workbench/services/configurationResolver/common/variableResolver.ts#L172-L175 Should we do the same? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I have tested, worked as expected. Please note the following items:
- Cannot cancel the quick pick when setting variables: complete support of variable substitution #5835 (comment)
- Unavailable variables should be empty strings: complete support of variable substitution #5835 (comment)
@@ -44,26 +63,15 @@ export class VariableQuickOpenService implements QuickOpenModel { | |||
onType(lookFor: string, acceptor: (items: QuickOpenItem[]) => void): void { | |||
acceptor(this.items); | |||
} | |||
} | |||
|
|||
export class VariableQuickOpenItem extends QuickOpenItem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should go to the breaking changes section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
I don't think it is a case for all variables, just for env because they are evaluated to empty string when missing. In other cases it is not true. Maybe we should throw in other cases to prevent running tasks and launch configuration with bogus arguments. |
I will wait till CQ is resolved before continuing working on it. It is pending already for 5 days and they don't seem to work on it: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=20504#c3 cc @marcdumais-work |
Yes, I noticed things seem slow at the Foundation recently; I suspect late summer vacations. |
I believe the CQ is waiting for some form of feedback from you @akosyakov :( I see the message "IPTeam awaiting response from Committer." |
Thanks for pointing this out, Vince. I answered the question and sent the CQ back to the IP team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested several random variables through the Variables: List All
command
works as expected
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
see https://code.visualstudio.com/docs/editor/variables-reference#_variables-scoped-per-workspace-folder Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
77f809e
to
b03777b
Compare
@kittaakos I've pushed a commit to fix resolving env variables values on windows and evaluating them to an empty string if they are missing to align with the shell behaviour. I'm going to merge it tomorrow if no one objects and CI is green. |
in order to simplify testing of variable substitution Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
See https://code.visualstudio.com/docs/editor/variables-reference#_configuration-variables Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
See https://code.visualstudio.com/docs/editor/variables-reference#_command-variables Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
See https://code.visualstudio.com/docs/editor/variables-reference#_input-variables Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
- if an env variable does not exist it should resolve to an empty string to emulate the shell - normalize env variable name to lower case in order to retrieve them from process.env on windows Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
What it does
How to test
Variables: List All
commandwatch echo
in order to keep a task runningextension.pickNodeProcess
, don't forget that you need both vscode nodejs extension to use themReview checklist
Reminder for reviewers