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

Feature Request: Tasks variables replacing #40288

Closed
purocean opened this issue Dec 15, 2017 · 12 comments
Closed

Feature Request: Tasks variables replacing #40288

purocean opened this issue Dec 15, 2017 · 12 comments
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code variable-resolving
Milestone

Comments

@purocean
Copy link

purocean commented Dec 15, 2017

Sublime Text has this feature

${relativeFile/a/b/} replace a to b
http://sublimetext.info/docs/en/reference/build_systems.html#variables

I use WSL script for work in VSCode. So I need change file or dir path slash, or change suffix some times.

I think this will be a useful feature.

#40256

@vscodebot vscodebot bot added the editor label Dec 15, 2017
@dbaeumer dbaeumer added workbench and removed editor labels Dec 15, 2017
@dbaeumer dbaeumer assigned isidorn and unassigned dbaeumer Dec 15, 2017
@dbaeumer
Copy link
Member

@isidorn assigning to you since this would nicely fit into the configuration resolver service.

@isidorn isidorn added the feature-request Request for new features or functionality label Dec 15, 2017
@isidorn isidorn added this to the Backlog milestone Dec 15, 2017
@isidorn isidorn removed their assignment Dec 15, 2017
@weinand weinand modified the milestones: Backlog, December 2017/January 2018 Dec 18, 2017
@weinand
Copy link
Contributor

weinand commented Dec 18, 2017

We'll have to coordinate this with the other requests for variables: #38381, #38327, #38977

@bpasero bpasero added config VS Code configuration, set up issues and removed workbench labels Dec 19, 2017
@isidorn
Copy link
Contributor

isidorn commented Jan 5, 2018

We accept PRs that fix this issue
Code pointer https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts#L23

If nobody volunterees to look into this I can investigate second half of January

@isidorn isidorn added the help wanted Issues identified as good community contribution opportunities label Jan 5, 2018
@isidorn isidorn modified the milestones: January 2018, On Deck Jan 17, 2018
@pradeepmurugesan
Copy link
Contributor

@isidorn this is interesting. I can give a shot.

The code pointer still holds good ? Looks like its pointing to an import statement now.

@isidorn
Copy link
Contributor

isidorn commented Mar 22, 2018

@pradeepmurugesan the code pointer is decent, it is that file still.
For the PR to be accepted please try to implement it in a clear and simple way if possible.

@pradeepmurugesan
Copy link
Contributor

@isidorn Sorry if my question is too naive.. Where will the user execute the command ${relativeFile/a/b/}

I mean is it in the command window of vscode ( cmd + Shift + p ) or somewhere else ?

@weinand
Copy link
Contributor

weinand commented Mar 28, 2018

it is a variable in a launch configuration (from launch.json) or a task (from task.json).
Here is an example from VS Code's own launch configurations: https://github.com/Microsoft/vscode/blob/master/.vscode/launch.json

Everything starting with '$' is a variable. Most of them are simple and just evaluate to a filesystem path.

When you run a launch configuration (e.g. by pressing 'F5'), the "configuration resolver service" resolves the variables to strings before the configuration is executed.

@pradeepmurugesan
Copy link
Contributor

@weinand Thanks for the explanation.

So ${relativeFile/a/b/} is a string replace, and the modified string will be used by the task or launch configuration ?

Am I understanding it right ?

Initially I thought it should move the file in the filesystem to the new name.

@weinand
Copy link
Contributor

weinand commented Mar 28, 2018

${relativeFile} is a simple variable and ${relativeFile/a/b/} is basically a ${relativeFile}.replace('a', 'b')

no moving of files is involved here.

pradeepmurugesan added a commit to pradeepmurugesan/vscode that referenced this issue Apr 23, 2018
@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Sep 20, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 20, 2018

This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Sep 20, 2018
@stefaneidelloth
Copy link

Would like to see this feature. Also see https://stackoverflow.com/questions/45132566/how-to-fix-jest-no-tests-found-on-windows-10/57522638#57522638

@anavalaka
Copy link

can we also do substring as well?

@weinand weinand modified the milestones: On Deck, Backlog Jun 28, 2022
@weinand weinand added variable-resolving and removed config VS Code configuration, set up issues labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities *out-of-scope Posted issue is not in scope of VS Code variable-resolving
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants