Repository navigation
Fixed several issues in the clink_vfox.lua script - #724
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #724 +/- ##
=======================================
Coverage 34.99% 34.99%
=======================================
Files 95 95
Lines 6704 6704
=======================================
Hits 2346 2346
Misses 4045 4045
Partials 313 313 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
linghengqian
left a comment
There was a problem hiding this comment.
-
It is not yet ready for merging. Although the CI tests have passed, the flags are correctly synchronized with the CLI, and the fix in
vfox_setenv—which splits strings at the first=character—properly handles values that contain=signs, there remain some functional issues withininternal/shell/clink_vfox.lua. -
Based on the logic in
cmd/commands/unuse.go, theunusecommand accepts only the raw SDK name (excluding the version number). Therefore, it should not reuse the autocompleter designed for theuseandexeccommands, which prompts for ansdk@versionformat. Furthermore, the matching patterns used by theavailableandlscommands—[%w%-]and^%W*(%w.*)—are too restrictive; they fail to match names containing underscores or dots. A more robust approach would be to use(%S+)while properly handling any leading whitespace. Additionally, the method of matching[✓✗]by byte is fragile. The documentation also fails to mention the newly introduced__VFOX_SHELLvariable or the "skip if unchanged" safeguard; given thatinternal/shell/clink.goalready outputs__VFOX_SHELL, it is unclear whether this addition is intentional. -
I recommend fixing the autocompleter for
unuse, broadening the name-matching patterns, and documenting the design rationale behind__VFOX_SHELL. Since the current Windows CI tasks and Go tests do not cover this script, please ensure it is verified in a Windows/Clink environment before merging.
2. Update the autocompleter for `vfox unuse`
Lines 194 to 201 in 9aef814 the program produces output every time a command is run, even when cached data is present. This causes the environment variables to be set repeatedly whenever the script is executed; consequently, I have implemented a check within my Lua script to ensure that environment variables are only updated when a change is actually detected.
vfox/cmd/commands/available.go Lines 59 to 69 in 9aef814 Need to extract only the data from lines that contain [✓✗], Therefore, the regular expression is changed to
Lines 62 to 65 in 9aef814 Therefore, the regular expression is changed to |
linghengqian
left a comment
There was a problem hiding this comment.
I’ve left a note regarding the unit tests at #728 , as they require refactoring. As for this PR, LGTM.
vfox availableandvfox lscommands has changed; parsing scripts will need to be updated.vfox_setenvto use the first=sign as the delimiter.unuse,exec, andx.