You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove "New Java File" submenu, etc. from Explorer context menu #909
This extension contributes a submenu "New Java File" and other commands like "New Java Package, etc." to the explorer context menu. I don't think this is consistent with the VS Code UI style: you won't see "New Typescript File" when editing a typescript project, for example.
What's more, these menus clutter the context menu even in workspaces that are not Java-related at all.
For creating new FIles, there is the file/newFilemenu (which is already contributed to)
Creating a new package is just creating folders and there is already support for that (you can just type in foo/bar in order to create a hierarchy
Creating a Java project is not context dependent and therefore should not be in a context menu: VS Code uses the command palette for this.
The "Create Java Project" command is contributed to the file/newFile menu, which again, IMO, goes against VS Code custom.
Hi Thomas Mäder (@tsmaeder), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
This is a feature‐request/enhancement to allow hiding Java-specific context-menu items when not editing Java files.
High-confidence reference:
Add option to disable right-click/context-menu elements
Provides exactly this request: a configuration option to disable the “Maven (submenu)”, “New Java File”, “New Java Package…”, and “New Java Project…” items. Track and upvote/update this issue for progress or discuss possible configuration keys. Add option to disable right-click/context-menu elements redhat-developer/vscode-java#4141
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Activity
github-actions commentedon Sep 23, 2025
Hi Thomas Mäder (@tsmaeder), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
High-confidence reference:
Provides exactly this request: a configuration option to disable the “Maven (submenu)”, “New Java File”, “New Java Package…”, and “New Java Project…” items. Track and upvote/update this issue for progress or discuss possible configuration keys.
Add option to disable right-click/context-menu elements redhat-developer/vscode-java#4141
Other references with low confidence
Another request to declutter the Explorer context menu by removing run/debug commands on non-runnable files. Not directly about “New Java File” but similar in spirit.
Filter out run and debug contextual menu when the file doesn't contain a Main vscode-java-debug#937
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!