-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesIssue/pull request mentioned in release notessnippetsverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded
Milestone
Description
VS Code snippet transform syntax supports converting capture groups to a variety of formats, including lowercase, camelCase, and PascalCase. Support for snake_case would be awesome.
This feature would be helpful when trying to define a snippet that automatically adds a json struct tag to Go fields, for example:
type Person struct {
FirstName `json:"first_name"`
}This is the snippet definition I'm using right now, though it's buggy:
"property with JSON and YAML": {
"prefix": "prop",
"body": [
"${1:name} ${2:string} `yaml:\"${1/([A-Z]?[a-z]+)([A-Z])/${1:/downcase}_${2:/downcase}/g}\" json:\"${1/([A-Z]?[a-z]+)([A-Z])/${1:/downcase}_${2:/downcase}/g}\"`"
],
},Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesIssue/pull request mentioned in release notessnippetsverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded