redhat-developer / redhat-developer/vscode-java

Autoimport on accepting a suggestion moves cursor when "quickSuggestions" is set to "inline"

Open
#3,566 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

When a class is automatically imported as a result of accepting an "inline" suggestion, an import line is added at the top of the file which moves other lines down by 1 or 2. However, the cursor remains at the same position which makes it feel like the cursor was moved on autoimport. This problem does not occur if "quickSuggestions" is set to "on".

Environment
  • Operating System: Windows 10
  • Visual Studio Code version: 1.87.2
  • Java extension version: 1.29.0
Steps To Reproduce
  1. Set "editor.quickSuggestions": { "other": "inline" } in settings.json
  2. Start typing a name of a not imported class
  3. Accept the suggestion
  4. An import line appears moving other lines down. The cursor, however, doesn't move along

Here's a demonstration.

https://github.com/redhat-developer/vscode-java/assets/61470425/a8633375-7f19-4ecb-b4f9-920e813c9b59

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in Visual Studio Code 1.87.2 with the Java extension and the editor.quickSuggestions setting in settings.json. Compare accepting an unimported class with inline versus on, then trace how the added import affects the cursor position. Done means the cursor follows the accepted text when an import line is inserted.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.