Repository navigation
Terminal: keep CJK sentence and list punctuation out of local file links - #350145
wonjang (wonjangcloud9) wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
wonjang (@wonjangcloud9) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the CJK punctuation handling change in terminal file links.
No open issues 🎉
What changed in this PR
Fixes #318709 by treating CJK sentence and list punctuation as boundaries in terminal local file links, preventing surrounding text from invalidating paths.
Changes:
- Adds seven CJK punctuation characters to POSIX and Windows path exclusions.
- Preserves bracket-like CJK characters that may belong to filenames.
- Adds regression tests for localized output and multiple paths on Linux and Windows.
Validation reported in the PR used a custom test shim, not the repository’s test runner.
| File | Description |
|---|---|
src/vs/workbench/contrib/terminalContrib/links/test/browser/terminalLinkParsing.test.ts |
Adds cross-platform CJK punctuation regression cases. |
src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing.ts |
Excludes CJK sentence and list punctuation from path starts and bodies. |
Review effort: Balanced
Fixes #318709
Local file link detection in the terminal treats
:,。、;!?as part of a path. A path in localized or AI-written output then takes the surrounding sentence with it, and file validation fails:main请打开文件:src/main.ts。请打开文件:src/main.ts。src/main.ts問題在:src/utils.ts,建議檢查。問題在:src/utils.ts,建議檢查。src/utils.ts関連ファイル:src/a.ts、src/b.ts。src/a.ts,src/b.ts请检查:src/view.ts!是否存在:src/utils.ts?src/view.ts,src/utils.ts파일:src/a.ts,src/b.ts 확인파일:src/a.ts,src/b.tssrc/a.ts,src/b.tsThe ASCII equivalents (
:;!?) are already excluded inRegexPathConstants, andlinkComputer.tsalready ends URLs at、。,:;. This adds U+3001, U+3002 and fullwidth! , : ; ?(U+FF01, U+FF0C, U+FF1A, U+FF1B, U+FF1F) to the four excluded-character clauses (POSIX and Windows, start and body). The ideographic space U+3000 is already covered by\s. As the issue suggests, bracket-like punctuation (《》「」()【】) is left alone, since it can be part of a real file name. Escapes keep the source ASCII.Tests: a new
CJK punctuation (#318709)suite interminalLinkParsing.test.tscovers the lines above for bothOperatingSystem.LinuxandOperatingSystem.Windows. I ran that file under bun with a small mocha shim, not the repo's runner. With the change: 428 pass, 0 fail. Without it: the two new tests fail, and the other 426 pass either way.404bro offered to do this in June. I didn't find a PR from them, so I went ahead. Happy to defer if one is in progress.
🤖 Generated with Claude Code