From 7bcb99908b1d601a31a108a5697857d7c6aaf3dc Mon Sep 17 00:00:00 2001 From: kbkpbot Date: Fri, 7 Nov 2025 20:01:32 +0800 Subject: [PATCH 1/2] fix uri path --- interop.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interop.v b/interop.v index fffb98b8..f8e146e2 100644 --- a/interop.v +++ b/interop.v @@ -50,8 +50,10 @@ fn (mut app App) run_v_line_info(method Method, path string, line_info string) R } else { line_nr := fields[fields.len - 2].int() - 1 col := fields[fields.len - 1].int() + uri_path := os.to_slash(fields[..fields.len - 2].join(':')) + uri_header := if uri_path.starts_with('/') { 'file://' } else { 'file:///' } result = Location{ - uri: fields[..fields.len - 2].join(':') + uri: uri_header + uri_path range: LSPRange{ start: Position{ line: line_nr From 9e9f609dc31bf4b10ae6b1500b918821d694ffbb Mon Sep 17 00:00:00 2001 From: kbkpbot Date: Sun, 9 Nov 2025 16:55:36 +0800 Subject: [PATCH 2/2] parse all src dir files, not only text file in editor --- interop.v | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interop.v b/interop.v index f8e146e2..fc1149b6 100644 --- a/interop.v +++ b/interop.v @@ -6,10 +6,12 @@ import time fn (mut app App) run_v_check(path string, text string) []JsonError { tmppath := os.join_path(os.temp_dir(), os.file_name(path)) + src_file := path.all_after('file://') + src_path := os.dir(src_file) log('WRITING FILE ${time.now()} ${path}') os.write_file(tmppath, text) or { panic(err) } log('running v.exe check') - cmd := 'v -w -vls-mode -check -json-errors "${tmppath}"' + cmd := 'v -w -vls-mode -check -json-errors "${tmppath}" -path "${src_path}|@vlib|@vmodules" -exclude "${src_file}"' log('cmd=${cmd}') x := os.execute(cmd) log('RUN RES ${x}') @@ -26,10 +28,12 @@ fn (mut app App) run_v_check(path string, text string) []JsonError { fn (mut app App) run_v_line_info(method Method, path string, line_info string) ResponseResult { tmppath := os.join_path(os.temp_dir(), os.file_name(path)) + src_file := path.all_after('file://') + src_path := os.dir(src_file) log('WRITING FILE ${time.now()} ${path}') os.write_file(tmppath, app.text) or { panic(err) } log('running v.exe line info!') - cmd := 'v -w -check -json-errors -nocolor -vls-mode -line-info "${tmppath}:${line_info}" ${tmppath}' + cmd := 'v -w -check -json-errors -nocolor -vls-mode -line-info "${tmppath}:${line_info}" ${tmppath} -path "${src_path}|@vlib|@vmodules" -exclude "${src_file}"' log('cmd=${cmd}') x := os.execute(cmd) log('RUN RES ${x}')