mirror of
https://github.com/zhukunpenglinyutong/jetbrains-cc-gui.git
synced 2026-09-19 01:43:54 +08:00
Extract looksLikePathSegment into webview/src/utils/pathSegment.ts so the display-side scanner (CollapsibleTextBlock) and the input-side fallback scanner (useFileTags) share one rule: a word after a space continues the path when it contains a path separator or ends with a file extension, with any trailing #L line marker stripped first. PR #1576 applied this rule only to message display; the chat input box still truncated absolute paths whose filenames contain spaces (e.g. "第六章 框架开发实践.md"), and its comment promised extension support the code did not have. Reuse the shared helper there, sync the comments, and move the misplaced convertAtFileRefsToLinks docstring back to its function. Tests: new pathSegment.test.ts unit tests; useFileTags.test.ts gains fallback cases for spaced absolute paths with and without line markers.