Skip to content

feat(output-links): 运行控制台里的网址可点击 - #84

Merged
1lck merged 2 commits into
mainfrom
feat/console-url-links
Nov 17, 2026
Merged

1lck merged 2 commits into
mainfrom
feat/console-url-links

Conversation

@1lck

@1lck 1lck commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

关联 Issue

类型

feat:outputLinkMatchers 0 内的补充,outputLinks.match 额外返回网址链接

改动

Spring Boot、Vite 等服务启动后把访问地址打印在控制台里,IDEA 里可以直接点开;Lithe 的控制台链接只来自插件声明的匹配器,网址点不了。网址格式与工具无关,所以由 Core 统一识别,所有宿主行为一致。

  • rust/crates/plugin-output-links/src/lib.rs:match_lines 跑完插件匹配器后,用 web_addresses 找 http/https 网址,链接形如 {line, start, length, url},不带 pluginID/matcherID。
    • 网址止于空白、引号、反引号、尖括号和控制字符;去掉句末的 .,;:!? 和没有配对的 )、]、}(https://example.org/a_(b) 保留括号);只有协议没有主机的不算。
    • 和插件链接重叠时插件链接优先;每行 8 个链接的上限不变;一行内的链接按起点排序返回。
  • 契约 README「Output link matchers」一节、rust/contracts/rust-core-api.md 写明新链接形状和规则。
  • fixture fixtures/run/output-link-matchers.json 新增一例:网址、括号内网址、和插件链接同一行的网址。
  • 插件协议更新记录加一行。

清单格式、能力版本不变,插件无需改动;旧宿主遇到 url 链接时,只认 location/resolve,不会打开它。没有新增宿主方法或通知。

验证

  • cargo test -p lithe-plugin-output-links(新增 2 个单测)
  • cargo test -p lithe-core output_link(fixture 回放)
  • cargo clippy -p lithe-plugin-output-links --all-targets -- -D warnings
  • node shared/plugins/scripts/verify-docs.mjs

🤖 Generated with Claude Code

1lck and others added 2 commits November 17, 2026 07:15
outputLinks.match 在插件链接之后识别 http/https 网址,返回 {line,start,length,url},
宿主在浏览器中打开。网址止于空白、引号、尖括号,去掉句末标点和未配对的右括号;
与插件链接重叠时插件链接优先。一行内的链接按起点排序。(1lck/Lithe-IDEA#1822)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck
1lck marked this pull request as ready for review November 17, 2026 15:17
@1lck
1lck merged commit 10da502 into main Nov 17, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant