Repository navigation
fix(navigation): 找不到跳转目标时不返回空的 reveal - #17
Merged
Merged
Conversation
Core 只接受 1 到 100 个位置的 reveal。语言服务器没有找到实现或父声明时, 插件原来返回空的 locations,桌面端日志里报 plugins.editorActions.decode。 现在没有目标就不带 reveal,超过 100 个只保留前 100 个。
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
桌面端日志里点击 Java 行装饰(跳到实现 / 父声明)时出现:
语言服务器没有找到目标时,
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 改动后新测试失败。