Highlights and inlay hints randomly get offset

未关闭
#272 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
tooling

调研方向

The payload names no files or tests, so start by reproducing: open a long Java file in Zed with this extension, make edits, and check whether highlights and parameter inlay hints drift further down the file, as the screenshots show. The reporter says a save refreshes the positions, so compare the positions the language server sends after an edit with the ones Zed renders. Done means the offset stops appearing after edits without a save, with a reproduction and a note on whether the cause is in the extension, Zed, or JDTLS.

由索引模型根据 Issue 内容生成。

描述

I don't know if this is a bug with the extension, Zed or JDTLS, but it has been happening for months so I figured I might as well report it and hopefully one of you guys here can find where the actual issue is.

Like the issue title says, there is a disconnect between the positions where highlights and inlay hints should be in the code and where Zed displays them.

Here is a screenshot of the parameter name inlay hints to show what I mean:
Image
And what it should look like:
Image

And here for highlights (I have the cursor inside lastName here):
Image

I haven't figured out what it is that triggers this; it just happens every now and then when I edit the code in a file. It also does not happen across the entire file; it starts at some point and then gradually gets worse the further down the file I go from there. If I make any change to the file and save it, the LSP will refresh the information and everything ends up in the right spot again (i.e. the offset issue disappears).

This is quite annoying, although not vital since it disappears after doing an edit and saving.


Zed: v1.6.3+stable.306.601ecb3ee5c16940191818ee7f244837abf6983c (Zed)
OS: Windows 10.0.26100
Memory: 31.7 GiB
Architecture: x86_64

主要语言
Rust
星标
225
派生
47
平均合并
3 小时 51 分钟
30 天内合并 PR
7

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

zed-extensions/java 的其他 Issue

查看 zed-extensions/java 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。