prettier 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/package.json +1 -1
- data/src/parseSync.js +21 -12
- data/src/server.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c772ae9c41714e30e74b8d7d832a2efdd939835ada857eeb4ec80e1f036d4d5
|
4
|
+
data.tar.gz: f9895d25d44b055627a3518d13b3c81334bcc9bb13514a8617f3ad49ef0b8114
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a131aed0b99f4ea445a64c6c9c985931523ad6f5586df6e5d08d263d0ab4f1c40f4a17c685590b726afcae498ece6b34cf2fe9451a8e24bdc22ff8896719ea8
|
7
|
+
data.tar.gz: d3723afae5fdf5547e1f88f2d3443964951fe2faa8931434afa01aa8565643f93282b28bb15064079447022497234b7c28bd1eae0b78c5b6985053f4f498291e
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [3.2.2] - 2022-09-20
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- [#1276](https://github.com/prettier/plugin-ruby/pull/1276) - kddnewton - Fix the parsing for options being passed to the server process.
|
14
|
+
|
9
15
|
## [3.2.1] - 2022-09-19
|
10
16
|
|
11
17
|
### Changed
|
@@ -1261,7 +1267,8 @@ would previously result in `array[]`, but now prints properly.
|
|
1261
1267
|
|
1262
1268
|
- Initial release 🎉
|
1263
1269
|
|
1264
|
-
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.
|
1270
|
+
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...HEAD
|
1271
|
+
[3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2
|
1265
1272
|
[3.2.1]: https://github.com/prettier/plugin-ruby/compare/v3.2.0...v3.2.1
|
1266
1273
|
[3.2.0]: https://github.com/prettier/plugin-ruby/compare/v3.1.2...v3.2.0
|
1267
1274
|
[3.1.2]: https://github.com/prettier/plugin-ruby/compare/v3.1.1...v3.1.2
|
data/package.json
CHANGED
data/src/parseSync.js
CHANGED
@@ -59,6 +59,26 @@ function getInfoFilepath() {
|
|
59
59
|
return path.join(os.tmpdir(), `prettier-ruby-parser-${process.pid}.info`);
|
60
60
|
}
|
61
61
|
|
62
|
+
// Return the list of plugins that should be passed to the server process.
|
63
|
+
function getPlugins(opts) {
|
64
|
+
const plugins = new Set();
|
65
|
+
|
66
|
+
const rubyPlugins = opts.rubyPlugins.trim();
|
67
|
+
if (rubyPlugins.length > 0) {
|
68
|
+
rubyPlugins.split(",").forEach((plugin) => plugins.add(plugin.trim()));
|
69
|
+
}
|
70
|
+
|
71
|
+
if (opts.singleQuote) {
|
72
|
+
plugins.add("plugin/single_quotes");
|
73
|
+
}
|
74
|
+
|
75
|
+
if (opts.trailingComma !== "none") {
|
76
|
+
plugins.add("plugin/trailing_comma");
|
77
|
+
}
|
78
|
+
|
79
|
+
return Array.from(plugins);
|
80
|
+
}
|
81
|
+
|
62
82
|
// Create a file that will act as a communication mechanism, spawn a parser
|
63
83
|
// server with that filepath as an argument, then spawn another process that
|
64
84
|
// will read that information in order to enable us to connect to it in the
|
@@ -114,20 +134,9 @@ function spawnServer(opts) {
|
|
114
134
|
};
|
115
135
|
}
|
116
136
|
|
117
|
-
const plugins = new Set(opts.rubyPlugins.split(","));
|
118
|
-
if (opts.singleQuote) {
|
119
|
-
plugins.add("plugin/single_quotes");
|
120
|
-
}
|
121
|
-
|
122
|
-
if (opts.trailingComma !== "none") {
|
123
|
-
plugins.add("plugin/trailing_comma");
|
124
|
-
}
|
125
|
-
|
126
|
-
const rubyPlugins = Array.from(plugins).join(",");
|
127
|
-
|
128
137
|
const server = spawn(
|
129
138
|
"ruby",
|
130
|
-
[serverRbPath, `--plugins=${
|
139
|
+
[serverRbPath, `--plugins=${getPlugins(opts).join(",")}`, filepath],
|
131
140
|
{
|
132
141
|
env: Object.assign({}, process.env, { LANG: getLang() }),
|
133
142
|
detached: true,
|
data/src/server.rb
CHANGED
@@ -129,7 +129,9 @@ listener =
|
|
129
129
|
PrettierPrint
|
130
130
|
end
|
131
131
|
|
132
|
-
formatter =
|
132
|
+
formatter =
|
133
|
+
formatter_class.new(source, +"", maxwidth, "\n", &genspace)
|
134
|
+
|
133
135
|
SyntaxTree::Haml.parse(source).format(formatter)
|
134
136
|
formatter.flush
|
135
137
|
formatter.output
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prettier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Newton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: syntax_tree
|