vscode-java-dependency icon indicating copy to clipboard operation
vscode-java-dependency copied to clipboard

"New > Java Class" wizard cannot create a class for Japanese identifiers.

Open jdneo opened this issue 2 years ago • 2 comments

Originally reported from https://github.com/redhat-developer/vscode-java/issues/3289

When I open the "New > Java Class" wizard and enter a Japanese class name, I receive the message "Invalid Java qualified name." and I am unable to create a Java class.

Environment
  • Operating System: Windows 11
  • JDK version: 17
  • Visual Studio Code version: 1.79.2
  • Java extension version: v0.25.14
Steps To Reproduce
  1. Select any package, right-click, and choose "New > Java Class."
  2. Enter Japanese characters as the class name. For example, "ほげ"
Current Result

It displays "Invalid Java qualified name."

Expected Result

The class is generated.

Additional Informations

In Java, we can use characters from languages such as Japanese and others in identifiers.

https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.8

jdneo avatar Sep 26 '23 02:09 jdneo

Root cause is here: https://github.com/microsoft/vscode-java-dependency/blob/2ba3227264d9c0967d409bebac9bbf9fb07e9d67/src/utility.ts#L92

jdneo avatar Sep 26 '23 02:09 jdneo