Skip to content

[bean completion proposals] assignment in constructor not generated #1497

Closed

Description

@martinlippert

I have a class that looks like this:

@RestController
public class MyController {

    MyController(TestBean1 testBean1) {
    }

    @GetMapping("/greeting")
    public String sayHello() {
        this.testBean1<*>
        return "Hello Greeting";
    }

}

When I invoke the bean completion for a bean with name testBean1 of type TestBean1, the field is generated, but not the assignment inside of the constructor. The result looks like:

@RestController
public class MyController {

    private final TestBean1 testBean1;

    MyController(final TestBean1 testBean1) {
    }

    @GetMapping("/greeting")
    public String sayHello() {
        this.testBean1<*>
        return "Hello Greeting";
    }

}

Activity

  1. added this to the 4.29.0.RELEASE milestone on Mar 3, 2025
  2. added
    for: vscode
    and removed on Mar 3, 2025
  3. BoykoAlex commented on Mar 3, 2025

    @BoykoAlex
    Contributor

    Fixed via edd78c0

  4. changed the title [-][bean completion proposals] assignment in constructor nor generated[/-] [+][bean completion proposals] assignment in constructor not generated[/+] on Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: vscodetheme: code completiontype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions