Skip to content

Casing transforms in snippets only support Latin characters #286165

@dmitrivMS

Description

@dmitrivMS

Testing #233798

Use the following snippet:

"testSnippet": {
  "scope": "javascript,typescript",
  "prefix": "testSnippet",
  "body": "${1} -> ${1/(.*)/${1:/upcase} ${1:/downcase} ${1:/camelcase} ${1:/pascalcase} ${1:/kebabcase} ${1:/snakecase}/}"
}

Give it input oneTwo you will get oneTwo -> ONETWO onetwo oneTwo OneTwo one-two one_two which is correct.
Give it input одинДва you will get одинДва -> ОДИНДВА одиндва одинДва одинДва одинДва одиндва which is incorrect as non-Latin letters are not handled correctly (in this case Russian alphabet, but code only cares about a-z).

We should probably use Unicode definition of words if possible to perform the case transforms.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiessnippets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions