rioj7 / command-variable

Visual Studio Code extension for variable substitution via ${command:commandID}
51 stars 10 forks source link

create a workspace last folder variable #35

Closed fr43nk closed 2 years ago

fr43nk commented 2 years ago

Hi, I'm using workspaces a lot. There I have a bunch of paths configured to be part of that workspace. Those paths have one base folder in common. My request now is, to have a variable which contains the folder name after the base folder. Like so:

"folders": [
        {
            "path": "d:\\dev_01\\common"
        },
        {
            "path": "d:\\dev_01\\technical"
        },
    ]

For this example, a variable that just returns common or technical depending on the path of the open file.

Best regards, Frank

rioj7 commented 2 years ago

@fr43nk Isn't this the variable ${workspaceFolderBasename}

fr43nk commented 2 years ago

Hi,

sadly it is not the right one. This is the first folder of my workspace path entries common in this example and not technical. Although the called filed is located in the last mentioned one.

best

rioj7 commented 2 years ago

@fr43nk v1.38.0 has 2 new commands

fr43nk commented 2 years ago

Thanks a lot. Works great.

Best regards.