Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Improve text-selection/cursor behavior with inline code minings

未关闭
#3,758 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
desktop

调研方向

The issue does not identify files or tests; start by tracing how inline code minings affect editor cursor positions and text selection. Reproduce the two examples with code minings enabled and compare the behavior with the expected placement and selection described here. Done means the cursor can be placed on either side of a mining and selections can include or exclude it without losing adjacent characters.

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

描述

enhancement

I often use Editors which make use of inline code minings, for example in JDT or LSP4E.
However, I often find myself in a situation, where I think that code minings lead to unintuitive text-selection and cursor behavior.

Example 1 (Cursor Placement):

public class Foo {
    public static void bar(final String someReallyLongArgument) {
        //
    }

    public static void bar(final String anotherArgument, final String someReallyLongArgument) {
        //
    }
}

I'm calling this function somewhere and with code minings it is rendered as:

bar(someReallyLongArgument: "abc");

Now I want to switch to the overloaded version of the same method. To do so, I have to add an argument at the first position. Intuitively, I want to position my cursor between bar( and someR..., but I cant. Instead I have to place the cursor after someReallyLongArgument: , which feels really unintuitive.

Example 2 (Text Selection):

Consider the following Python Code used with LSP4E:

foobar = [1, "test"]

Using a Python LS with type inference, such as basedpyright, we get the following code, were the added text is a code mining representing an inlay hint from the LS:

foobar: list[int | str] = [1, "test"]

Now, If I want to select the variable "foobar" by holding down my left mouse button and moving the mouse, I can at most select "fooba", the remaining character is only included in the selection when I move the mouse further to the right to also include the code mining : list[int | str].
Here is a small video of that situation:
https://github.com/user-attachments/assets/eaddb82d-cdcf-4593-a45c-052b425f9629

In VS Code, neither of the above problems are present, i.e.,

  • I can place the cursor directly before or after a code mining, even though that's the same offset in the underlying document
  • I can create a text selection including or excluding a code mining, even though the content of the text selection is the same.

I haven't looked at the relevant code, but I'm assuming the underlying problem is that the code minings are fused with the preceding characters to have a unique mapping between document offsets and cursor positions in the document?

主要语言
Java
星标
124
派生
269
平均合并
2 天 5 小时
30 天内合并 PR
65

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

eclipse-platform/eclipse.platform.ui 的其他 Issue

查看 eclipse-platform/eclipse.platform.ui 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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