Skip to content

fix: support Unicode identifiers in Java class name validation (#789)#993

Open
wenytang-ms wants to merge 3 commits intomainfrom
fix/unicode-java-identifier-789
Open

fix: support Unicode identifiers in Java class name validation (#789)#993
wenytang-ms wants to merge 3 commits intomainfrom
fix/unicode-java-identifier-789

Conversation

@wenytang-ms
Copy link
Copy Markdown
Contributor

Change isJavaIdentifier() regex from ASCII-only /^([a-zA-Z_$][a-zA-Z\d_$]*)$/ to Unicode-aware regex using ES2018 property escapes per JLS §3.8.

This allows non-ASCII identifiers (e.g., Japanese ほげ, Chinese 中文类名, accented Ñoño) to be accepted in the New Java File and Rename wizards.

Fixes #789

Change isJavaIdentifier() regex from ASCII-only /^([a-zA-Z_$][a-zA-Z\d_$]*)$/
to Unicode-aware regex using ES2018 property escapes per JLS §3.8.

This allows non-ASCII identifiers (e.g., Japanese ほげ, Chinese 中文类名,
accented Ñoño) to be accepted in the New Java File and Rename wizards.

Fixes #789

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wenytang-ms
Copy link
Copy Markdown
Contributor Author

before
08_type-japanese-name_after

fixed:
08_type-japanese-name_after

The .project file defined name '1.helloworld' but JDT LS may override it
with the folder name 'simple'. Align .project name with folder name to
eliminate the inconsistency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant