prettier 1.5.4 → 2.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +338 -276
- data/CONTRIBUTING.md +8 -11
- data/LICENSE +1 -1
- data/README.md +31 -14
- data/dist/haml/embed.js +53 -0
- data/dist/haml/parser.js +31 -0
- data/{src → dist}/haml/parser.rb +8 -1
- data/dist/haml/printer.js +336 -0
- data/dist/parser/getInfo.js +17 -0
- data/{src → dist}/parser/netcat.js +1 -0
- data/dist/parser/parseSync.js +128 -0
- data/dist/parser/server.rb +140 -0
- data/dist/plugin.js +143 -0
- data/dist/prettier.js +15 -0
- data/dist/rbs/parser.js +34 -0
- data/{src → dist}/rbs/parser.rb +7 -1
- data/dist/rbs/printer.js +517 -0
- data/dist/ruby/embed.js +110 -0
- data/dist/ruby/nodes/alias.js +59 -0
- data/{src → dist}/ruby/nodes/aref.js +26 -35
- data/dist/ruby/nodes/args.js +165 -0
- data/dist/ruby/nodes/arrays.js +126 -0
- data/dist/ruby/nodes/assign.js +41 -0
- data/dist/ruby/nodes/blocks.js +68 -0
- data/dist/ruby/nodes/calls.js +220 -0
- data/dist/ruby/nodes/case.js +50 -0
- data/dist/ruby/nodes/class.js +54 -0
- data/dist/ruby/nodes/commands.js +124 -0
- data/dist/ruby/nodes/conditionals.js +242 -0
- data/dist/ruby/nodes/constants.js +38 -0
- data/dist/ruby/nodes/flow.js +66 -0
- data/dist/ruby/nodes/hashes.js +130 -0
- data/dist/ruby/nodes/heredocs.js +30 -0
- data/dist/ruby/nodes/hooks.js +35 -0
- data/dist/ruby/nodes/ints.js +27 -0
- data/dist/ruby/nodes/lambdas.js +69 -0
- data/dist/ruby/nodes/loops.js +73 -0
- data/dist/ruby/nodes/massign.js +73 -0
- data/dist/ruby/nodes/methods.js +70 -0
- data/dist/ruby/nodes/operators.js +70 -0
- data/dist/ruby/nodes/params.js +89 -0
- data/dist/ruby/nodes/patterns.js +109 -0
- data/dist/ruby/nodes/regexp.js +45 -0
- data/dist/ruby/nodes/rescue.js +82 -0
- data/dist/ruby/nodes/return.js +75 -0
- data/dist/ruby/nodes/statements.js +111 -0
- data/dist/ruby/nodes/strings.js +218 -0
- data/dist/ruby/nodes/super.js +30 -0
- data/dist/ruby/nodes/undef.js +26 -0
- data/dist/ruby/nodes.js +151 -0
- data/dist/ruby/parser.js +34 -0
- data/{src → dist}/ruby/parser.rb +1276 -290
- data/dist/ruby/printer.js +125 -0
- data/dist/ruby/toProc.js +93 -0
- data/dist/types/haml.js +4 -0
- data/dist/types/plugin.js +3 -0
- data/dist/types/rbs.js +4 -0
- data/dist/types/ruby.js +4 -0
- data/dist/types/utils.js +2 -0
- data/dist/types.js +30 -0
- data/dist/utils/containsAssignment.js +15 -0
- data/dist/utils/getTrailingComma.js +6 -0
- data/dist/utils/hasAncestor.js +15 -0
- data/{src → dist}/utils/inlineEnsureParens.js +16 -16
- data/dist/utils/isEmptyBodyStmt.js +10 -0
- data/dist/utils/isEmptyStmts.js +10 -0
- data/dist/utils/literal.js +8 -0
- data/dist/utils/literallineWithoutBreakParent.js +8 -0
- data/dist/utils/makeCall.js +13 -0
- data/dist/utils/noIndent.js +11 -0
- data/dist/utils/printEmptyCollection.js +44 -0
- data/dist/utils/skipAssignIndent.js +15 -0
- data/dist/utils.js +30 -0
- data/node_modules/prettier/bin-prettier.js +13343 -10961
- data/node_modules/prettier/doc.js +4829 -0
- data/node_modules/prettier/index.js +24010 -22251
- data/node_modules/prettier/package.json +23 -0
- data/node_modules/prettier/parser-angular.js +66 -0
- data/node_modules/prettier/parser-babel.js +22 -0
- data/node_modules/prettier/parser-espree.js +22 -0
- data/node_modules/prettier/parser-flow.js +22 -0
- data/node_modules/prettier/parser-glimmer.js +1 -0
- data/node_modules/prettier/parser-graphql.js +1 -0
- data/node_modules/prettier/parser-html.js +132 -0
- data/node_modules/prettier/parser-markdown.js +34 -0
- data/node_modules/prettier/parser-meriyah.js +22 -0
- data/node_modules/prettier/parser-postcss.js +22 -0
- data/node_modules/prettier/parser-typescript.js +22 -0
- data/node_modules/prettier/parser-yaml.js +15 -0
- data/node_modules/prettier/third-party.js +1734 -862
- data/package.json +27 -19
- data/rubocop.yml +9 -0
- metadata +88 -79
- data/src/haml/embed.js +0 -87
- data/src/haml/nodes/comment.js +0 -27
- data/src/haml/nodes/doctype.js +0 -34
- data/src/haml/nodes/filter.js +0 -16
- data/src/haml/nodes/hamlComment.js +0 -21
- data/src/haml/nodes/plain.js +0 -6
- data/src/haml/nodes/root.js +0 -8
- data/src/haml/nodes/script.js +0 -33
- data/src/haml/nodes/silentScript.js +0 -59
- data/src/haml/nodes/tag.js +0 -193
- data/src/haml/parser.js +0 -22
- data/src/haml/printer.js +0 -28
- data/src/parser/getLang.js +0 -32
- data/src/parser/getNetcat.js +0 -57
- data/src/parser/parseSync.js +0 -43
- data/src/parser/requestParse.js +0 -74
- data/src/parser/server.rb +0 -66
- data/src/plugin.js +0 -148
- data/src/prettier.js +0 -16
- data/src/rbs/parser.js +0 -39
- data/src/rbs/printer.js +0 -605
- data/src/ruby/embed.js +0 -142
- data/src/ruby/nodes/alias.js +0 -73
- data/src/ruby/nodes/args.js +0 -178
- data/src/ruby/nodes/arrays.js +0 -162
- data/src/ruby/nodes/assign.js +0 -47
- data/src/ruby/nodes/blocks.js +0 -90
- data/src/ruby/nodes/calls.js +0 -199
- data/src/ruby/nodes/case.js +0 -65
- data/src/ruby/nodes/class.js +0 -64
- data/src/ruby/nodes/commands.js +0 -131
- data/src/ruby/nodes/conditionals.js +0 -280
- data/src/ruby/nodes/constants.js +0 -43
- data/src/ruby/nodes/flow.js +0 -74
- data/src/ruby/nodes/hashes.js +0 -164
- data/src/ruby/nodes/heredocs.js +0 -36
- data/src/ruby/nodes/hooks.js +0 -34
- data/src/ruby/nodes/ints.js +0 -31
- data/src/ruby/nodes/lambdas.js +0 -76
- data/src/ruby/nodes/loops.js +0 -98
- data/src/ruby/nodes/massign.js +0 -98
- data/src/ruby/nodes/methods.js +0 -74
- data/src/ruby/nodes/operators.js +0 -83
- data/src/ruby/nodes/params.js +0 -113
- data/src/ruby/nodes/patterns.js +0 -157
- data/src/ruby/nodes/regexp.js +0 -56
- data/src/ruby/nodes/rescue.js +0 -101
- data/src/ruby/nodes/return.js +0 -94
- data/src/ruby/nodes/statements.js +0 -142
- data/src/ruby/nodes/strings.js +0 -177
- data/src/ruby/nodes/super.js +0 -35
- data/src/ruby/nodes/undef.js +0 -42
- data/src/ruby/nodes.js +0 -34
- data/src/ruby/parser.js +0 -39
- data/src/ruby/printer.js +0 -138
- data/src/ruby/toProc.js +0 -105
- data/src/utils/containsAssignment.js +0 -11
- data/src/utils/getTrailingComma.js +0 -5
- data/src/utils/hasAncestor.js +0 -17
- data/src/utils/isEmptyBodyStmt.js +0 -7
- data/src/utils/isEmptyStmts.js +0 -11
- data/src/utils/literal.js +0 -7
- data/src/utils/literallineWithoutBreakParent.js +0 -7
- data/src/utils/makeCall.js +0 -14
- data/src/utils/noIndent.js +0 -11
- data/src/utils/printEmptyCollection.js +0 -49
- data/src/utils/skipAssignIndent.js +0 -10
- data/src/utils.js +0 -13
data/CHANGELOG.md
CHANGED
@@ -6,78 +6,136 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.0.0-rc1]
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- [#949](https://github.com/prettier/plugin-ruby/pull/949) - kddnewton - Converted over to using TypeScript for development.
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
- [#958](https://github.com/prettier/plugin-ruby/issues/958) - mharris-figma, kddnewton - Handle optional `do` keyword in `for` loop expressions.
|
18
|
+
- [#926](https://github.com/prettier/plugin-ruby/issues/926) - jscheid, kddnewton - Better error handling in case certain expected keywords or operators are missing.
|
19
|
+
- [#819](https://github.com/prettier/plugin-ruby/issues/819) - coisnepe, kddnewton - Ensure that comments placed immediately after the left parenthesis of a method definition are not moved into the body of the methods.
|
20
|
+
- [#957](https://github.com/prettier/plugin-ruby/issues/957) - azz, kddnewton - Make it so that the format pragma does not have to be on the first line of the file.
|
21
|
+
- [#895](https://github.com/prettier/plugin-ruby/issues/895) - rsslldnphy, kddnewton - Ensure quotes are properly escaped in the content of a hash value for HAML attributes.
|
22
|
+
- [#900](https://github.com/prettier/plugin-ruby/issues/900) - rsslldnphy, kddnewton - Ensure that in a HAML line where you have interpolation inside of a tag content that you print it properly.
|
23
|
+
- [#929](https://github.com/prettier/plugin-ruby/issues/929) - ryanb, kddnewton - Deeply nested blocks should not break their call chains.
|
24
|
+
- [#935](https://github.com/prettier/plugin-ruby/pull/935) - nbudin, mlauter - Ensure embedded formatting heredocs are properly indented.
|
25
|
+
- [#975](https://github.com/prettier/plugin-ruby/pull/975) - kddnewton - Refactor the way we determine how to connect to the parser server.
|
26
|
+
|
27
|
+
### Removed
|
28
|
+
|
29
|
+
- [#976](https://github.com/prettier/plugin-ruby/pull/976) - kddnewton - Remove the `rubyNetcatCommand` option, as it should no longer be necessary.
|
30
|
+
|
31
|
+
## [1.6.1] - 2021-06-30
|
32
|
+
|
33
|
+
### Changed
|
34
|
+
|
35
|
+
- [#862](https://github.com/prettier/plugin-ruby/issues/862) - azz, kddnewton - Group together `.where.not` calls in method chains.
|
36
|
+
- [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddnewton - Fix up Sorbet `sig` block formatting when chaining method calls.
|
37
|
+
- [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddnewton - Method chains with blocks should be properly indented.
|
38
|
+
- [#916](https://github.com/prettier/plugin-ruby/issues/916) - pbrisbin, kddnewton - Ensure all of the necessary files are present in the gem.
|
39
|
+
- [#917](https://github.com/prettier/plugin-ruby/issues/917) - jscheid, kddnewton - Ensure hash keys with dynamic symbols don't strip their quotes.
|
40
|
+
|
41
|
+
## [1.6.0] - 2021-06-23
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
- [#859](https://github.com/prettier/plugin-ruby/issues/859) - azz, kddnewton - Support the `--insert-pragma` option for the incremental adoption workflow.
|
46
|
+
- [#904](https://github.com/prettier/plugin-ruby/issues/904) - Hansenq, kddnewton - Support the `%s` symbol literal syntax.
|
47
|
+
- [#833](https://github.com/prettier/plugin-ruby/issues/883) - kddnewton - Support for prettier >= v2.3.0.
|
48
|
+
|
49
|
+
### Changed
|
50
|
+
|
51
|
+
- [#854](https://github.com/prettier/plugin-ruby/issues/854) - jflinter, kddnewton - Parentheses should not be stripped from optional RBS union types.
|
52
|
+
- [#888](https://github.com/prettier/plugin-ruby/issues/888) - MaxNotarangelo, kddnewton - Ensure parentheses wrap conditionals that get transformed into the modifier form when they're used within a binary node.
|
53
|
+
- [#874](https://github.com/prettier/plugin-ruby/issues/874) - yratanov, kddnewton - Ensure that method calls chained onto the ends of blocks still print their arguments.
|
54
|
+
- [#897](https://github.com/prettier/plugin-ruby/pull/897) - Hansenq - Reenable the `Layout/LineLength` rubocop rule in our shipped config so that line lengths for other cops are calculated correctly.
|
55
|
+
|
56
|
+
## [1.5.5] - 2021-03-25
|
57
|
+
|
58
|
+
### Changed
|
59
|
+
|
60
|
+
- [#841](https://github.com/prettier/plugin-ruby/issues/841) - LoganBarnett, kddnewton - Better error messaging for when unix sockets are not supported by netcat.
|
61
|
+
- [#844](https://github.com/prettier/plugin-ruby/issues/844) - andyw8, kddnewton - Ensure we ship all of the parsers with the prettier gem so that `rbprettier` can parse other languages as well.
|
62
|
+
- [#847](https://github.com/prettier/plugin-ruby/issues/847) - jflinter, kddnewton - Ensure parentheses are present on union return types in RBS.
|
63
|
+
- [#850](https://github.com/prettier/plugin-ruby/issues/850) - maethub, kddnewton - Ensure double quotes are used even when single quotes are requested for HAML attribute values.
|
64
|
+
- [#849](https://github.com/prettier/plugin-ruby/issues/849) - indirect, kddnewton - Support HAML version <= 5.1 multi-line attributes.
|
65
|
+
- [#810](https://github.com/prettier/plugin-ruby/issues/810) - valscion, kddnewton - Make it so that brace blocks containing heredocs have the correct end line so that they format subsequent statements correctly.
|
66
|
+
|
9
67
|
## [1.5.4] - 2021-03-17
|
10
68
|
|
11
69
|
### Changed
|
12
70
|
|
13
|
-
- [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion,
|
14
|
-
- [#836](https://github.com/prettier/plugin-ruby/issues/836) - valscion,
|
15
|
-
- [#821](https://github.com/prettier/plugin-ruby/issues/821) - jscheid,
|
71
|
+
- [#835](https://github.com/prettier/plugin-ruby/issues/835) - valscion, kddnewton - Array splat operator should not get moved by leading comments.
|
72
|
+
- [#836](https://github.com/prettier/plugin-ruby/issues/836) - valscion, kddnewton - Array splat operator should not get moved by trailing comments.
|
73
|
+
- [#821](https://github.com/prettier/plugin-ruby/issues/821) - jscheid, kddnewton - Better error handling when using GNU netcat.
|
16
74
|
|
17
75
|
## [1.5.3] - 2021-02-28
|
18
76
|
|
19
77
|
### Changed
|
20
78
|
|
21
|
-
- [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion,
|
79
|
+
- [#812](https://github.com/prettier/plugin-ruby/issues/812) - valscion, kddnewton - Splats and blocks within args that have comments attached should place their respective operators in the right place.
|
22
80
|
- [#816](https://github.com/prettier/plugin-ruby/pull/816) - valscion - Document RuboCop's Style/Lambda should be disabled
|
23
|
-
- [#814](https://github.com/prettier/plugin-ruby/issues/814) - jscheid,
|
81
|
+
- [#814](https://github.com/prettier/plugin-ruby/issues/814) - jscheid, kddnewton - Provide better errors when the source location of the error is known.
|
24
82
|
|
25
83
|
## [1.5.2] - 2021-02-03
|
26
84
|
|
27
85
|
### Changed
|
28
86
|
|
29
|
-
-
|
87
|
+
- kddnewton - Fix up `binary` node comparison operators so that it will handle either Symbol literals or the `@op` nodes which are incorrectly coming from JRuby (https://github.com/jruby/jruby/issues/6548).
|
30
88
|
|
31
89
|
## [1.5.1] - 2021-01-27
|
32
90
|
|
33
91
|
### Changed
|
34
92
|
|
35
|
-
- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid,
|
36
|
-
- [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid,
|
37
|
-
- [#803](https://github.com/prettier/plugin-ruby/issues/803) - jscheid,
|
93
|
+
- [#799](https://github.com/prettier/plugin-ruby/issues/799) - jscheid, kddnewton - Multi-byte characters shouldn't give invalid source string bounds.
|
94
|
+
- [#801](https://github.com/prettier/plugin-ruby/issues/801) - jscheid, kddnewton - When converting a conditional to the modifier form, make sure to add parentheses if there is a chained method call.
|
95
|
+
- [#803](https://github.com/prettier/plugin-ruby/issues/803) - jscheid, kddnewton - Fix `formatWithCursor` support to match new parser format.
|
38
96
|
|
39
97
|
## [1.5.0] - 2021-01-21
|
40
98
|
|
41
99
|
### Added
|
42
100
|
|
43
|
-
-
|
101
|
+
- kddnewton - Add `.rbi` as a file type that we support.
|
44
102
|
|
45
103
|
### Changed
|
46
104
|
|
47
|
-
- [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor,
|
48
|
-
- [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor,
|
49
|
-
- [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor,
|
50
|
-
- [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave,
|
51
|
-
-
|
105
|
+
- [#795](https://github.com/prettier/plugin-ruby/issues/795) djrodgerspryor, kddnewton - Trailing comments attached to empty arrays should not multiply.
|
106
|
+
- [#794](https://github.com/prettier/plugin-ruby/issues/794) djrodgerspryor, kddnewton - Fix embedded parser parsing by stripping common leading whitespace before passing on the content.
|
107
|
+
- [#793](https://github.com/prettier/plugin-ruby/issues/793) djrodgerspryor, kddnewton - Do not include trailing commas on arguments within `arg_paren` nodes if they could not be parsed with them (`command` and `command_call`).
|
108
|
+
- [#788](https://github.com/prettier/plugin-ruby/issues/788) clarkdave, kddnewton - Break child hashes within a multi-line hash regardless of whether or not they can fit on one line.
|
109
|
+
- kddnewton - Stop using `;` to separate empty class definitions, module definitions, and loops.
|
52
110
|
|
53
111
|
## [1.4.0] - 2021-01-15
|
54
112
|
|
55
113
|
### Added
|
56
114
|
|
57
|
-
- ianks,
|
115
|
+
- ianks, kddnewton - Use `netcat` to communicate to a parser server for better performance when formatting multiple files.
|
58
116
|
|
59
117
|
### Changed
|
60
118
|
|
61
|
-
- jeffcarbs,
|
62
|
-
- johannesluedke,
|
63
|
-
- johncsnyder,
|
64
|
-
- blampe,
|
65
|
-
- clarkdave,
|
119
|
+
- jeffcarbs, kddnewton - Long strings with interpolated expressions should only break if the contents in the original source is broken.
|
120
|
+
- johannesluedke, kddnewton - Fix for rescues with inline comments.
|
121
|
+
- johncsnyder, kddnewton - Comments should not attach to nodes beyond a double newline.
|
122
|
+
- blampe, kddnewton - Comments inside of a broken method chain get dropped.
|
123
|
+
- clarkdave, kddnewton - Don't ignore Sorbet `sig` transformations.
|
66
124
|
|
67
125
|
## [1.3.0] - 2021-01-05
|
68
126
|
|
69
127
|
### Added
|
70
128
|
|
71
|
-
-
|
72
|
-
-
|
129
|
+
- kddnewton - Handling of the RBS language.
|
130
|
+
- kddnewton - Incorporate the HAML plugin.
|
73
131
|
|
74
132
|
## [1.2.5] - 2021-01-04
|
75
133
|
|
76
134
|
### Changed
|
77
135
|
|
78
|
-
- nruth,
|
79
|
-
- cvoege,
|
80
|
-
- valscion,
|
136
|
+
- nruth, kddnewton - Ensure unary operators on method calls that are sending operators get the correct scanner events.
|
137
|
+
- cvoege, kddnewton - Do not add parentheses when they're not needed to non-breaking command_calls with ternary arguments.
|
138
|
+
- valscion, kddnewton - Print method chains more nicely off array and hash literals.
|
81
139
|
|
82
140
|
## [1.2.4] - 2021-01-03
|
83
141
|
|
@@ -87,102 +145,102 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
87
145
|
|
88
146
|
### Changed
|
89
147
|
|
90
|
-
-
|
91
|
-
-
|
148
|
+
- kddnewton - Reduce JSON size passing from Ruby process to node process by changing `char_start` -> `sc`, `char_end` -> `ec`, `start` -> `sl`, `end` -> `el`.
|
149
|
+
- kddnewton - Up the max buffer size between the Ruby and node processes to 15K.
|
92
150
|
|
93
151
|
## [1.2.3] - 2021-01-02
|
94
152
|
|
95
153
|
### Changed
|
96
154
|
|
97
|
-
- lukyth,
|
98
|
-
- AlanFoster,
|
99
|
-
- AlanFoster,
|
100
|
-
- AlanFoster,
|
101
|
-
- AlanFoster,
|
102
|
-
- AlanFoster,
|
155
|
+
- lukyth, kddnewton - Ensure if a ternary breaks into an `if..else..end` within a `command_call` node that parentheses are added.
|
156
|
+
- AlanFoster, kddnewton - Ensure you consume the optional `do` keyword on `while` and `until` loops so that it doesn't confuse the parser.
|
157
|
+
- AlanFoster, kddnewton - Ensure key-value pairs split on line when the key has a comment attached within a hash.
|
158
|
+
- AlanFoster, kddnewton - Fix for `for` loops that have multiple index variables.
|
159
|
+
- AlanFoster, kddnewton - Fix parsing very large files by reducing the size of the JSON output from the parser.
|
160
|
+
- AlanFoster, kddnewton - Ensure you don't skip parentheses if you're returning a value with the `not` unary operator.
|
103
161
|
|
104
162
|
## [1.2.2] - 2021-01-01
|
105
163
|
|
106
164
|
### Changed
|
107
165
|
|
108
166
|
- nathan-beam - Gem does not work with CMD/Powershell.
|
109
|
-
- blampe,
|
110
|
-
- blampe,
|
111
|
-
- blampe,
|
112
|
-
- johncsnyder,
|
167
|
+
- blampe, kddnewton - Comments inside keyword parameters in method declarations are not printed.
|
168
|
+
- blampe, kddnewton - `command_call` nodes with unary operators incorrectly parse their operator.
|
169
|
+
- blampe, kddnewton - Returning multiple values where the first has parentheses was incorrectly removing the remaining values.
|
170
|
+
- johncsnyder, kddnewton - Call chains whose left-most receiver is a no-indent expression should not indent their entire chain.
|
113
171
|
|
114
172
|
## [1.2.1] - 2020-12-27
|
115
173
|
|
116
174
|
### Changed
|
117
175
|
|
118
|
-
-
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
176
|
+
- kddnewton - Handle single-line method definitions with parameters.
|
177
|
+
- kddnewton - Handle hash and array patterns nested within find patterns.
|
178
|
+
- kddnewton - Handle rightward assignment.
|
179
|
+
- kddnewton - Handle find patterns with named boundaries.
|
180
|
+
- kddnewton - Handle rightward assignment in conditionals.
|
123
181
|
|
124
182
|
## [1.2.0] - 2020-12-26
|
125
183
|
|
126
184
|
### Added
|
127
185
|
|
128
|
-
-
|
129
|
-
-
|
186
|
+
- kddnewton - Support for the `fndptn` node for Ruby 3.0 pattern matching.
|
187
|
+
- kddnewton - Support for Ruby 3.0+ single-line method definitions.
|
130
188
|
|
131
189
|
## [1.1.0] - 2020-12-20
|
132
190
|
|
133
191
|
### Added
|
134
192
|
|
135
|
-
-
|
193
|
+
- kddnewton - Now that the comments are all fixed up, we can support `# prettier-ignore` comments.
|
136
194
|
|
137
195
|
### Changed
|
138
196
|
|
139
|
-
- rindek,
|
140
|
-
- rindek,
|
197
|
+
- rindek, kddnewton - Do not remove parentheses when receiver looks like a constant.
|
198
|
+
- rindek, kddnewton - Do not remove parentheses when using the special `call` syntax with no arguments.
|
141
199
|
- ykpythemind - Do not change regexp bounds if the body has certain content.
|
142
|
-
- karanmandal,
|
143
|
-
- rafbm,
|
200
|
+
- karanmandal, kddnewton - Correctly print for loops.
|
201
|
+
- rafbm, kddnewton - If there are method chains with arguments only at the end, we should group the method chain and the method args.
|
144
202
|
|
145
203
|
## [1.0.1] - 2020-12-12
|
146
204
|
|
147
205
|
### Changed
|
148
206
|
|
149
|
-
- steobrien,
|
207
|
+
- steobrien, kddnewton - Ensure leading comments in empty array and hash literals do not duplicate.
|
150
208
|
|
151
209
|
## [1.0.0] - 2020-12-11
|
152
210
|
|
153
211
|
### Changed
|
154
212
|
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
-
|
159
|
-
-
|
213
|
+
- kddnewton - Do not unescape double quotes in a single quote string.
|
214
|
+
- kddnewton - Only force braces on regexp for spaces and equals if it's inside a command or command_call.
|
215
|
+
- kddnewton - Leave Sorbet type annotations in place.
|
216
|
+
- kddnewton - Don't group hash contents, just allow them to break with their parent node.
|
217
|
+
- kddnewton - Honor the UTF-8 lang passed in through ENV vars.
|
160
218
|
|
161
219
|
## [1.0.0-rc2] - 2020-12-10
|
162
220
|
|
163
221
|
### Changed
|
164
222
|
|
165
|
-
-
|
166
|
-
-
|
167
|
-
-
|
168
|
-
-
|
169
|
-
-
|
170
|
-
- johncsnyder,
|
171
|
-
-
|
223
|
+
- kddnewton - Print hashes with consistent keys (e.g., if one key cannot be a hash label, use all hash rockets).
|
224
|
+
- kddnewton - Respect using `o` or not using `o` for octal numbers.
|
225
|
+
- kddnewton - Ensure `when` clauses with multiple predicates that can be split into multiple lines are split correctly.
|
226
|
+
- kddnewton - Ensure hash literal is split correctly when only its contents would fit on one line.
|
227
|
+
- kddnewton - Simplify `toProc` checks by not calling if the option is disabled.
|
228
|
+
- johncsnyder, kddnewton - Add `method_add_block` to the potential like of method calls that can be chained.
|
229
|
+
- kddnewton - Add the `rubyArrayLiteral` option for disabling automatically turning into array literals.
|
172
230
|
|
173
231
|
## [1.0.0-rc1] - 2020-12-09
|
174
232
|
|
175
233
|
### Changed
|
176
234
|
|
177
|
-
-
|
235
|
+
- kddnewton - Rename options to prep for v1.0 release.
|
178
236
|
- `addTrailingCommas` -> `trailingComma`, `"es5"` means `true`
|
179
237
|
- `inlineConditionals` and `inlineLoops` -> `rubyModifier`
|
180
238
|
- `preferHashLabels` -> `rubyHashLabel`
|
181
239
|
- `preferSingleQuotes` -> `rubySingleQuote`
|
182
240
|
- `toProcTransform` -> `rubyToProc`
|
183
|
-
- andyw8,
|
184
|
-
- andyw8,
|
185
|
-
- andyw8,
|
241
|
+
- andyw8, kddnewton - Fix for Ruby `2.5.1` dyna_symbols. Turns out they were previously incorrectly reported as `xstring` nodes.
|
242
|
+
- andyw8, kddnewton - Fix for plain `rescue` nodes with only comments in the body.
|
243
|
+
- andyw8, kddnewton - Move declaration-type comments up to the line in the original source, as in:
|
186
244
|
|
187
245
|
```ruby
|
188
246
|
def foo # :nodoc:
|
@@ -193,11 +251,11 @@ end
|
|
193
251
|
The comment in the above example should stay in place.
|
194
252
|
|
195
253
|
- janklimo - Respect special call syntax, e.g., `a.(1, 2, 3)` should remain the same.
|
196
|
-
-
|
197
|
-
-
|
198
|
-
-
|
199
|
-
-
|
200
|
-
-
|
254
|
+
- kddnewton - Fix up a bug with `ensure` being used in a `bodystmt` and not a `begin`.
|
255
|
+
- kddnewton - Fix up a bug with negative ranges, e.g., `-4..-3`.
|
256
|
+
- kddnewton - Fix up a bug with operator aliases, e.g., `alias << push`.
|
257
|
+
- kddnewton - Fix up a bug with calls and unary nodes, e.g., `!!foo&.bar`.
|
258
|
+
- kddnewton - Fix up a bug with multiple rescue clauses and comments, e.g.,
|
201
259
|
|
202
260
|
```ruby
|
203
261
|
begin
|
@@ -207,64 +265,64 @@ rescue Foo, Bar
|
|
207
265
|
end
|
208
266
|
```
|
209
267
|
|
210
|
-
-
|
211
|
-
-
|
212
|
-
-
|
213
|
-
-
|
214
|
-
-
|
215
|
-
-
|
216
|
-
-
|
217
|
-
-
|
218
|
-
-
|
219
|
-
-
|
220
|
-
-
|
221
|
-
-
|
222
|
-
- andyw8,
|
268
|
+
- kddnewton - Handle string literals that start with `%Q`.
|
269
|
+
- kddnewton - Handle question method methods in the predicate of an if with a comment in the body.
|
270
|
+
- kddnewton - Fix bare `break` with comments immediately after.
|
271
|
+
- kddnewton - Fix for heredocs with comments immediately after the declaration.
|
272
|
+
- kddnewton - Fix for comments when you're defining a method whose name overlaps with a keyword.
|
273
|
+
- kddnewton - Don't automatically indent inside interpolated expressions from within a heredoc.
|
274
|
+
- kddnewton - Don't convert into string literal arrays if the elements have brackets.
|
275
|
+
- kddnewton - Ensure you break the parent when there is an assignment in the predicate of a loop.
|
276
|
+
- kddnewton - Fix up a bug with keyword aliases, e.g., `alias in within`.
|
277
|
+
- kddnewton - Force using braces for regex if a regex starts with a blank space.
|
278
|
+
- kddnewton - Force using braces for regex if a regex starts with an equals sign.
|
279
|
+
- kddnewton - Fix up a bug with constant aliases, e.g., `alias in IN`.
|
280
|
+
- andyw8, kddnewton - Ensure `rescue` comments stay on the same line as their declaration.
|
223
281
|
|
224
282
|
## [0.22.0] - 2020-12-08
|
225
283
|
|
226
284
|
### Changed
|
227
285
|
|
228
286
|
- flyerhzm - Print method chains by one indentation.
|
229
|
-
- mmcnl,
|
230
|
-
- johncsnyder,
|
287
|
+
- mmcnl, kddnewton - Handle heredocs and blocks being passed to the same method.
|
288
|
+
- johncsnyder, kddnewton - Ensure correct formatting when breaking up conditionals with `inlineConditionals: false`.
|
231
289
|
- Rsullivan00 - Ensure that when ternaries as command arguments get broken into multiple lines we add the necessary parentheses.
|
232
290
|
- jbielick - Maintain parse order during if/unless modifier expressions
|
233
291
|
- flyerhzm - Slight prettifying of wrapped args if doc length is under a certain value.
|
234
|
-
- github0013,
|
292
|
+
- github0013, kddnewton - Ensure `not` keeps parentheses if they are being used.
|
235
293
|
- jbielick - Print heredocs consistently.
|
236
|
-
-
|
237
|
-
-
|
294
|
+
- kddnewton - Completely revamp the way we handle comments.
|
295
|
+
- kddnewton - Support `hshptn` and the remaining missing pattern matching syntax.
|
238
296
|
|
239
297
|
## [0.21.0] - 2020-12-02
|
240
298
|
|
241
299
|
### Changed
|
242
300
|
|
243
|
-
-
|
244
|
-
- jbielick,
|
245
|
-
-
|
246
|
-
- janklimo,
|
247
|
-
- coiti,
|
301
|
+
- kddnewton, ryan-hunter-pc - Explicitly handle `break` and `next` keyword parentheses.
|
302
|
+
- jbielick, kddnewton - Don't convert between `lambda {}` and `-> {}`. Technically it's breaking the semantics of the program. Also because lambda method call arguments can't handle everything that stabby lambda can.
|
303
|
+
- kddnewton - Turn off the `Symbol#to_proc` transform by default.
|
304
|
+
- janklimo, kddnewton - Properly handle trailing commas on hash arguments.
|
305
|
+
- coiti, kddnewton - Properly handle parentheses when necessary on if/unless statements and while/until loops.
|
248
306
|
- Rsullivan00 - Prevent `command` and `command_call` nodes from being turned into ternaries.
|
249
|
-
-
|
250
|
-
-
|
251
|
-
-
|
307
|
+
- kddnewton - Better handling of the `alias` node with and without comments.
|
308
|
+
- kddnewton - Better handling of the `BEGIN` and `END` nodes with and without comments.
|
309
|
+
- kddnewton - Much better handling of heredocs where now there is a consistent `heredoc` node instead of multiple.
|
252
310
|
|
253
311
|
## [0.20.1] - 2020-09-04
|
254
312
|
|
255
313
|
### Changed
|
256
314
|
|
257
|
-
- ftes,
|
315
|
+
- ftes, kddnewton - Properly escape HAML plain text statements that start with special HAML characters.
|
258
316
|
|
259
317
|
### Removed
|
260
318
|
|
261
|
-
-
|
319
|
+
- kddnewton - I'm stripping out the HAML plugin and putting it into its own package (`@prettier/plugin-haml`). It's become too difficult to maintain within this repo, and it's confusing for contributors because there are some things that work with Ruby and some things that don't. This is going to simplify maintenance. This should probably be a major version bump but since we're still pre `1.0` I'm going to leave it as a patch.
|
262
320
|
|
263
321
|
## [0.20.0] - 2020-08-28
|
264
322
|
|
265
323
|
### Added
|
266
324
|
|
267
|
-
-
|
325
|
+
- kddnewton - Allow embedded formatting on heredocs by the name placed at the start. For example,
|
268
326
|
|
269
327
|
<!-- prettier-ignore -->
|
270
328
|
```ruby
|
@@ -284,30 +342,30 @@ JAVASCRIPT
|
|
284
342
|
### Changed
|
285
343
|
|
286
344
|
- Rsullivan00 - Do not tranform word-literal arrays when there is an escape sequence.
|
287
|
-
- steobrien,
|
345
|
+
- steobrien, kddnewton - Do not indent heredocs with calls more than they should be.
|
288
346
|
- jpickwell - Include .simplecov in filenames
|
289
|
-
- github0013,
|
347
|
+
- github0013, kddnewton - Ensure we're parsing ruby files using UTF-8 regardless of the system encoding.
|
290
348
|
|
291
349
|
## [0.19.0] - 2020-07-03
|
292
350
|
|
293
351
|
### Added
|
294
352
|
|
295
353
|
- ryan-hunter-pc - Add the option to disable the `Symbol#to_proc` transform.
|
296
|
-
- ryan-hunter-pc], [@SViccari,
|
354
|
+
- ryan-hunter-pc], [@SViccari, kddnewton - Disable `Symbol#to_proc` transform when used as a key inside of a hash where the key is either `:if` or `:unless`.
|
297
355
|
|
298
356
|
## [0.18.2] - 2020-05-01
|
299
357
|
|
300
358
|
### Changed
|
301
359
|
|
302
360
|
- alse - Support `vscodeLanguageIds` for HAML.
|
303
|
-
- ShayDavidson,
|
361
|
+
- ShayDavidson, kddnewton - Don't allow replacing if/else with ternary if there's an assignment in the predicate.
|
304
362
|
- janklimo - Do not add an empty line after `rescue` when the block is empty.
|
305
363
|
|
306
364
|
## [0.18.1] - 2020-04-05
|
307
365
|
|
308
366
|
### Changed
|
309
367
|
|
310
|
-
- petevk,
|
368
|
+
- petevk, kddnewton - Use braces for block format iff it was originally a brace block, otherwise you could be changing precedence. For example:
|
311
369
|
|
312
370
|
<!-- prettier-ignore -->
|
313
371
|
```ruby
|
@@ -331,10 +389,10 @@ should maintain its `do...end` and not switch to inline braces otherwise the bra
|
|
331
389
|
[1]
|
332
390
|
```
|
333
391
|
|
334
|
-
- ftes,
|
335
|
-
- ftes,
|
336
|
-
- ftes,
|
337
|
-
- mmainz,
|
392
|
+
- ftes, kddnewton - When old-form dynamic attributes are added to a `div` tag in HAML, it was previously skipping printing the `%div`, which led to it being incorrectly displayed.
|
393
|
+
- ftes, kddnewton - Previously if you had a long tag declaration with attributes that made it hit the line limit, then the content of the tag would be pushed to the next line but indented one character too many.
|
394
|
+
- ftes, kddnewton - Don't explicitly require JSON if it has already been loaded, as this can lead to rubygems activation errors.
|
395
|
+
- mmainz, kddnewton - Handle heredocs as the receivers of call nodes, as in:
|
338
396
|
|
339
397
|
<!-- prettier-ignore -->
|
340
398
|
```ruby
|
@@ -343,7 +401,7 @@ foo = <<~TEXT.strip
|
|
343
401
|
TEXT
|
344
402
|
```
|
345
403
|
|
346
|
-
- github0013,
|
404
|
+
- github0013, kddnewton - Leave parentheses in place if the value of a return node contains a binary with low operator precedence, as in:
|
347
405
|
|
348
406
|
<!-- prettier-ignore -->
|
349
407
|
```ruby
|
@@ -354,13 +412,13 @@ return (a or b) if c?
|
|
354
412
|
|
355
413
|
### Added
|
356
414
|
|
357
|
-
-
|
415
|
+
- kddnewton - Support for the `nokw_param` node for specifying when methods should no accept keywords, as in:
|
358
416
|
|
359
417
|
```ruby
|
360
418
|
def foo(**nil); end
|
361
419
|
```
|
362
420
|
|
363
|
-
-
|
421
|
+
- kddnewton - Support for the `args_forward` node for forwarding all types of arguments, as in:
|
364
422
|
|
365
423
|
```ruby
|
366
424
|
def foo(...)
|
@@ -370,13 +428,13 @@ end
|
|
370
428
|
|
371
429
|
### Changed
|
372
430
|
|
373
|
-
- ftes,
|
431
|
+
- ftes, kddnewton - Handled 3 or more classes on a node in HAML, as in:
|
374
432
|
|
375
433
|
```haml
|
376
434
|
%table.table.is-striped.is-hoverable
|
377
435
|
```
|
378
436
|
|
379
|
-
- ftes,
|
437
|
+
- ftes, kddnewton - Better handling of indentation of `if/elsif/else`, `unless/elsif/else`, and `case/when` branches, as in:
|
380
438
|
|
381
439
|
```haml
|
382
440
|
.column.is-12
|
@@ -409,7 +467,7 @@ Config::Download.new(
|
|
409
467
|
).perform
|
410
468
|
```
|
411
469
|
|
412
|
-
- pje,
|
470
|
+
- pje, kddnewton - Method definition bodies (on `defs` nodes) should dedent if a helper method is called. As in:
|
413
471
|
|
414
472
|
<!-- prettier-ignore -->
|
415
473
|
```ruby
|
@@ -427,7 +485,7 @@ private def self.foo
|
|
427
485
|
end
|
428
486
|
```
|
429
487
|
|
430
|
-
- masqita,
|
488
|
+
- masqita, kddnewton - Inline variable assignment within a predicate should force the conditional to break, as in:
|
431
489
|
|
432
490
|
```ruby
|
433
491
|
array.each do |element|
|
@@ -437,16 +495,16 @@ array.each do |element|
|
|
437
495
|
end
|
438
496
|
```
|
439
497
|
|
440
|
-
- hafley66,
|
441
|
-
- Fruetel,
|
442
|
-
- flyerhzm,
|
498
|
+
- hafley66, kddnewton - Handle empty `while` and `until` blocks.
|
499
|
+
- Fruetel, kddnewton - Simplify string escape pattern by locking on any escape sequence.
|
500
|
+
- flyerhzm, kddnewton - Properly handle string quotes on symbols in hash keys.
|
443
501
|
|
444
502
|
## [0.17.0] - 2019-12-12
|
445
503
|
|
446
504
|
### Added
|
447
505
|
|
448
506
|
- matt-wratt - Better support for explicit `return` nodes with empty arrays or arrays with a single element.
|
449
|
-
- jrdioko,
|
507
|
+
- jrdioko, kddnewton - Alignment of `not_to` is explicitly allowed to not indent to better support rspec.
|
450
508
|
|
451
509
|
### Changed
|
452
510
|
|
@@ -456,7 +514,7 @@ end
|
|
456
514
|
|
457
515
|
### Added
|
458
516
|
|
459
|
-
- mmainz,
|
517
|
+
- mmainz, kddnewton - Support for extra commas in multiple assignment, as it changes the meaning. For example,
|
460
518
|
|
461
519
|
<!-- prettier-ignore -->
|
462
520
|
```ruby
|
@@ -465,12 +523,12 @@ a, = [1, 2, 3]
|
|
465
523
|
|
466
524
|
would previously get printed as `a = [1, 2, 3]`, which changes the value of `a` from `1` to the value of the entire array.
|
467
525
|
|
468
|
-
-
|
526
|
+
- kddnewton - Experimental support for the HAMtemplate language.
|
469
527
|
|
470
528
|
### Changed
|
471
529
|
|
472
|
-
- github0013,
|
473
|
-
- jamescostian,
|
530
|
+
- github0013, kddnewton - Support proper string escaping when the original string in the source is wrapped in `%q|...|`. For example, `%q|\'|` should get printed as `"\'"`, where previously it was dropping the backslash.
|
531
|
+
- jamescostian, kddnewton - Force ternary breaking when using the lower-precendence operators `and` and `or`. For example,
|
474
532
|
|
475
533
|
<!-- prettier-ignore -->
|
476
534
|
```ruby
|
@@ -483,7 +541,7 @@ end
|
|
483
541
|
|
484
542
|
the previous expression was being transformed into a ternary which was invalid ruby. Instead it now stays broken out into an if/else block.
|
485
543
|
|
486
|
-
- localhostdotdev], [@joeyjoejoejr], [@eins78,
|
544
|
+
- localhostdotdev], [@joeyjoejoejr], [@eins78, kddnewton - Better support for embedded expressions inside heredocs. For example,
|
487
545
|
|
488
546
|
<!-- prettier-ignore -->
|
489
547
|
```ruby
|
@@ -496,14 +554,14 @@ HERE
|
|
496
554
|
|
497
555
|
should remain formatted as it is. Whereas previously due to the way the lines were split, you would sometimes end up with it breaking after `#{`.
|
498
556
|
|
499
|
-
- jamescostian,
|
557
|
+
- jamescostian, kddnewton - Fix up `return` node printing. When returning multiple values, you need to return an array literal as opposed to using parentheses.
|
500
558
|
|
501
559
|
## [0.15.1] - 2019-11-05
|
502
560
|
|
503
561
|
### Changed
|
504
562
|
|
505
563
|
- AlanFoster - Add `bin/lex` for viewing the tokenized result of Ripper on Ruby code.
|
506
|
-
- jakeprime,
|
564
|
+
- jakeprime, kddnewton - When predicates from within an `if`, `unless`, `while`, or `until` loop break the line, they should be aligned together. For example,
|
507
565
|
|
508
566
|
<!-- prettier-ignore -->
|
509
567
|
```ruby
|
@@ -530,7 +588,7 @@ if foo?
|
|
530
588
|
end
|
531
589
|
```
|
532
590
|
|
533
|
-
- mmainz,
|
591
|
+
- mmainz, kddnewton - Hash keys are not converted to keyword syntax if they would make invalid symbols. For example,
|
534
592
|
|
535
593
|
<!-- prettier-ignore -->
|
536
594
|
```ruby
|
@@ -539,9 +597,9 @@ end
|
|
539
597
|
|
540
598
|
cannot be translated into `[]:` as that is an invalid symbol. Instead, it stays with the hash rocket syntax.
|
541
599
|
|
542
|
-
- cldevs,
|
543
|
-
- cldevs,
|
544
|
-
- MarcManiez,
|
600
|
+
- cldevs, kddnewton - Do not attempt to format the insides of xstring literals (string that get sent to the command line surrounded by backticks or `%x`).
|
601
|
+
- cldevs, kddnewton - When predicates for `if`, `unless`, `while`, or `until` nodes contain an assignment, we can't know for sure that it doesn't modify the body. In this case we need to always break and form a multi-line block.
|
602
|
+
- MarcManiez, kddnewton - When the return value of `if`, `unless`, `while`, or `until` nodes are assigned to anything other than a local variable, we need to wrap them in parentheses if we're changing to the modifier form. This is because the following expressions have different semantic meaning:
|
545
603
|
|
546
604
|
<!-- prettier-ignore -->
|
547
605
|
```ruby
|
@@ -564,8 +622,8 @@ That will guarantee that the expressions are equivalent.
|
|
564
622
|
|
565
623
|
### Changed
|
566
624
|
|
567
|
-
- dudeofawesome,
|
568
|
-
- krachtstefan,
|
625
|
+
- dudeofawesome, kddnewton - If xstring literals (command line calls surrounded by backticks) break, then we indent and place the command on a new line. Previously, this was resulting in new lines getting added each time the code was formatted. Now this happens correctly.
|
626
|
+
- krachtstefan, kddnewton - When a `while` or `until` loop modifies a `begin...end` statement, it must remain in the modifier form or else it changes sematic meaning. For example,
|
569
627
|
|
570
628
|
<!-- prettier-ignore -->
|
571
629
|
```ruby
|
@@ -585,8 +643,8 @@ end
|
|
585
643
|
|
586
644
|
because that would never execute `foo` if `bar` is falsy, whereas in the initial example it would have.
|
587
645
|
|
588
|
-
- jviney],
|
589
|
-
- jakeprime,
|
646
|
+
- jviney], kddnewton - When transforming a block into the `Symbol#to_proc` syntax from within a list of arguments inside of an `aref` node (i.e., `foo[:bar.each`), we can't put the block syntax inside the brackets.
|
647
|
+
- jakeprime, kddnewton - Values for the `return` keyword that broke the line were previously just printed as they were, which breaks if you have a block expression like an `if` or `while`. For example,
|
590
648
|
|
591
649
|
<!-- prettier-ignore -->
|
592
650
|
```ruby
|
@@ -617,7 +675,7 @@ return(
|
|
617
675
|
)
|
618
676
|
```
|
619
677
|
|
620
|
-
- jakeprime,
|
678
|
+
- jakeprime, kddnewton - When switching from a double-quoted string to a single-quoted string that contained escaped double quotes, the backslashes would stay in the string. As in:
|
621
679
|
|
622
680
|
<!-- prettier-ignore -->
|
623
681
|
```ruby
|
@@ -642,11 +700,11 @@ but now gets formatted as:
|
|
642
700
|
|
643
701
|
### Added
|
644
702
|
|
645
|
-
-
|
703
|
+
- kddnewton - Support for pattern matching for variables and array patterns. Currently waiting on Ripper support for hash patterns. For examples, check out the [test/js/patterns.test.js](test/js/patterns.test.js) file.
|
646
704
|
|
647
705
|
### Changed
|
648
706
|
|
649
|
-
- jviney,
|
707
|
+
- jviney, kddnewton - if/else blocks that had method calls on the end of them that were also transformed into ternaries need to have parens added to them. For example,
|
650
708
|
|
651
709
|
<!-- prettier-ignore -->
|
652
710
|
```ruby
|
@@ -664,8 +722,8 @@ now correctly gets transformed into:
|
|
664
722
|
(foo ? 1 : 2).to_s
|
665
723
|
```
|
666
724
|
|
667
|
-
- acrewdson,
|
668
|
-
- jviney,
|
725
|
+
- acrewdson, kddnewton - Fixed a bug where multiple newlines at the end of the file would cause a crash.
|
726
|
+
- jviney, kddnewton - If a variable is assigned inside of the predicate of a conditional, then we can't change it into the single-line version as this breaks. For example,
|
669
727
|
|
670
728
|
<!-- prettier-ignore -->
|
671
729
|
```ruby
|
@@ -680,11 +738,11 @@ must stay the same.
|
|
680
738
|
|
681
739
|
### Added
|
682
740
|
|
683
|
-
-
|
741
|
+
- kddnewton - Added `locStart` and `locEnd` functions to support `--cursor-offset`.
|
684
742
|
|
685
743
|
### Changed
|
686
744
|
|
687
|
-
- xipgroc,
|
745
|
+
- xipgroc, kddnewton - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example,
|
688
746
|
|
689
747
|
<!-- prettier-ignore -->
|
690
748
|
```ruby
|
@@ -709,7 +767,7 @@ end
|
|
709
767
|
|
710
768
|
but now gets printed correctly.
|
711
769
|
|
712
|
-
- petevk,
|
770
|
+
- petevk, kddnewton - Double splats inside a hash were previously failing to print. For example,
|
713
771
|
|
714
772
|
<!-- prettier-ignore -->
|
715
773
|
```ruby
|
@@ -722,12 +780,12 @@ would fail to print, but now works.
|
|
722
780
|
|
723
781
|
### Changed
|
724
782
|
|
725
|
-
-
|
726
|
-
-
|
727
|
-
-
|
728
|
-
-
|
729
|
-
- glejeune,
|
730
|
-
-
|
783
|
+
- kddnewton - Move arg, assign, constant, flow, massign, operator, scope, and statement nodes into their own files.
|
784
|
+
- kddnewton - Move `@int`, `access_ctrl`, `assocsplat`, `block_var`, `else`, `number_arg`, `super`, `undef`, `var_ref`, and `var_ref` as well as various call and symbol nodes into appropriate files.
|
785
|
+
- kddnewton - Better support for excessed commas in block args. Previously `proc { |x,| }` would add an extra space, but now it does not.
|
786
|
+
- kddnewton - Add a lot more documentation to the parser.
|
787
|
+
- glejeune, kddnewton - Previously, the unary `not` operator inside a ternary (e.g., `a ? not(b) : c`) would break because it wouldn't add parentheses, but now it adds them.
|
788
|
+
- kddnewton - `if` and `unless` nodes used to not be able to handle if a comment was the only statement in the body. For example,
|
731
789
|
|
732
790
|
<!-- prettier-ignore -->
|
733
791
|
```ruby
|
@@ -745,7 +803,7 @@ would get printed as
|
|
745
803
|
|
746
804
|
Now the `if` and `unless` printers check for the presence of single comments.
|
747
805
|
|
748
|
-
- JoshuaKGoldberg,
|
806
|
+
- JoshuaKGoldberg, kddnewton - Fixes an error where `command` nodes within `def` nodes would fail to format if it was only a single block argument. For example,
|
749
807
|
|
750
808
|
<!-- prettier-ignore -->
|
751
809
|
```ruby
|
@@ -756,7 +814,7 @@ end
|
|
756
814
|
|
757
815
|
would fail, but now works.
|
758
816
|
|
759
|
-
- xipgroc,
|
817
|
+
- xipgroc, kddnewton - Comments on lines with array references were previously deleting the array references entirely. For example,
|
760
818
|
|
761
819
|
<!-- prettier-ignore -->
|
762
820
|
```ruby
|
@@ -769,323 +827,323 @@ would previously result in `array[]`, but now prints properly.
|
|
769
827
|
|
770
828
|
### Changed
|
771
829
|
|
772
|
-
-
|
773
|
-
- xipgroc,
|
830
|
+
- kddnewton - When symbol literal hash keys end with `=`, they cannot be transformed into hash labels.
|
831
|
+
- xipgroc, kddnewton - Fixed when blocks on methods with no arguments are transformed into `to_proc` syntax.
|
774
832
|
|
775
833
|
## [0.12.1] - 2019-04-22
|
776
834
|
|
777
835
|
### Changed
|
778
836
|
|
779
|
-
-
|
780
|
-
- jpickwell,
|
781
|
-
-
|
837
|
+
- kddnewton - If a lambda literal is nested under a `command` or `command_call` node anywhere in the heirarchy, then it needs to use the higher-precedence `{ ... }` braces as opposed to the `do ... end` delimiters.
|
838
|
+
- jpickwell, kddnewton - Calling `super` with a block and no args was causing the parser to fail when attempting to inspect lambda nodes.
|
839
|
+
- kddnewton - Support better breaking within interpolation by grouping the interpolated content.
|
782
840
|
|
783
841
|
## [0.12.0] - 2019-04-18
|
784
842
|
|
785
843
|
### Added
|
786
844
|
|
787
|
-
-
|
845
|
+
- kddnewton - Automatically convert `lambda { ... }` method calls into `-> { ... }` literals.
|
788
846
|
|
789
847
|
## [0.11.0] - 2019-04-18
|
790
848
|
|
791
849
|
### Added
|
792
850
|
|
793
|
-
-
|
794
|
-
-
|
795
|
-
-
|
796
|
-
-
|
851
|
+
- kddnewton - Support for parsing things with a ruby shebang (e.g., `#!/usr/bin/env ruby` or `#!/usr/bin/ruby`).
|
852
|
+
- kddnewton - Big tests refactor.
|
853
|
+
- kddnewton - Make multiple `when` predicates break at 80 chars and then wrap to be inline with the other predicates.
|
854
|
+
- kddnewton - Automatically add underscores in large numbers that aren't already formatted.
|
797
855
|
- AlanFoster - Better support for inline access control modifiers.
|
798
|
-
- jpickwell,
|
799
|
-
-
|
800
|
-
-
|
856
|
+
- jpickwell, kddnewton - Better support for heredocs in hash literals.
|
857
|
+
- kddnewton - Better support for heredocs in array literals.
|
858
|
+
- kddnewton - Support automatically transforming `def/begin/rescue/end/end` into `def/rescue/end`.
|
801
859
|
|
802
860
|
### Changed
|
803
861
|
|
804
862
|
- deecewan - Fixed support for dynamic string hash keys.
|
805
|
-
-
|
806
|
-
-
|
863
|
+
- kddnewton - Moved `case/when` into its own file and added better documentation.
|
864
|
+
- kddnewton - Moved `begin/rescue` into its own file.
|
807
865
|
- AlanFoster - Automatically add newlines around access modifiers.
|
808
|
-
-
|
809
|
-
- aaronjensen,
|
810
|
-
-
|
811
|
-
-
|
812
|
-
- CodingItWrong,
|
813
|
-
-
|
866
|
+
- kddnewton - Alignment of command calls with arguments is fixed.
|
867
|
+
- aaronjensen, kddnewton - Alignment of `to` is explicitly allowed to not indent to better support rspec.
|
868
|
+
- kddnewton - Fix up the `to_proc` transform so that it works with other argument handling appropriately.
|
869
|
+
- kddnewton - Fixed regression on regexp comments.
|
870
|
+
- CodingItWrong, kddnewton - Fix up block delimiters when nested inside a `command` or `command_call` node.
|
871
|
+
- kddnewton - Moved hashes into its own file.
|
814
872
|
|
815
873
|
## [0.10.0] - 2019-03-25
|
816
874
|
|
817
875
|
### Added
|
818
876
|
|
819
|
-
-
|
820
|
-
-
|
877
|
+
- kddnewton - Support for block-local variables.
|
878
|
+
- kddnewton - Support for dyna-symbols that are using single quotes.
|
821
879
|
|
822
880
|
### Changed
|
823
881
|
|
824
|
-
-
|
825
|
-
-
|
882
|
+
- kddnewton - Force method calls after arrays, blocks, hashes, and xstrings to hang onto the end of the previous nodes.
|
883
|
+
- kddnewton - Check before anything else for an invalid ruby version.
|
826
884
|
|
827
885
|
## [0.9.1] - 2019-03-24
|
828
886
|
|
829
887
|
### Changed
|
830
888
|
|
831
|
-
-
|
832
|
-
-
|
889
|
+
- kddnewton - Better support string quotes by favoring what the user chose if the string contains escape patterns.
|
890
|
+
- kddnewton - Better support heredocs within method calls.
|
833
891
|
|
834
892
|
## [0.9.0] - 2019-03-18
|
835
893
|
|
836
894
|
### Added
|
837
895
|
|
838
|
-
-
|
839
|
-
-
|
896
|
+
- kddnewton - Support the `hasPragma` function.
|
897
|
+
- kddnewton - Support the new `number_arg` node type in Ruby 2.7.
|
840
898
|
|
841
899
|
### Changed
|
842
900
|
|
843
|
-
-
|
901
|
+
- kddnewton - Limit the number of nodes that are allowed to turn into ternary expressions.
|
844
902
|
|
845
903
|
## [0.8.0] - 2019-03-08
|
846
904
|
|
847
905
|
### Added
|
848
906
|
|
849
|
-
-
|
907
|
+
- kddnewton - Add `eslint` and fix up existing violations.
|
850
908
|
- AlanFoster - Add the infra for the `prettier` ruby gem.
|
851
|
-
-
|
852
|
-
-
|
909
|
+
- kddnewton - Add a `rake` task for easier process integration for the ruby gem.
|
910
|
+
- kddnewton - Handle direct interpolation of strings with %w array literals (i.e., `["#{foo}"]` should not be transformed into a %w array).
|
853
911
|
|
854
912
|
### Changed
|
855
913
|
|
856
|
-
-
|
914
|
+
- kddnewton - Fix string escaping for hex digit bit patterns when there's only one character after the "x".
|
857
915
|
- AlanFoster - Don't allow line breaks between brace block params.
|
858
916
|
- johnschoeman - Switch over the array.rb test case to minitest.
|
859
917
|
- AlanFoster - Test improvements to allow running in parallel.
|
860
918
|
- johnschoeman - Switch over assign.rb test case to minitest.
|
861
919
|
- AlanFoster - Add a contributing guide.
|
862
920
|
- AlanFoster - Handle longer command nodes.
|
863
|
-
-
|
921
|
+
- kddnewton - Changed the ruby executable within the `prettier` gem to `rbprettier` for easier autocomplete.
|
864
922
|
|
865
923
|
### Removed
|
866
924
|
|
867
|
-
-
|
925
|
+
- kddnewton - All instances of the spread (`...`) operator so that we can support older versions of node.
|
868
926
|
|
869
927
|
## [0.7.0] - 2019-02-24
|
870
928
|
|
871
929
|
### Changed
|
872
930
|
|
873
|
-
-
|
874
|
-
- RossKinsella,
|
931
|
+
- kddnewton - Support checking for escaping within strings to force double quotes (e.g., "\n").
|
932
|
+
- RossKinsella, kddnewton - Handle cases with empty class and module declarations that need to break.
|
875
933
|
- AlanFoster - Align the `bin/print` and `bin/sexp` APto support `bin/print` taking a filepath.
|
876
|
-
- AndrewRayCode,
|
934
|
+
- AndrewRayCode, kddnewton - Support lambdas that don't break and are inline.
|
877
935
|
- AlanFoster - Switch over the numbers.rb test to minitest.
|
878
936
|
- AlanFoster - Switch over the kwargs.rb test to minitest.
|
879
937
|
- AlanFoster - Bail out early if the Ruby input is invalid.
|
880
|
-
-
|
938
|
+
- kddnewton - Support `__END__` content.
|
881
939
|
- AlanFoster - Fix up issue with whitespace being added within regexp that are multiline.
|
882
940
|
- AlanFoster - Better support for destructuring within multi assignment.
|
883
|
-
-
|
884
|
-
-
|
885
|
-
- AndrewRayCode,
|
886
|
-
- aaronjensen,
|
887
|
-
- AlanFoster,
|
941
|
+
- kddnewton - Switch `next` test over to minitest.
|
942
|
+
- kddnewton - Handle multiple arguments to `next` with a space between.
|
943
|
+
- AndrewRayCode, kddnewton - Handle multi-line conditional predicate (should align with keyword).
|
944
|
+
- aaronjensen, kddnewton - Properly support adding trailing commas with and without blocks.
|
945
|
+
- AlanFoster, kddnewton - Fix regression of handling comments within arrays on array literals.
|
888
946
|
- AlanFoster - Support multiple arguments to `undef`.
|
889
947
|
|
890
948
|
## [0.6.3] - 2019-02-18
|
891
949
|
|
892
950
|
### Changed
|
893
951
|
|
894
|
-
-
|
895
|
-
-
|
896
|
-
-
|
897
|
-
-
|
952
|
+
- kddnewton - Switch over `binary` fixture to minitest.
|
953
|
+
- kddnewton - Reconfigure parser into multiple layer modules so that it's easier to understand and manage.
|
954
|
+
- kddnewton - Handle comments from within `begin`, `rescue`, `ensure`, `while`, and `until` nodes.
|
955
|
+
- kddnewton - Properly indent heredocs without taking into account current indentation level.
|
898
956
|
|
899
957
|
## [0.6.2] - 2019-02-17
|
900
958
|
|
901
959
|
### Changed
|
902
960
|
|
903
961
|
- AlanFoster - Handle regexp suffixes.
|
904
|
-
-
|
905
|
-
-
|
906
|
-
- aaronjensen,
|
907
|
-
- christoomey,
|
962
|
+
- kddnewton - Add support for testing the test fixtures with minitest.
|
963
|
+
- kddnewton - Switch over `alias` and `regexp` tests to minitest.
|
964
|
+
- aaronjensen, kddnewton - Break up method args to split into multiple lines.
|
965
|
+
- christoomey, kddnewton - Handle blocks args when trailing commas are on.
|
908
966
|
|
909
967
|
## [0.6.1] - 2019-02-15
|
910
968
|
|
911
969
|
### Changed
|
912
970
|
|
913
|
-
- meleyal,
|
914
|
-
- meleyal,
|
971
|
+
- meleyal, kddnewton - Fix Ruby 2.5 inline comments on `args_add_block` nodes.
|
972
|
+
- meleyal, kddnewton - Support passing `super()` explicitly with no arguments.
|
915
973
|
|
916
974
|
## [0.6.0] - 2019-02-14
|
917
975
|
|
918
976
|
### Added
|
919
977
|
|
920
|
-
-
|
921
|
-
-
|
922
|
-
-
|
923
|
-
-
|
924
|
-
-
|
978
|
+
- kddnewton - Handle non UTF-8 comments.
|
979
|
+
- kddnewton - Handle non UTF-8 identifiers.
|
980
|
+
- kddnewton - Handle non UTF-8 strings.
|
981
|
+
- kddnewton - Handle empty parens.
|
982
|
+
- kddnewton - Handle rescue with splats preceeding the exception names.
|
925
983
|
|
926
984
|
### Changed
|
927
985
|
|
928
|
-
-
|
929
|
-
- NoahTheDuke,
|
986
|
+
- kddnewton - Use `JSON::fast_generate` to get the s-expressions back from the parser.
|
987
|
+
- NoahTheDuke, kddnewton - Handle broken lambdas from within `command` and `command_call` nodes.
|
930
988
|
|
931
989
|
## [0.5.2] - 2019-02-13
|
932
990
|
|
933
991
|
### Changed
|
934
992
|
|
935
|
-
-
|
993
|
+
- kddnewton - Support embedded expressions within strings that contain only keywords, as in `"#{super}"`.
|
936
994
|
|
937
995
|
## [0.5.1] - 2019-02-13
|
938
996
|
|
939
997
|
### Changed
|
940
998
|
|
941
|
-
- yuki24,
|
942
|
-
- kmcq,
|
943
|
-
- ashfurrow,
|
999
|
+
- yuki24, kddnewton - Force `do` blocks that we know have to be `do` blocks to break.
|
1000
|
+
- kmcq, kddnewton - Handle `command` and `command_call` nodes `do` blocks by forcing them to break.
|
1001
|
+
- ashfurrow, kddnewton - Attach comments to full hash association nodes, not just the value.
|
944
1002
|
|
945
1003
|
## [0.5.0] - 2019-02-13
|
946
1004
|
|
947
1005
|
### Added
|
948
1006
|
|
949
|
-
-
|
950
|
-
-
|
1007
|
+
- kddnewton - Automatically convert arrays of all string literals to %w arrays.
|
1008
|
+
- kddnewton - Automatically convert arrays of all symbol literals to %i arrays.
|
951
1009
|
|
952
1010
|
### Changed
|
953
1011
|
|
954
|
-
-
|
955
|
-
- uri,
|
956
|
-
-
|
1012
|
+
- kddnewton - Move the `args_add` and `args_new` handling into the parser.
|
1013
|
+
- uri, kddnewton - Change `command_call` nodes to properly indent when broken and to not add a trailing comma.
|
1014
|
+
- kddnewton - Rename the `trailingComma` option to `addTrailingCommas` to not conflict with the JS option.
|
957
1015
|
|
958
1016
|
## [0.4.1] - 2019-02-12
|
959
1017
|
|
960
1018
|
### Changed
|
961
1019
|
|
962
|
-
-
|
963
|
-
- awinograd,
|
964
|
-
-
|
1020
|
+
- kddnewton - Provide the `makeList` utility for the nodes that are lists from within ripper.
|
1021
|
+
- awinograd, kddnewton - Again, this time for real, properly escape strings.
|
1022
|
+
- kddnewton - Fix up trailing commas on command calls.
|
965
1023
|
|
966
1024
|
## [0.4.0] - 2019-02-12
|
967
1025
|
|
968
1026
|
### Added
|
969
1027
|
|
970
|
-
- Overload119,
|
1028
|
+
- Overload119, kddnewton - Support the `trailingComma` configuration option (defaults to `false`).
|
971
1029
|
|
972
1030
|
### Changed
|
973
1031
|
|
974
|
-
- NoahTheDuke,
|
1032
|
+
- NoahTheDuke, kddnewton - Pass the code to be formatted over `stdin`.
|
975
1033
|
|
976
1034
|
## [0.3.7] - 2019-02-11
|
977
1035
|
|
978
1036
|
### Changed
|
979
1037
|
|
980
|
-
-
|
981
|
-
-
|
1038
|
+
- kddnewton - Split up statements even if they started on the same line with `;`s unless they are within an embedded expression.
|
1039
|
+
- kddnewton - Properly handle escaped quotes within strings.
|
982
1040
|
|
983
1041
|
## [0.3.6] - 2019-02-10
|
984
1042
|
|
985
1043
|
### Changed
|
986
1044
|
|
987
|
-
- AlanFoster,
|
988
|
-
- AlanFoster,
|
1045
|
+
- AlanFoster, kddnewton - Support the `not` operator properly.
|
1046
|
+
- AlanFoster, kddnewton - Handle comments properly inside `if`, `unless`, and `when` nodes.
|
989
1047
|
|
990
1048
|
## [0.3.5] - 2019-02-09
|
991
1049
|
|
992
1050
|
### Changed
|
993
1051
|
|
994
|
-
-
|
1052
|
+
- kddnewton - Handle lonely operators in Ruby `2.5`.
|
995
1053
|
|
996
1054
|
## [0.3.4] - 2019-02-09
|
997
1055
|
|
998
1056
|
### Changed
|
999
1057
|
|
1000
|
-
-
|
1001
|
-
-
|
1002
|
-
-
|
1058
|
+
- kddnewton - Comments are now properly attached inside `defs` nodes.
|
1059
|
+
- kddnewton - Support multiple inline comments on nodes.
|
1060
|
+
- kddnewton - Support inline comments from within the `EXPR_END|EXPR_LABEL` lexer state.
|
1003
1061
|
- cbothner - Stop transforming multistatement blocks with `to_proc`.
|
1004
|
-
-
|
1005
|
-
- eins78,
|
1062
|
+
- kddnewton - `do` blocks necessarily need to break their parent nodes.
|
1063
|
+
- eins78, kddnewton - Handle `next` node edge case with `args_add` as the body.
|
1006
1064
|
|
1007
1065
|
## [0.3.3] - 2019-02-09
|
1008
1066
|
|
1009
1067
|
### Changed
|
1010
1068
|
|
1011
|
-
- bugthing,
|
1012
|
-
- awinograd,
|
1069
|
+
- bugthing, kddnewton - Command nodes within conditionals now break parents to disallow them from being turned into ternary expressions.
|
1070
|
+
- awinograd, kddnewton - Properly escape double quotes when using `preferSingleQuotes: false`.
|
1013
1071
|
|
1014
1072
|
## [0.3.2] - 2019-02-09
|
1015
1073
|
|
1016
1074
|
### Changed
|
1017
1075
|
|
1018
|
-
-
|
1019
|
-
-
|
1020
|
-
-
|
1076
|
+
- kddnewton - Don't define duplicated methods in the parser.
|
1077
|
+
- kddnewton - Let prettier know about `.rb` and `.rake` files so you don't have to specify the parser when running.
|
1078
|
+
- kddnewton - Renamed the package to @prettier/plugin-ruby.
|
1021
1079
|
|
1022
1080
|
## [0.3.1] - 2019-02-07
|
1023
1081
|
|
1024
1082
|
### Changed
|
1025
1083
|
|
1026
|
-
-
|
1027
|
-
-
|
1028
|
-
-
|
1029
|
-
-
|
1084
|
+
- kddnewton - Automatically add parens to method declarations.
|
1085
|
+
- kddnewton - Handle comments on bare hash assocs.
|
1086
|
+
- kddnewton - Handle `method_add_block` nodes where the statements may be nested one more level.
|
1087
|
+
- kddnewton - Handle heredocs nested no matter how many levels deep.
|
1030
1088
|
|
1031
1089
|
## [0.3.0] - 2019-02-07
|
1032
1090
|
|
1033
1091
|
### Added
|
1034
1092
|
|
1035
|
-
-
|
1036
|
-
-
|
1093
|
+
- kddnewton - Support squiggly heredocs.
|
1094
|
+
- kddnewton - Support straight heredocs.
|
1037
1095
|
|
1038
1096
|
### Changed
|
1039
1097
|
|
1040
|
-
-
|
1041
|
-
-
|
1042
|
-
-
|
1043
|
-
-
|
1044
|
-
-
|
1045
|
-
-
|
1098
|
+
- kddnewton - Ignore current indentation when creating embdocs so that `=begin` is always at the beginning of the line.
|
1099
|
+
- kddnewton - Move `regexp_add` and `regexp_new` handling into the parser.
|
1100
|
+
- kddnewton - Move `xstring_add` and `xstring_new` handling into the parser.
|
1101
|
+
- kddnewton - Move `string_add` and `string_content` handling into the parser.
|
1102
|
+
- kddnewton - Move `mrhs_add` and `mrhs_new` handling into the parser.
|
1103
|
+
- kddnewton - Move `mlhs_add` and `mlhs_new` handling into the parser.
|
1046
1104
|
|
1047
1105
|
## [0.2.1] - 2019-02-06
|
1048
1106
|
|
1049
1107
|
### Changed
|
1050
1108
|
|
1051
|
-
-
|
1052
|
-
-
|
1053
|
-
-
|
1109
|
+
- kddnewton - Handle brace blocks on commands properly.
|
1110
|
+
- kddnewton - Break parent and return `do` blocks when called from a `command` node.
|
1111
|
+
- kddnewton - Handle edge cases with `if` statements where there is no body of the if (so it can't be converted to a ternary).
|
1054
1112
|
|
1055
1113
|
## [0.2.0] - 2019-02-06
|
1056
1114
|
|
1057
1115
|
### Added
|
1058
1116
|
|
1059
|
-
-
|
1060
|
-
-
|
1117
|
+
- kddnewton - Handle `methref` nodes from Ruby `2.7`.
|
1118
|
+
- kddnewton - Allow `module` nodes to shorten using `;` when the block is empty.
|
1061
1119
|
|
1062
1120
|
### Changed
|
1063
1121
|
|
1064
|
-
-
|
1065
|
-
-
|
1066
|
-
-
|
1067
|
-
-
|
1068
|
-
-
|
1069
|
-
-
|
1070
|
-
-
|
1071
|
-
-
|
1072
|
-
-
|
1122
|
+
- kddnewton - Handle splat within an array, as in `[1, 2, *foo]`.
|
1123
|
+
- kddnewton - Disallow comments from being attached to intermediary regex nodes.
|
1124
|
+
- kddnewton - Fix `to_proc` transforms to reference the method called as opposed to the parameter name.
|
1125
|
+
- kddnewton - Change statement lists to be generated within the parser instead of the printer, thereby allowing finer control over comments.
|
1126
|
+
- kddnewton - Completely revamp comment parsing by switching off the internal lexer state from `ripper`. This should drastically increase accuracy of comment parsing in general, and set us up for success in the future.
|
1127
|
+
- kddnewton - Allow comments to be attached to `CHAR` nodes.
|
1128
|
+
- kddnewton - Disallow comments from being attached to `args_new` nodes.
|
1129
|
+
- kddnewton - Track start and end lines so we can better insert block comments.
|
1130
|
+
- kddnewton - Handle intermediary array nodes in the parse for better comment handling.
|
1073
1131
|
|
1074
1132
|
## [0.1.2] - 2019-02-05
|
1075
1133
|
|
1076
1134
|
### Changed
|
1077
1135
|
|
1078
|
-
-
|
1136
|
+
- kddnewton - Handle guard clauses that return with no parens.
|
1079
1137
|
|
1080
1138
|
## [0.1.1] - 2019-02-05
|
1081
1139
|
|
1082
1140
|
### Changed
|
1083
1141
|
|
1084
|
-
-
|
1085
|
-
-
|
1086
|
-
-
|
1087
|
-
-
|
1088
|
-
-
|
1142
|
+
- kddnewton - Handle class method calls with the `::` operator.
|
1143
|
+
- kddnewton - Handle strings with apostrophes when using `preferSingleQuote`.
|
1144
|
+
- kddnewton - Have travis run multiple ruby versions.
|
1145
|
+
- kddnewton - Explicitly fail if ruby version is < `2.5`.
|
1146
|
+
- kddnewton - Disallow comments from being attached to intermediary string nodes.
|
1089
1147
|
|
1090
1148
|
## [0.1.0] - 2019-02-04
|
1091
1149
|
|
@@ -1093,7 +1151,11 @@ would previously result in `array[]`, but now prints properly.
|
|
1093
1151
|
|
1094
1152
|
- Initial release 🎉
|
1095
1153
|
|
1096
|
-
[unreleased]: https://github.com/prettier/plugin-ruby/compare/
|
1154
|
+
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v2.0.0-rc1...HEAD
|
1155
|
+
[2.0.0-rc1]: https://github.com/prettier/plugin-ruby/compare/v1.6.1...v2.0.0-rc1
|
1156
|
+
[1.6.1]: https://github.com/prettier/plugin-ruby/compare/v1.6.0...v1.6.1
|
1157
|
+
[1.6.0]: https://github.com/prettier/plugin-ruby/compare/v1.5.5...v1.6.0
|
1158
|
+
[1.5.5]: https://github.com/prettier/plugin-ruby/compare/v1.5.4...v1.5.5
|
1097
1159
|
[1.5.4]: https://github.com/prettier/plugin-ruby/compare/v1.5.3...v1.5.4
|
1098
1160
|
[1.5.3]: https://github.com/prettier/plugin-ruby/compare/v1.5.2...v1.5.3
|
1099
1161
|
[1.5.2]: https://github.com/prettier/plugin-ruby/compare/v1.5.1...v1.5.2
|