Improve text-selection/cursor behavior with inline code minings
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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 の本文から書いたものです。
説明
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日 2時間
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-platform/eclipse.platform.ui のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eclipse-platform/eclipse.platform.ui#4125 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-platform/eclipse.platform.ui#4016 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-platform/eclipse.platform.ui#3892 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
eclipse-platform/eclipse.platform.ui#2687 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
eclipse-platform/eclipse.platform.ui#4487 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
eclipse-platform/eclipse.platform.ui の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug new windows
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
GantMan/jail-monkey#380 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
objectionary/jucs#145 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
objectionary/lints#1559 ·
メンテナーはふだん 2 日以内に返信