Drex
Drex

Reputation: 3851

Missing "Source Action" context menu for VS Code Java Programming

I am a VS Code fan and recently jumps in programming with Java in VS Code, I've seen some very fancy coding helpful tool with VS Code so I installed "VS Code Java Pack Installer" from Microsoft following this tutorial, in addition I've seen there is a lot of useful code snippet from VS Code such as generating a class constructor, overriding method or code refactor from Microsoft link - Editing Code, most of them are with a context menu option called "Source Action", however, I cannot find such option when right click in my defined class like the document shows, and I don't have context menu such as "Rename Symbol" when right clicking on my java file, am I missing some settings or extensions here?

Upvotes: 2

Views: 3579

Answers (2)

RLD
RLD

Reputation: 2005

You can see 'Source Action' context menu by following one of the steps.

  1. Click the 'Standard Mode' icon in the status bar. The icon might be available towards bottom-right side of the status bar.

  2. Select 'Run' > 'Add Configuration...'. There you select 'Java'.

Upvotes: 0

Holly Cummins
Holly Cummins

Reputation: 11492

This was puzzling me as well. I eventually realised what I needed was standard mode rather than lightweight mode. Under the covers, in standard mode, it seems to be running a Java server, which I guess is why it's off by default.

I found the easiest way to enable standard mode was to open a Java unit test, and right click 'run' in the context menu. That will prompt VS Code to offer standard mode. After clicking 'yes' and waiting for the server to be fired up, the Source Action and Refactor menu options are there.

Upvotes: 2

Related Questions