redhat-developer / redhat-developer/vscode-java

auto completion inserting already-existing text ("overwrite" to the right)

Đang mở
#3,312 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
546
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

code completion unnecessarily not "overwriting" to the right (Java specific? language specific fixes with compile-check "smarter" "smart" acceptSuggestion possible)

TLDR; just look below at image attachments (step 1, 2, 3)

at the basic, this isn't language specific, but language enhancements possible

"overwriting" or "contextual insert" or "surrounding check" or "duplicate surround text" might be a better term

Not sure where to file this at the "editor." level

filing in vscode-java for language specific completion enhancement ability (less so for compile check, mores to not overwrite text that is suppose to be repeated, but ymmv)

discussion

fixes would include:

  1. just don't write duplicate text
  2. a property with options (as its possibly "destructive", though I'd prefer the "destructive" option here)
  3. language specific fix (bonus: detect which actually compiles)

between image 2 and image 3, both [tab] and [enter] seem to have the same results, so maybe this could be considered in configuration (on tab, check/replace same surrounding text, on enter just insert)

tried following settings, no difference observed:

"editor.acceptSuggestionOnEnter": "smart",
"editor.acceptSuggestionOnEnter": "on",

wanted:

"editor.acceptSuggestionOnEnter": "overwrite" or ("replacesame"),
"java.completion.acceptReplaceMode": "compile"

or
"editor.acceptSuggestionSurroundMode": {
 "replaceSame": ,
}

Also, separately, but not,

  1. editor.suggest isn't ordering by preexisting surround text
  2. language-specific e.g. "java.completion.orderByPriorityStaticMode": "preexisting" surround check could handle ordering better
  3. bonus language-specific e.g. "java.completion.orderByPriorityCompileCheck": "true" surround check could handle ordering
Environment
  • Operating System: N/A
  • JDK version: N/A
  • Visual Studio Code version: 1.82.2
  • Java extension version: 1.22.1
  • Java Debugger extension version: N/A
Steps To Reproduce

Here's a simple setter-to-fluent workflow change, but I seem to hit this case of not looking at preexisting text to the right

vscode-completion1
vscode-completion2
vscode-completion3

Current Result

see image 3

Expected Result
  1. don't not overwrite the same text as is being replaced (no idea about ALL cases, but something could be done, but maybe language specific)
  2. property options on "surrounding smartness"
Additional Informations

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện quy trình setter-to-fluent với các phiên bản VS Code và vscode-java được liệt kê, so sánh Tab và Enter cùng các cài đặt đề xuất được chỉ định. Không có tệp mã nguồn hoặc bài kiểm thử nào được nêu, vì vậy trước tiên hãy xác định hành vi chấp nhận hoàn tất của trình soạn thảo và tích hợp của nó với tiện ích mở rộng Java. Được coi là hoàn tất khi văn bản xung quanh không bị chèn trùng và cấu hình dự kiến hoặc hành vi đặc thù của ngôn ngữ được xác minh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, typescript, vscode
Lĩnh vực
developer-experience, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.