Option for generating getters and setters not showing up on VS Code

Viewed 12341

So I'm trying to make a project using Spring Boot and I had been able to use the "Generate Setters/Getters" button before on this same file but for some reason that option is no longer available in the dropdown. Could someone provide an explanation for why this is and what may have happened to this option?

2 Answers

You might be missing the add on "Java Code Generators" which you can download from the marketplace. I installed this and I was able to generate getters and setters.

Solution posted by Madhu works. Just adding image for anyone to easy follow.

enter image description here

Ah, I figured it out, apparently import lombok.Data handles all getters, setters, and other stuff in the background. This had the unexpected result of getting rid of the generate getters/setters option in the dropdown menu. I got rid of this import in the code and the menu option was back.

Related