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

@ -226,7 +226,7 @@ fn (upd VlsUpdater) download_prebuilt() ! {
}
fn (upd VlsUpdater) print_new_vls_version(new_vls_exec_path string) {
exec_version := os.execute('$new_vls_exec_path --version')
exec_version := os.execute('${new_vls_exec_path} --version')
if exec_version.exit_code == 0 {
upd.log('VLS was updated to version: ${exec_version.output.all_after('vls version ').trim_space()}')
}
@ -242,13 +242,13 @@ fn (upd VlsUpdater) compile_from_source() ! {
if !os.exists(vls_src_folder) {
upd.log('Cloning VLS repo...')
clone_result := os.execute('$git clone https://github.com/nedpals/vls $vls_src_folder')
clone_result := os.execute('${git} clone https://github.com/nedpals/vls ${vls_src_folder}')
if clone_result.exit_code != 0 {
return error('Failed to build VLS from source. Reason: $clone_result.output')
return error('Failed to build VLS from source. Reason: ${clone_result.output}')
}
} else {
upd.log('Updating VLS repo...')
pull_result := os.execute('$git -C $vls_src_folder pull')
pull_result := os.execute('${git} -C ${vls_src_folder} pull')
if !upd.is_force && pull_result.output.trim_space() == 'Already up to date.' {
upd.log("VLS was already updated to it's latest version.")
return
@ -271,7 +271,7 @@ fn (upd VlsUpdater) compile_from_source() ! {
compile_result := os.execute('v run ${os.join_path(vls_src_folder, 'build.vsh')} ${possible_compilers[selected_compiler_idx]}')
if compile_result.exit_code != 0 {
return error('Cannot compile VLS from source: $compile_result.output')
return error('Cannot compile VLS from source: ${compile_result.output}')
}
exec_path := os.join_path(vls_src_folder, 'bin', 'vls')
@ -372,10 +372,10 @@ fn (mut upd VlsUpdater) parse(mut fp flag.FlagParser) ! {
fn (upd VlsUpdater) log(msg string) {
match upd.output {
.text {
println('> $msg')
println('> ${msg}')
}
.json {
print('{"message":"$msg"}')
print('{"message":"${msg}"}')
flush_stdout()
}
.silent {}
@ -397,7 +397,7 @@ fn (upd VlsUpdater) error_details(err IError) string {
the specified path exists and is a valid executable.
- If you have an existing installation of VLS, be sure
to remove "vls.config.json" and "bin" located inside
"$vls_dir_shortened" and re-install.
"${vls_dir_shortened}" and re-install.
If none of the options listed have solved your issue,
please report it at https://github.com/vlang/v/issues
@ -413,7 +413,7 @@ fn (upd VlsUpdater) error_details(err IError) string {
fn (upd VlsUpdater) cli_error(err IError) {
match upd.output {
.text {
eprintln('v ls error: $err.msg() ($err.code())')
eprintln('v ls error: ${err.msg()} (${err.code()})')
if err !is none {
eprintln(upd.error_details(err))
}
@ -421,7 +421,7 @@ fn (upd VlsUpdater) cli_error(err IError) {
print_backtrace()
}
.json {
print('{"error":{"message":${json.encode(err.msg())},"code":"$err.code()","details":${json.encode(upd.error_details(err).trim_space())}}}')
print('{"error":{"message":${json.encode(err.msg())},"code":"${err.code()}","details":${json.encode(upd.error_details(err).trim_space())}}}')
flush_stdout()
}
.silent {}
@ -433,7 +433,7 @@ fn (upd VlsUpdater) check_installation() {
if upd.ls_path.len == 0 {
upd.log('Language server is not installed')
} else {
upd.log('Language server is installed at: $upd.ls_path')
upd.log('Language server is installed at: ${upd.ls_path}')
}
}
@ -457,7 +457,7 @@ fn (upd VlsUpdater) run(fp flag.FlagParser) ! {
}
}
} else if upd.pass_to_ls {
exit(os.system('$upd.ls_path ${upd.args.join(' ')}'))
exit(os.system('${upd.ls_path} ${upd.args.join(' ')}'))
} else if upd.is_help {
println(fp.usage())
exit(0)