-
Notifications
You must be signed in to change notification settings - Fork 29k
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
ability to evaluate variables in user/workspace settings #8555
Conversation
…oot} and ${env...})
By analyzing the blame information on this pull request, we identified @egamma and @alexandrudima to be potential reviewers |
Hi @DonJayamanne, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
That is not a sentence I like to read when I need to invest time to review the PR... |
I agree with your comments. However, I was left with just one other option, which was to spend more time (few more days) on this issue and then try it. |
@bpasero A bit of context: This functionality would greatly help us to handle the management of Python virtual environments across teams that use different operating systems and different ways of managing their Python installations. Rather than filing a feature-request and wait for things to happen we'd like to provide that functionality as a pull request. However, the current approach doesn't seem right and thus we hoped you could nudge us in the right direction. What better way is there than to discuss concrete code? |
Makes sense. Maybe advocate for it to be put on the July plan then. |
I think it does not make sense to hook I would suggest to add SystemVariables into the configuration services we have (https:/Microsoft/vscode/blob/master/src/vs/workbench/services/configuration/node/configurationService.ts#L28 and https:/Microsoft/vscode/blob/ben/july/src/vs/platform/configuration/node/nodeConfigurationService.ts#L35) so that loading a configuration section always replaces variables properly. Some issues:
It would also be good to add tests for this, maybe |
Thanks for the feedback |
@bpasero, thanks for your feedback, I have a few suggestions and questions.
Wouldn't the base class 'configuration/common/configurationService.ts' be the right place for the change? I believe it is.
Agreed.
Unfortunately the SystemVariables class needs access to one of the above. I could fix this. However, before I do this, I would like to understand the purpose/usage of nodeConfigurationService.ts. |
Yes, that base class makes sense. And yes SystemVariables needs those optional dependencies. I think the workspace context service and thus the current workspace path is known at the time the configuration service gets created. That is pretty much the first service we create. I think @joaomoreno introduced nodeConfigurationService, he should comment on its purpose. As far as I remember, he uses it to be able to install extensions from the command line. |
The |
Given that it would probably make sense to have a workspace/editor independent @DonJayamanne given a lot of debt in the configuration service area I would probably hold on to making changes until we cleaned this mess up. Related issues: |
@bpasero , sure thing |
Configuration service is undergoing major refactorings. Closing this obsolete PR. |
The requirement is simple; provide the ability to use variables such as ${workspaceRoot} and ${env.PATH} in settings.json.
The implemented in the pull request is definitely not the right approach.
I'm looking for a more architecturally sound solution, i.e. a discussion on how to best approach this.
Also, I'm making use of the SystemVariables class (variables such as ${file} and the like will not work, infact VS Code will throw an error if such values are used)