-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
${fileBasenameNoExtension} doesn't get substitued if nested in argument #15937
Comments
Reproducable steps please. What is the file that you have open, what are you expecting to get returned, what actually gets returned? Thanks |
Hi @isidorn , many thanks for replying. I simply used it in a build task. In tasks.json: {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "clenv.bat",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"args": ["${file} ${fileBasenameNoExtension}"]
}
]
} Output: ${file} = c:\Users\bayesrule\Desktop\codes\program.c ${fileBasenameNoExtension} = program , however it cannot be recognised at all. |
That is the expected result of ${fileBasenameNoExtension}, that is program.c without the extension, thus program. Closing as designed - let me know if I misunderstood stomething here |
@isidorn sadly you misunderstood me again. I meant ${fileBasenameNoExtension} should be 'program', but it is not. Like I presented in the quoted line, it displayed as ${fileBasenameNoExtension}, which clearly shows that it is not working... |
I have this problem too.Using '${fileBasenameNoExtension}' in 'tasks.json' produces '${fileBasenameNoExtension}.exe' , it seems ${fileBasenameNoExtension} doesn't work. task.json: {
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"showOutput": "always",
"args": ["-g","${file}","-o","${fileBasenameNoExtension}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
} |
${fileBasenameNoExtension} is doing the same thing for me, it should be getting "style.min.css" out of this but instead it literally sends "${fileBasenameNoExtension}.min.css":
|
Ok looking at all your examples it seems like the issue is that the substition does not work if the variable is nested inside an argument. Reopening to investigate |
This has been fixed in the insiders, please verify with vscode insiders this works fine for you now. |
Hi,
The newly added variable ${fileBasenameNoExtension} (#1104) is not working, please check.
Many thanks!
The text was updated successfully, but these errors were encountered: