I asked a similar question to this a couple weeks ago, but I think because it was so specific and lengthy, I did not get an answer. See original post. I'll try and ask a more direct question this time--
I'm currently writing a VS Code extension. Is there a function built into the VS Code API that when given a string as input, allows for evaluation of environment variables, like those used in the tasks.json
file? Full list of variables can be found here: https://code.visualstudio.com/docs/editor/variables-reference.
Such a function would take in a string containing environment variables and information about the workspace, then evaluate the environment variables in it. Example: "${workspaceFolder}_${fileBasenameNoExt}.txt"
→ "myWokspaceFolderName_myFileName.txt
I know VS Code has the functionality built in (as it is used in tasks) but I don't know how they do it and/or if I am able to use that functionality without having to rebuild it for my extension. What's the best way to implement this functionality in my extension?