1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: change all '$expr' to '${expr}' (#16428)

This commit is contained in:
yuyi
2022-11-15 21:53:13 +08:00
committed by GitHub
parent 56239b4a23
commit 017ace6ea7
859 changed files with 7156 additions and 7135 deletions

View File

@ -295,12 +295,12 @@ fn auto_complete(args []string) {
println(setup_for_shell(shell_name))
exit(0)
}
eprintln('Unknown shell ${shell_name}. Supported shells are: $auto_complete_shells')
eprintln('Unknown shell ${shell_name}. Supported shells are: ${auto_complete_shells}')
exit(1)
}
eprintln('auto completion require arguments to work.')
} else {
eprintln('auto completion failed for "$args".')
eprintln('auto completion failed for "${args}".')
}
exit(1)
}
@ -309,7 +309,7 @@ fn auto_complete(args []string) {
match sub {
'setup' {
if sub_args.len <= 1 || sub_args[1] !in auto_complete_shells {
eprintln('please specify a shell to setup auto completion for ($auto_complete_shells).')
eprintln('please specify a shell to setup auto completion for (${auto_complete_shells}).')
exit(1)
}
shell := sub_args[1]
@ -322,7 +322,7 @@ fn auto_complete(args []string) {
mut lines := []string{}
list := auto_complete_request(sub_args[1..])
for entry in list {
lines << "COMPREPLY+=('$entry')"
lines << "COMPREPLY+=('${entry}')"
}
println(lines.join('\n'))
}
@ -333,7 +333,7 @@ fn auto_complete(args []string) {
mut lines := []string{}
list := auto_complete_request(sub_args[1..])
for entry in list {
lines << '$entry'
lines << '${entry}'
}
println(lines.join('\n'))
}
@ -344,7 +344,7 @@ fn auto_complete(args []string) {
mut lines := []string{}
list := auto_complete_request(sub_args[1..])
for entry in list {
lines << 'compadd -U -S' + '""' + ' -- ' + "'$entry';"
lines << 'compadd -U -S' + '""' + ' -- ' + "'${entry}';"
}
println(lines.join('\n'))
}
@ -542,7 +542,7 @@ _v_completions() {
local limit
# Send all words up to the word the cursor is currently on
let limit=1+\$COMP_CWORD
src=\$($vexe complete bash \$(printf "%s\\n" \${COMP_WORDS[@]: 0:\$limit}))
src=\$(${vexe} complete bash \$(printf "%s\\n" \${COMP_WORDS[@]: 0:\$limit}))
if [[ \$? == 0 ]]; then
eval \${src}
#echo \${src}
@ -556,7 +556,7 @@ complete -o nospace -F _v_completions v
setup = '
function __v_completions
# Send all words up to the one before the cursor
$vexe complete fish (commandline -cop)
${vexe} complete fish (commandline -cop)
end
complete -f -c v -a "(__v_completions)"
'
@ -567,7 +567,7 @@ complete -f -c v -a "(__v_completions)"
_v() {
local src
# Send all words up to the word the cursor is currently on
src=\$($vexe complete zsh \$(printf "%s\\n" \${(@)words[1,\$CURRENT]}))
src=\$(${vexe} complete zsh \$(printf "%s\\n" \${(@)words[1,\$CURRENT]}))
if [[ \$? == 0 ]]; then
eval \${src}
#echo \${src}
@ -580,7 +580,7 @@ compdef _v v
setup = '
Register-ArgumentCompleter -Native -CommandName v -ScriptBlock {
param(\$commandName, \$wordToComplete, \$cursorPosition)
$vexe complete powershell "\$wordToComplete" | ForEach-Object {
${vexe} complete powershell "\$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new(\$_, \$_, \'ParameterValue\', \$_)
}
}