Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 552
fzlakers Avatar asked Sep 11 '25 04:09

fzlakers


2 Answers

Try this: Right click >> Source Action

See here for a list of actions.

  1. Right click and select 'Source Action' enter image description here

  2. Select 'Generate Getters and Setters...' enter image description here

  3. Select fields of class and click ok. enter image description here

like image 116
Galip Çalışkan Avatar answered Sep 12 '25 17:09

Galip Çalışkan


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.

The solution posted by Madhu works. I added the image below for anyone to follow along.

enter image description here

like image 32
Madhu Sharma Avatar answered Sep 12 '25 18:09

Madhu Sharma