Skip to content

Preserve Case Hyphen and Underscore replacement issues #81779

@skprabhanjan

Description

@skprabhanjan

@roblourens ,
Replace string functionality in search does not work properly for hyphen and underscore separated variables , Initially figured it out from this comment
Example:

  • ReplacingFoo-Barto test-replace with preserve case turned on replaces correctly to Test-Replace
  • Replacing foo-Bar to test-replace with preserve case turned on replaces incorrectly to test-replace instead of test-Replace

PS : Additional Info from the code
I found out there is a bug in buildReplaceStringWithCasePreserved function.
The whole idea to call the replacement function again at this line was to reuse the already existing replacement logic ( First char capital , full caps and full small) but there was a bug as the hyphens and underscores were not even called because of wrong ordering in the condition checking logic.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugsearchSearch widget and operation issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions