Skip to content

fix(navigation): 找不到跳转目标时不返回空的 reveal - #17

Merged
xiaoyumuxi merged 1 commit into
mainfrom
fix/empty-reveal-locations
Dec 1, 2026
Merged

xiaoyumuxi merged 1 commit into
mainfrom
fix/empty-reveal-locations

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Contributor

问题

桌面端日志里点击 Java 行装饰(跳到实现 / 父声明)时出现:

editor_action … plugins.editorActions.decode: An action reveal has 1 to 100 locations with absolute URIs.

语言服务器没有找到目标时,javaNavigation.invoke 仍然返回 {"reveal":{"locations":[]}}。Core 只接受 1 到 100 个位置的 reveal,所以把整个答复判为无效。

改动

  • internal/backend/backend.go:没有目标时返回 {}(不带 reveal,Core 认为是“没有可跳转的位置”);目标超过 100 个时只保留前 100 个。
  • internal/backend/backend_test.go:在已有的 collect/invoke 端到端测试里补两种情况:语言服务器返回 0 个位置(答复不能有 reveal),返回 150 个位置(reveal 只留 100 个)。

验证

  • go test ./... 通过;去掉 backend.go 改动后新测试失败。
  • 没有在真实 Lithe 里点击验证,也没有发版(按修复规则下次发版升修订号)。

Core 只接受 1 到 100 个位置的 reveal。语言服务器没有找到实现或父声明时,
插件原来返回空的 locations,桌面端日志里报 plugins.editorActions.decode。
现在没有目标就不带 reveal,超过 100 个只保留前 100 个。
@xiaoyumuxi
xiaoyumuxi marked this pull request as ready for review December 1, 2026 09:15
@xiaoyumuxi
xiaoyumuxi merged commit 1ec43b3 into main Dec 1, 2026
5 checks passed

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

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