redhat-developer / redhat-developer/vscode-java

New Java File -> Class/Interface option defaults file name to public class Main {.java

Open
#3,725 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

New Java File -> Class/Interface option defaults file name to public class Main {.java

[provide a description of the issue]

Environment
  • Operating System:
  • JDK version:
  • Visual Studio Code version:
  • Java extension version:
Steps To Reproduce
  1. Open Explorer
  2. New Java File -> Class/Interface
  3. Change the class name
  4. Save

[Please attach a sample project reproducing the error]
Please attach logs

Current Result

Class file name includes the first class line, not just a class name

Expected Result

Expect only file name like Main.java
Screenshot 2024-07-28 at 12 31 08

Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Explorer's New Java File -> Class/Interface flow, including changing the class name before saving. Verify the generated filename and compare it with the expected class name plus the .java extension; done means the filename no longer includes the first class line.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.