Closed dvirtz closed 8 months ago
@dvirtz try v1.61.1 and use
${workspaceFolder:b.1:nomsg}
${workspaceFolder:b.2:nomsg}
${workspaceFolder:b.3:nomsg}
I'm curious about the JavaScript expression that you use? Do you do it in the tasks.json
file or in the script that is started by the task?
Thanks @rioj7, that works. The input variable I use is
{
"id": "uniqueFolder",
"type": "command",
"command": "extension.commandvariable.config.expression",
"args": {
"configVariable": "editor.fontSize",
"expression": "['${workspaceFolder:b.1:nomsg}', '${workspaceFolder:b.2:nomsg}', '${workspaceFolder:b.3:nomsg}'].find(folder => folder != 'Unknown')",
}
}
in tasks.json.
I hack config.expression
for that. I couldn't find a better way to just run some JS expression with variable expansion.
@dvirtz Users always find creative application of features.
I will add this to the README as a possible use case of variables.
I will make the configVariable
property optional.
@dvirtz in v1.61.2 configVariable
property is optional
I have several multi-root projects that have one shared folder and one folder which is unique to each project, so
etc. I want to have a task in the shared folder that gets the name of the unique folder so I apply a JavaScript expression that returns the first valid of
${workspaceFolder:b.1}
,${workspaceFolder:b.2}
,${workspaceFolder:b.3}
, etc. This works but there's annoyingWorkspace not found with name
notifications popping up.Can you add an option to ignore those errors or can you think of a better way to achieve this?