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

Implement EnvironmentVariableMutatorOptions API. #12984

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

tsmaeder
Copy link
Contributor

@tsmaeder tsmaeder commented Oct 9, 2023

What it does

Implements options when mutating EnvironmentVariableCollections. Since Theia does not support shell integration scripts, one of the options is stubbed. See the related issue for details.

Fixes #12941

Contributed on behalf of STMicroelectronics

How to test

Install the attached extension. It exercises the various cases like so:

    context.environmentVariableCollection.append('MUTATED_DEFAULT', 'a string');
    context.environmentVariableCollection.append('MUTATED_TRUE', 'a string', { applyAtProcessCreation: true });
    context.environmentVariableCollection.append('MUTATED_FALSE', 'a string', { applyAtProcessCreation: false });
    context.environmentVariableCollection.append('MUTATED_INT_TRUE', 'a string', { applyAtShellIntegration: true, applyAtProcessCreation: false });

After startup, open a terminal. My expectation is that THE MUTATED_DEFAULT and MUTATED_TRUE are set in the terminal shell.

Follow-ups

If we ever decide to implement shell integration scripts, we need to honor the corresponding flag.

Review checklist

Reminder for reviewers

…12941

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
@tsmaeder
Copy link
Contributor Author

tsmaeder commented Oct 9, 2023

Here's the extension:

envvartest-0.0.1.zip

and here's the source:

envvartest.zip

@tsmaeder tsmaeder added the vscode issues related to VSCode compatibility label Oct 9, 2023
Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Thank you @tsmaeder! I checked the code with your extension and everything works as expected. Values are properly handled based on their mutator options, meaning that in our case if you have applyAtProcessCreation set to false explicitly, they will not be available and applyAtShellIntegration is only stubbed/ignored.

@tsmaeder tsmaeder merged commit d635d6f into eclipse-theia:master Oct 19, 2023
13 checks passed
@vince-fugnitto vince-fugnitto added this to the 1.43.0 milestone Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[vscode] EnvironmentVariableMutator can now be configured
3 participants