Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new setting to capitalize Key #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.5.4

Added new setting to capitalize Key

## 0.5.0

Added support for enums
Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Dart Data Class Generator",
"description": "Create dart data classes easily, fast and without writing boilerplate or running code generation.",
"publisher": "dotup",
"version": "0.5.3",
"version": "0.5.4",
"engines": {
"vscode": "^1.37.0"
},
Expand Down Expand Up @@ -209,6 +209,15 @@
],
"default": false,
"description": "If true, uses equatable for value equality and hashcode."
},
"dart_data_class_generator.capitalize.enabled": {
"type": "boolean",
"enum": [
true,
false
],
"default": false,
"description": "If true, the key will be capitalized."
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ class ClassField {
this.rawType = type;
this.name = toVarName(name);
this.key = json ? name : varToKey(this.name);
if (readSetting('capitalize.enabled')) this.key = capitalize(this.key);
this.line = line;
this.isFinal = isFinal;
this.isConst = isConst;
Expand Down