-
Notifications
You must be signed in to change notification settings - Fork 15
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
Variable substitution #9
Comments
May I add a request for https://code.visualstudio.com/docs/editor/variables-reference#_environment-variables |
Hi 🙋♂️ Not sure if this is fully implemented yet, but i may have found a bug? I came across this when trying to replicate a feature of vim, specifically The following is for the example of It is supposed to eval the cursor line number, and scroll it to the top of the viewport, without moving the cursor. "commands.variableSubstitutionEnabled": true,
"commands.commands": {
"Viewport scroll Top": {
"command": "revealLine",
"args": {
"lineNumber": "${lineNumber}",
"at": "top",
},
"statusBar": {
"alignment": "left",
"color": "#FFCC00",
"text": "scroll Top"
}
}
}, The problem is it doesn't work? But if i hard code a value instead like Any thoughts? Solutions? |
Variable substitution only works if the It needs to be implemented as a recursive walking through arrays/objects and then when the item is string - substitute. Actually, I don't feel like writing a recursive walking function. Just going to use |
Awesome! Working beautifully now. Thank you! |
The one I miss the most in the list above are the configuration variables moved to separate issue for better tracking |
Make it possible to use inside
"args"
https://code.visualstudio.com/docs/editor/variables-reference${userHome}
${file}
${fileBasename}
${fileBasenameNoExtension}
${fileExtname}
${fileDirname}
${fileWorkspaceFolder}
${workspaceFolder}
${workspaceFolderBasename}
${execPath}
${pathSeparator}
${lineNumber}
${selectedText}
${currentYear}
${currentYearShort}
${currentMonth}
${currentMonthName}
${currentMonthNameShort}
${currentDate}
${currentDayName}
${currentDayNameShort}
${currentHour}
${currentMinute}
${currentSecond}
${currentSecondsUnix}
${currentTimezoneOffset}
${config:VSCODE_SETTING_ID}
${input:Name}
${command:Name}
${env:ENV_VAR}
${file},${fileBasename},...
${env:MY_SYSTEM_VAR}
${config:CONFIG_VAR}
${command:vscodeCommandId}
${clipboard}
current clipboard value${random}
6 random Base-10 digits${randomHex}
6 random Base-16 digits${selectedLineCount}
Number of selected lines in active file${currentYear}
${currentYearShort}
${currentMonth}
${currentMonthName}
${currentMonthNameShort}
${currentDate}
${currentDayName}
${currentDayNameShort}
${currentHour}
${currentMinute}
${currentSecond}
${currentSecondsUnix}
${currentTimezoneOffset}
The text was updated successfully, but these errors were encountered: