redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 433 forks source link

Quick fix - "Create field..." breaks code v1.35.0 #3790

Closed UnnamedXAer closed 1 day ago

UnnamedXAer commented 1 day ago

When using Quick fix to create field/local variable part of an existing code is being removed.

Environment
Steps To Reproduce
  1. inside method in a class "assign" value to non-existing field, then use Quick fix... to create that field.
public class Test {
    void set() {
      xx = new String(); // use quick fix -> create field.
    }
  }

20240930-101558_7

Current Result

Field is not created. Part of the existing code is removed.

Expected Result

Class field is created.

Additional Informations

Works with version: 1.34.0

UnnamedXAer commented 1 day ago

already reported