prettier-plugin-embed 0.7.2 → 0.8.0
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.
- package/README.md +26 -0
- package/dist/embedded/create-embedder.d.ts +2 -3
- package/dist/embedded/markdown/embedder.d.ts +1 -6
- package/dist/embedded/register.d.ts +31 -31
- package/dist/embedded/utils.d.ts +9 -12
- package/dist/embedded/yaml/embedder.d.ts +1 -6
- package/dist/index.js +918 -922
- package/dist/utils.d.ts +1 -1
- package/package.json +41 -8
package/dist/index.js
CHANGED
|
@@ -1,154 +1,175 @@
|
|
|
1
1
|
import { builders as e, utils as t } from "prettier/doc";
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
4
|
-
import
|
|
5
|
-
import a from "prettier/parser-
|
|
6
|
-
import o from "prettier/parser-
|
|
7
|
-
import s from "prettier/
|
|
8
|
-
import c from "prettier/parser-meriyah";
|
|
9
|
-
import l from "prettier/parser-typescript";
|
|
10
|
-
import { printers as u } from "prettier/plugins/estree.mjs";
|
|
11
|
-
import { resolveConfigFile as d } from "prettier";
|
|
2
|
+
import n from "prettier/parser-babel";
|
|
3
|
+
import r from "prettier/parser-espree";
|
|
4
|
+
import i from "prettier/parser-flow";
|
|
5
|
+
import a from "prettier/parser-meriyah";
|
|
6
|
+
import o from "prettier/parser-typescript";
|
|
7
|
+
import { printers as s } from "prettier/plugins/estree.mjs";
|
|
12
8
|
//#region \0rolldown/runtime.js
|
|
13
|
-
var
|
|
9
|
+
var c = Object.defineProperty, l = (e, t) => {
|
|
14
10
|
let n = {};
|
|
15
|
-
for (var r in e)
|
|
11
|
+
for (var r in e) c(n, r, {
|
|
16
12
|
get: e[r],
|
|
17
13
|
enumerable: !0
|
|
18
14
|
});
|
|
19
|
-
return t ||
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
29
|
-
})), n.push.apply(n, r);
|
|
30
|
-
}
|
|
31
|
-
return n;
|
|
32
|
-
}
|
|
33
|
-
function h(e) {
|
|
34
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
35
|
-
var n = arguments[t] == null ? {} : arguments[t];
|
|
36
|
-
t % 2 ? m(Object(n), !0).forEach(function(t) {
|
|
37
|
-
ee(e, t, n[t]);
|
|
38
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : m(Object(n)).forEach(function(t) {
|
|
39
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return e;
|
|
43
|
-
}
|
|
44
|
-
function ee(e, t, n) {
|
|
45
|
-
return t = te(t), t in e ? Object.defineProperty(e, t, {
|
|
46
|
-
value: n,
|
|
47
|
-
enumerable: !0,
|
|
48
|
-
configurable: !0,
|
|
49
|
-
writable: !0
|
|
50
|
-
}) : e[t] = n, e;
|
|
51
|
-
}
|
|
52
|
-
function te(e) {
|
|
53
|
-
var t = ne(e, "string");
|
|
54
|
-
return typeof t == "symbol" ? t : String(t);
|
|
15
|
+
return t || c(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
16
|
+
}, { group: u, indent: d, line: f, softline: p, lineSuffixBoundary: m, addAlignmentToDoc: h, align: g, hardline: _, dedentToRoot: v, markAsRoot: ee, literalline: te, trim: ne, label: re } = e, { mapDoc: ie, replaceEndOfLine: ae, traverseDoc: oe, willBreak: se } = t, ce = Symbol("embedded-expression"), le = Symbol("embedded-expressions"), ue = /^[\t ]*/, de = /^[\t ]*(?=\S)/gm, fe = /\r?\n[\t ]*$/, pe = /\n[\t ]*$/, me = /([\\`]|\${)/g, he = /<\/(?=script\b)/gi, ge = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
|
17
|
+
function _e(e) {
|
|
18
|
+
if (typeof e == "string") return !1;
|
|
19
|
+
let t = !1;
|
|
20
|
+
return oe(e, (e) => {
|
|
21
|
+
if (t) return !1;
|
|
22
|
+
e && typeof e == "object" && !Array.isArray(e) && (t = !!(e.type === "line" && e.literal || e.type === "align" && e.n === -Infinity));
|
|
23
|
+
}, void 0, !0), t;
|
|
55
24
|
}
|
|
56
|
-
function
|
|
57
|
-
if (typeof e != "object" ||
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
let t = r
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
25
|
+
function ve(e) {
|
|
26
|
+
if (!e || typeof e != "object" || Array.isArray(e) || e.type !== "label" || e.label !== le) return e;
|
|
27
|
+
let t = /* @__PURE__ */ new WeakMap();
|
|
28
|
+
function n(e, n) {
|
|
29
|
+
if (typeof e != "object" || !e) return e;
|
|
30
|
+
let i = t.get(n);
|
|
31
|
+
i || (i = /* @__PURE__ */ new Map(), t.set(n, i));
|
|
32
|
+
let a = i.get(e);
|
|
33
|
+
if (a !== void 0) return a;
|
|
34
|
+
let o = r(e, n);
|
|
35
|
+
return i.set(e, o), o;
|
|
36
|
+
}
|
|
37
|
+
function r(e, t) {
|
|
38
|
+
if (Array.isArray(e)) return e.map((e) => n(e, t));
|
|
39
|
+
if (e.type === "label" && e.label === ce) {
|
|
40
|
+
let n = e.contents, r = 0, i;
|
|
41
|
+
for (let e = t.root; e; e = e.parent) r++, i = e.indentation;
|
|
42
|
+
if (r === 0) return n;
|
|
43
|
+
for (let e = t.indentation; e && e !== i; e = e.parent) n = {
|
|
44
|
+
...e.doc,
|
|
45
|
+
contents: n
|
|
46
|
+
};
|
|
47
|
+
for (; r-- > 0;) n = v(n);
|
|
48
|
+
return n;
|
|
77
49
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
50
|
+
if (e.type === "fill") return {
|
|
51
|
+
...e,
|
|
52
|
+
parts: e.parts.map((e) => n(e, t))
|
|
53
|
+
};
|
|
54
|
+
if (e.type === "if-break") return {
|
|
55
|
+
...e,
|
|
56
|
+
breakContents: n(e.breakContents, t),
|
|
57
|
+
flatContents: n(e.flatContents, t)
|
|
58
|
+
};
|
|
59
|
+
if (e.type === "group" && e.expandedStates) {
|
|
60
|
+
let r = e.expandedStates.map((e) => n(e, t));
|
|
61
|
+
return {
|
|
62
|
+
...e,
|
|
63
|
+
contents: r[0],
|
|
64
|
+
expandedStates: r
|
|
65
|
+
};
|
|
85
66
|
}
|
|
86
|
-
if (
|
|
87
|
-
let
|
|
88
|
-
|
|
67
|
+
if (e.type === "indent-if-break") {
|
|
68
|
+
let r = e;
|
|
69
|
+
return {
|
|
70
|
+
...r,
|
|
71
|
+
contents: n(r.contents, {
|
|
72
|
+
...t,
|
|
73
|
+
indentation: {
|
|
74
|
+
doc: r,
|
|
75
|
+
parent: t.indentation
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
};
|
|
89
79
|
}
|
|
90
|
-
|
|
91
|
-
let r = t
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
if ("contents" in e) {
|
|
81
|
+
let r = t;
|
|
82
|
+
return e.type === "align" && typeof e.n == "object" ? r = {
|
|
83
|
+
...t,
|
|
84
|
+
root: {
|
|
85
|
+
indentation: t.indentation,
|
|
86
|
+
parent: t.root
|
|
87
|
+
}
|
|
88
|
+
} : e.type === "align" && e.n === -Infinity ? r = {
|
|
89
|
+
indentation: t.root?.indentation,
|
|
90
|
+
root: t.root?.parent
|
|
91
|
+
} : (e.type === "align" || e.type === "indent") && (r = {
|
|
92
|
+
...t,
|
|
93
|
+
indentation: {
|
|
94
|
+
doc: e,
|
|
95
|
+
parent: t.indentation
|
|
96
|
+
}
|
|
97
|
+
}), {
|
|
98
|
+
...e,
|
|
99
|
+
contents: n(e.contents, r)
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return e;
|
|
102
103
|
}
|
|
103
|
-
return e;
|
|
104
|
+
return n(e.contents, { root: {} });
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
function y(e, t, n = !1) {
|
|
107
|
+
let r = e.quasis.map((e, n, { length: r }) => n === r - 1 ? e.value.cooked : e.value.cooked + t(n)).join(""), i = r.length - r.trimStart().length, a = Math.max(i, r.trimEnd().length), o = r.slice(0, i), s = r.slice(a), c = r.slice(i, a), l = r.matchAll(de), u = l.next().value?.[0] ?? "";
|
|
108
|
+
for (; u;) {
|
|
109
|
+
let e = l.next().value?.[0];
|
|
110
|
+
if (e === void 0) break;
|
|
111
|
+
let t = 0;
|
|
112
|
+
for (; t < u.length && u[t] === e[t];) t++;
|
|
113
|
+
u = u.slice(0, t);
|
|
114
|
+
}
|
|
115
|
+
let d = u ? RegExp(`(\\r?\\n)${u}`, "g") : void 0;
|
|
116
|
+
if (c) {
|
|
117
|
+
let e = (o.includes("\n") ? o.slice(o.lastIndexOf("\n") + 1) : "").slice(u.length);
|
|
118
|
+
o = o.slice(0, o.length - e.length), c = e + (d ? c.replace(d, "$1") : c);
|
|
119
|
+
}
|
|
120
|
+
return n && s.includes("\n") && (c += d ? s.replace(d, "$1") : s, s = fe.exec(s)?.[0] ?? ""), {
|
|
121
|
+
text: c,
|
|
122
|
+
leadingWhitespaces: o,
|
|
123
|
+
trailingWhitespaces: s
|
|
114
124
|
};
|
|
115
125
|
}
|
|
116
126
|
function b(e, t, n, r, i, a = !1) {
|
|
117
|
-
let o =
|
|
118
|
-
if (o) return
|
|
127
|
+
let o = t.preserveEmbeddedExteriorWhitespaces?.includes(n), s = t.noEmbeddedMultiLineIndentation?.includes(n);
|
|
128
|
+
if (!o && a && (!r || !i)) return u([
|
|
119
129
|
"`",
|
|
120
|
-
r,
|
|
121
|
-
s ?
|
|
122
|
-
i,
|
|
130
|
+
r ? " " : "",
|
|
131
|
+
s ? v(u(e)) : u(e),
|
|
132
|
+
i ? " " : "",
|
|
123
133
|
"`"
|
|
124
134
|
]);
|
|
125
|
-
let
|
|
126
|
-
|
|
135
|
+
let c = ee(u(ve(e)));
|
|
136
|
+
if (o) {
|
|
137
|
+
let e = r.includes("\n"), t = r.slice(r.lastIndexOf("\n") + 1);
|
|
138
|
+
return u([
|
|
139
|
+
"`",
|
|
140
|
+
ae(r),
|
|
141
|
+
v(g(e ? t : "", c)),
|
|
142
|
+
ae(i),
|
|
143
|
+
"`"
|
|
144
|
+
]);
|
|
145
|
+
}
|
|
146
|
+
let l = r.length ? f : p, m = i.length ? f : p;
|
|
147
|
+
return u([
|
|
127
148
|
"`",
|
|
128
|
-
s ? [l, c] :
|
|
129
|
-
|
|
149
|
+
s ? v([l, c]) : d([l, c]),
|
|
150
|
+
m,
|
|
130
151
|
"`"
|
|
131
|
-
]);
|
|
152
|
+
], { shouldBreak: se(e) });
|
|
132
153
|
}
|
|
133
|
-
function
|
|
154
|
+
function ye(e, t) {
|
|
134
155
|
let n = 0;
|
|
135
156
|
for (let r of e) r === " " ? n = n + t - n % t : n++;
|
|
136
157
|
return n;
|
|
137
158
|
}
|
|
138
|
-
function
|
|
139
|
-
let n = e.lastIndexOf("\n"), r = e.slice(n + 1), i =
|
|
140
|
-
return
|
|
159
|
+
function be(e, t) {
|
|
160
|
+
let n = e.lastIndexOf("\n"), r = e.slice(n + 1), i = ue.exec(r)[0];
|
|
161
|
+
return ye(i, t);
|
|
141
162
|
}
|
|
142
|
-
function
|
|
163
|
+
function xe(e, t, n) {
|
|
143
164
|
let r = t, i = e.quasis[r].value.raw;
|
|
144
165
|
if (i.includes("\n")) return {
|
|
145
|
-
indentSize:
|
|
166
|
+
indentSize: be(i, n),
|
|
146
167
|
previousQuasiText: i
|
|
147
168
|
};
|
|
148
169
|
for (; r-- > 0;) {
|
|
149
170
|
let t = e.quasis[r].value.raw;
|
|
150
171
|
if (t.includes("\n")) return {
|
|
151
|
-
indentSize:
|
|
172
|
+
indentSize: be(t, n),
|
|
152
173
|
previousQuasiText: i
|
|
153
174
|
};
|
|
154
175
|
}
|
|
@@ -157,68 +178,82 @@ function he(e, t, n) {
|
|
|
157
178
|
previousQuasiText: i
|
|
158
179
|
};
|
|
159
180
|
}
|
|
160
|
-
function
|
|
181
|
+
function Se(e, t, n, r, i, a = !0, o) {
|
|
161
182
|
let { node: s } = e, c = t();
|
|
162
|
-
if (s?.comments?.length && (c =
|
|
183
|
+
if (s?.comments?.length && (c = u([d([p, c]), p])), !a) return u([
|
|
163
184
|
"${",
|
|
164
185
|
c,
|
|
165
|
-
|
|
186
|
+
m,
|
|
166
187
|
"}"
|
|
167
188
|
]);
|
|
168
|
-
let { indentSize: l, previousQuasiText:
|
|
189
|
+
let { indentSize: l, previousQuasiText: f } = o === void 0 ? xe(n, r, i) : {
|
|
169
190
|
indentSize: o,
|
|
170
191
|
previousQuasiText: n.quasis[r].value.raw
|
|
171
|
-
},
|
|
172
|
-
return
|
|
192
|
+
}, _ = c;
|
|
193
|
+
return _ = l === 0 && f.endsWith("\n") ? g(-Infinity, _) : h(_, l, i), u([
|
|
173
194
|
"${",
|
|
174
|
-
|
|
175
|
-
|
|
195
|
+
_,
|
|
196
|
+
m,
|
|
176
197
|
"}"
|
|
177
198
|
]);
|
|
178
199
|
}
|
|
179
|
-
function
|
|
200
|
+
function Ce(e, t, n, r = !0) {
|
|
180
201
|
let i = n?.tabWidth ?? 2, a = e.node, o = 0;
|
|
181
202
|
return e.map((e, n) => {
|
|
182
203
|
if (r) {
|
|
183
204
|
let e = a.quasis[n].value.raw;
|
|
184
|
-
e.includes("\n") && (o =
|
|
205
|
+
e.includes("\n") && (o = be(e, i));
|
|
185
206
|
}
|
|
186
|
-
return
|
|
207
|
+
return Se(e, t, a, n, i, r, o);
|
|
187
208
|
}, "expressions");
|
|
188
209
|
}
|
|
189
|
-
function
|
|
190
|
-
let s = n.length ? /* @__PURE__ */ new Set() : void 0,
|
|
210
|
+
function x(e, t, n, { lineBreakBeforeExpressions: r, interpolationTabWidth: i, escapeClosingScript: a = !1 } = {}) {
|
|
211
|
+
let o = !1, s = n.map((e) => _e(e) ? (o = !0, re(ce, e)) : e), c = n.length ? /* @__PURE__ */ new Set() : void 0, l = ie(e, (e) => {
|
|
191
212
|
if (typeof e != "string") return e;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
213
|
+
if (!n.length) return we(e, a);
|
|
214
|
+
let o = e.split(t);
|
|
215
|
+
if (o.length === 1) return we(e, a);
|
|
216
|
+
let l = [], u = "";
|
|
217
|
+
for (let e = 0; e < o.length; e++) {
|
|
218
|
+
let t = o[e];
|
|
195
219
|
if (e % 2 == 0) {
|
|
196
|
-
if (e === 0 || t.includes("\n")) {
|
|
220
|
+
if (i !== void 0 && (e === 0 || t.includes("\n"))) {
|
|
197
221
|
let e = t.slice(t.lastIndexOf("\n") + 1);
|
|
198
|
-
u =
|
|
222
|
+
u = ue.exec(e)[0];
|
|
199
223
|
}
|
|
200
224
|
if (!t) continue;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
else
|
|
225
|
+
let n = we(t, a);
|
|
226
|
+
if (Array.isArray(n)) for (let e of n) l.push(e);
|
|
227
|
+
else l.push(n);
|
|
204
228
|
} else {
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
if (
|
|
209
|
-
let e =
|
|
210
|
-
typeof e == "string"
|
|
229
|
+
let n = Number(t);
|
|
230
|
+
c?.add(n);
|
|
231
|
+
let a = o[e - 1];
|
|
232
|
+
if (r?.has(n) && !pe.test(a)) {
|
|
233
|
+
let e = l.at(-1);
|
|
234
|
+
if (typeof e == "string") {
|
|
235
|
+
let t = e.length;
|
|
236
|
+
for (; e[t - 1] === " " || e[t - 1] === " ";) t--;
|
|
237
|
+
l[l.length - 1] = e.slice(0, t);
|
|
238
|
+
}
|
|
239
|
+
l.push(_), i !== void 0 && l.push(u);
|
|
211
240
|
}
|
|
212
|
-
let d = n
|
|
213
|
-
|
|
241
|
+
let d = s[n];
|
|
242
|
+
l.push(i === void 0 ? d : g(ye(u, i), d));
|
|
214
243
|
}
|
|
215
244
|
}
|
|
216
|
-
return
|
|
245
|
+
return l;
|
|
217
246
|
});
|
|
218
|
-
if (n.some((e, t) => !
|
|
219
|
-
return
|
|
247
|
+
if (n.some((e, t) => !c.has(t))) throw Error("The embedded formatter changed an expression placeholder.");
|
|
248
|
+
return o ? re(le, l) : l;
|
|
220
249
|
}
|
|
221
|
-
function
|
|
250
|
+
function we(e, t) {
|
|
251
|
+
if (e = e.replace(me, "\\$1"), t && (e = e.replace(he, "<\\/")), !e.includes("\n")) return e;
|
|
252
|
+
let n = e.split("\n"), r = [n[0]];
|
|
253
|
+
for (let e = 1; e < n.length; e++) e > 1 && n[e - 1] === "" && r.push(ne), r.push(te, n[e]);
|
|
254
|
+
return r;
|
|
255
|
+
}
|
|
256
|
+
function Te(e, t, n) {
|
|
222
257
|
if (t === n) {
|
|
223
258
|
e.unshift(t);
|
|
224
259
|
return;
|
|
@@ -234,151 +269,148 @@ function _e(e, t, n) {
|
|
|
234
269
|
}
|
|
235
270
|
e.splice(r, 0, t);
|
|
236
271
|
}
|
|
237
|
-
var
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
function C(e = "p", t = "") {
|
|
246
|
-
let n = ve(), r = ve(), i = ye(e), a = ye(t);
|
|
272
|
+
var Ee = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
273
|
+
function De() {
|
|
274
|
+
let e = "";
|
|
275
|
+
for (let t = 0; t < 16; t++) e += Ee[Math.floor(Math.random() * 36)];
|
|
276
|
+
return e;
|
|
277
|
+
}
|
|
278
|
+
function Oe(e = "p", t = "") {
|
|
279
|
+
let n = De(), r = De(), i = ke(e), a = ke(t);
|
|
247
280
|
return {
|
|
248
281
|
createPlaceholder: (i) => `${e}${n}${i}${r}${t}`,
|
|
249
282
|
placeholderRegex: RegExp(`${i}${n}(\\d+)${r}${a}`, "ig")
|
|
250
283
|
};
|
|
251
284
|
}
|
|
252
|
-
function
|
|
253
|
-
return e.replace(
|
|
285
|
+
function ke(e) {
|
|
286
|
+
return e.replace(ge, "\\$&");
|
|
254
287
|
}
|
|
255
|
-
function
|
|
288
|
+
function S(e) {
|
|
256
289
|
return `${e}Identifiers`;
|
|
257
290
|
}
|
|
258
|
-
function
|
|
291
|
+
function C(e) {
|
|
259
292
|
return `${e}Comments`;
|
|
260
293
|
}
|
|
261
|
-
function
|
|
294
|
+
function w(e) {
|
|
262
295
|
return `${e}Tags`;
|
|
263
296
|
}
|
|
264
|
-
function
|
|
297
|
+
function Ae(e) {
|
|
265
298
|
return `${e}Plugin`;
|
|
266
299
|
}
|
|
267
|
-
function
|
|
300
|
+
function T(e) {
|
|
268
301
|
return `${e}Parser`;
|
|
269
302
|
}
|
|
270
|
-
var
|
|
303
|
+
var E = "9ff2b366e8ca4c97b9aed1a29b5b94ed";
|
|
271
304
|
//#endregion
|
|
272
305
|
//#region src/embedded/create-embedder.ts
|
|
273
|
-
function
|
|
274
|
-
return async (c, l, u,
|
|
275
|
-
let
|
|
276
|
-
...
|
|
277
|
-
...
|
|
278
|
-
}, { createPlaceholder:
|
|
279
|
-
...
|
|
306
|
+
function D({ parser: e, parserOption: t, parserOptions: n, markup: r = !1, preserveTrailingWhitespace: i = !1, placeholderPrefix: a = "p", transformDoc: o }) {
|
|
307
|
+
return async (s, c, l, u, { commentOrTag: d, embeddedOverrideOptions: f }) => {
|
|
308
|
+
let p = {
|
|
309
|
+
...u,
|
|
310
|
+
...f
|
|
311
|
+
}, { createPlaceholder: m, placeholderRegex: h } = Oe(a), { text: g, leadingWhitespaces: _, trailingWhitespaces: v } = y(l.node, m, i), ee = Ce(l, c, p, !1), te = t ? p[t] : void 0, ne = await s(g, {
|
|
312
|
+
...p,
|
|
280
313
|
...n,
|
|
281
|
-
parser:
|
|
314
|
+
parser: te ?? e
|
|
282
315
|
});
|
|
283
|
-
return b(
|
|
316
|
+
return b(x(o ? o(ne) : ne, h, ee, {
|
|
317
|
+
interpolationTabWidth: p.tabWidth,
|
|
318
|
+
escapeClosingScript: !!p.__embeddedInHtml
|
|
319
|
+
}), p, d, _, v, r && (p.htmlWhitespaceSensitivity === "strict" || p.htmlWhitespaceSensitivity === "css"));
|
|
284
320
|
};
|
|
285
321
|
}
|
|
286
322
|
//#endregion
|
|
287
323
|
//#region src/embedded/astro/embedder.ts
|
|
288
|
-
var
|
|
324
|
+
var je = D({
|
|
289
325
|
parser: "astro",
|
|
290
326
|
markup: !0
|
|
291
|
-
}),
|
|
292
|
-
[
|
|
327
|
+
}), Me = "embeddedAstro", Ne = ["astro"], Pe = C(Me), Fe = w(Me), Ie = {
|
|
328
|
+
[Pe]: {
|
|
293
329
|
category: "Embed",
|
|
294
330
|
type: "string",
|
|
295
331
|
array: !0,
|
|
296
|
-
default: [{ value: [...
|
|
332
|
+
default: [{ value: [...Ne] }],
|
|
297
333
|
description: "Block comments that identify embedded Astro in template literals. Requires the `prettier-plugin-astro` plugin."
|
|
298
334
|
},
|
|
299
|
-
[
|
|
335
|
+
[Fe]: {
|
|
300
336
|
category: "Embed",
|
|
301
337
|
type: "string",
|
|
302
338
|
array: !0,
|
|
303
|
-
default: [{ value: [...
|
|
339
|
+
default: [{ value: [...Ne] }],
|
|
304
340
|
description: "Tags that identify embedded Astro in template literals. Requires the `prettier-plugin-astro` plugin."
|
|
305
341
|
}
|
|
306
|
-
},
|
|
307
|
-
embedder: () =>
|
|
308
|
-
language: () =>
|
|
309
|
-
options: () =>
|
|
310
|
-
}),
|
|
342
|
+
}, Le = /* @__PURE__ */ l({
|
|
343
|
+
embedder: () => je,
|
|
344
|
+
language: () => Me,
|
|
345
|
+
options: () => Ie
|
|
346
|
+
}), Re = D({
|
|
311
347
|
parser: "scss",
|
|
312
348
|
parserOption: "embeddedCssParser",
|
|
313
|
-
placeholderPrefix: "@prettier-placeholder"
|
|
314
|
-
|
|
315
|
-
}), A = "embeddedCss", ke = ["css"], Ae = [
|
|
349
|
+
placeholderPrefix: "@prettier-placeholder"
|
|
350
|
+
}), O = "embeddedCss", ze = ["css"], Be = [
|
|
316
351
|
"css",
|
|
317
352
|
"less",
|
|
318
353
|
"scss"
|
|
319
|
-
],
|
|
320
|
-
[
|
|
354
|
+
], Ve = S(O), He = C(O), Ue = w(O), We = T(O), Ge = {
|
|
355
|
+
[Ve]: {
|
|
321
356
|
category: "Embed",
|
|
322
357
|
type: "string",
|
|
323
358
|
array: !0,
|
|
324
|
-
default: [{ value: [...
|
|
359
|
+
default: [{ value: [...ze] }],
|
|
325
360
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded CSS language.",
|
|
326
|
-
deprecated: `Please use \`${
|
|
361
|
+
deprecated: `Please use \`${He}\` or \`${Ue}\`.`
|
|
327
362
|
},
|
|
328
|
-
[
|
|
363
|
+
[He]: {
|
|
329
364
|
category: "Embed",
|
|
330
365
|
type: "string",
|
|
331
366
|
array: !0,
|
|
332
|
-
default: [{ value: [
|
|
367
|
+
default: [{ value: [E] }],
|
|
333
368
|
description: "Block comments that make their subsequent template literals be identified as embedded CSS language."
|
|
334
369
|
},
|
|
335
|
-
[
|
|
370
|
+
[Ue]: {
|
|
336
371
|
category: "Embed",
|
|
337
372
|
type: "string",
|
|
338
373
|
array: !0,
|
|
339
|
-
default: [{ value: [
|
|
374
|
+
default: [{ value: [E] }],
|
|
340
375
|
description: "Tags that make their subsequent template literals be identified as embedded CSS language."
|
|
341
376
|
},
|
|
342
|
-
[
|
|
377
|
+
[We]: {
|
|
343
378
|
category: "Embed",
|
|
344
379
|
type: "choice",
|
|
345
380
|
default: "scss",
|
|
346
381
|
description: "The parser used to parse the embedded CSS language.",
|
|
347
|
-
choices:
|
|
382
|
+
choices: Be.map((e) => ({
|
|
348
383
|
value: e,
|
|
349
384
|
description: `Use the "${e}" parser.`
|
|
350
385
|
}))
|
|
351
386
|
}
|
|
352
|
-
},
|
|
353
|
-
embedder: () =>
|
|
354
|
-
language: () =>
|
|
355
|
-
options: () =>
|
|
356
|
-
}),
|
|
357
|
-
|
|
358
|
-
newlineHandling: "hardline"
|
|
359
|
-
}), Re = "embeddedDockerfile", ze = ["dockerfile", "containerfile"], Be = T(Re), Ve = E(Re), He = {
|
|
360
|
-
[Be]: {
|
|
387
|
+
}, Ke = /* @__PURE__ */ l({
|
|
388
|
+
embedder: () => Re,
|
|
389
|
+
language: () => O,
|
|
390
|
+
options: () => Ge
|
|
391
|
+
}), qe = D({ parser: "dockerfile" }), Je = "embeddedDockerfile", Ye = ["dockerfile", "containerfile"], Xe = C(Je), Ze = w(Je), Qe = {
|
|
392
|
+
[Xe]: {
|
|
361
393
|
category: "Embed",
|
|
362
394
|
type: "string",
|
|
363
395
|
array: !0,
|
|
364
|
-
default: [{ value: [...
|
|
396
|
+
default: [{ value: [...Ye] }],
|
|
365
397
|
description: "Block comments that identify embedded Dockerfile in template literals. Requires the `prettier-plugin-sh` plugin."
|
|
366
398
|
},
|
|
367
|
-
[
|
|
399
|
+
[Ze]: {
|
|
368
400
|
category: "Embed",
|
|
369
401
|
type: "string",
|
|
370
402
|
array: !0,
|
|
371
|
-
default: [{ value: [...
|
|
403
|
+
default: [{ value: [...Ye] }],
|
|
372
404
|
description: "Tags that identify embedded Dockerfile in template literals. Requires the `prettier-plugin-sh` plugin."
|
|
373
405
|
}
|
|
374
|
-
},
|
|
375
|
-
embedder: () =>
|
|
376
|
-
language: () =>
|
|
377
|
-
options: () =>
|
|
378
|
-
}),
|
|
406
|
+
}, $e = /* @__PURE__ */ l({
|
|
407
|
+
embedder: () => qe,
|
|
408
|
+
language: () => Je,
|
|
409
|
+
options: () => Qe
|
|
410
|
+
}), et = D({
|
|
379
411
|
parser: "babel",
|
|
380
412
|
parserOption: "embeddedEsParser"
|
|
381
|
-
}),
|
|
413
|
+
}), k = "embeddedEs", tt = [
|
|
382
414
|
"js",
|
|
383
415
|
"jsx",
|
|
384
416
|
"es",
|
|
@@ -387,336 +419,328 @@ var xe = k({
|
|
|
387
419
|
"cjs",
|
|
388
420
|
"pac",
|
|
389
421
|
"javascript"
|
|
390
|
-
],
|
|
422
|
+
], nt = [
|
|
391
423
|
"babel",
|
|
392
424
|
"babel-flow",
|
|
393
425
|
"acorn",
|
|
394
426
|
"espree",
|
|
395
427
|
"flow",
|
|
396
428
|
"meriyah"
|
|
397
|
-
],
|
|
398
|
-
[
|
|
429
|
+
], rt = S(k), it = C(k), at = w(k), ot = T(k), st = {
|
|
430
|
+
[rt]: {
|
|
399
431
|
category: "Embed",
|
|
400
432
|
type: "string",
|
|
401
433
|
array: !0,
|
|
402
|
-
default: [{ value: [...
|
|
434
|
+
default: [{ value: [...tt] }],
|
|
403
435
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language.",
|
|
404
|
-
deprecated: `Please use \`${
|
|
436
|
+
deprecated: `Please use \`${it}\` or \`${at}\`.`
|
|
405
437
|
},
|
|
406
|
-
[
|
|
438
|
+
[it]: {
|
|
407
439
|
category: "Embed",
|
|
408
440
|
type: "string",
|
|
409
441
|
array: !0,
|
|
410
|
-
default: [{ value: [
|
|
442
|
+
default: [{ value: [E] }],
|
|
411
443
|
description: "Block comments that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
412
444
|
},
|
|
413
|
-
[
|
|
445
|
+
[at]: {
|
|
414
446
|
category: "Embed",
|
|
415
447
|
type: "string",
|
|
416
448
|
array: !0,
|
|
417
|
-
default: [{ value: [
|
|
449
|
+
default: [{ value: [E] }],
|
|
418
450
|
description: "Tags that make their subsequent template literals be identified as embedded ECMAScript/JavaScript language."
|
|
419
451
|
},
|
|
420
|
-
[
|
|
452
|
+
[ot]: {
|
|
421
453
|
category: "Embed",
|
|
422
454
|
type: "choice",
|
|
423
455
|
default: "babel",
|
|
424
456
|
description: "The parser used to parse the embedded ECMASCript/JavaScript language.",
|
|
425
|
-
choices:
|
|
457
|
+
choices: nt.map((e) => ({
|
|
426
458
|
value: e,
|
|
427
459
|
description: `Use the "${e}" parser.`
|
|
428
460
|
}))
|
|
429
461
|
}
|
|
430
|
-
},
|
|
431
|
-
embedder: () =>
|
|
432
|
-
language: () =>
|
|
433
|
-
options: () =>
|
|
434
|
-
}),
|
|
435
|
-
[
|
|
462
|
+
}, ct = /* @__PURE__ */ l({
|
|
463
|
+
embedder: () => et,
|
|
464
|
+
language: () => k,
|
|
465
|
+
options: () => st
|
|
466
|
+
}), lt = D({ parser: "gherkin" }), ut = "embeddedGherkin", dt = ["gherkin", "feature"], ft = C(ut), pt = w(ut), mt = {
|
|
467
|
+
[ft]: {
|
|
436
468
|
category: "Embed",
|
|
437
469
|
type: "string",
|
|
438
470
|
array: !0,
|
|
439
|
-
default: [{ value: [...
|
|
471
|
+
default: [{ value: [...dt] }],
|
|
440
472
|
description: "Block comments that identify embedded Gherkin in template literals. Requires the `prettier-plugin-gherkin` plugin."
|
|
441
473
|
},
|
|
442
|
-
[
|
|
474
|
+
[pt]: {
|
|
443
475
|
category: "Embed",
|
|
444
476
|
type: "string",
|
|
445
477
|
array: !0,
|
|
446
|
-
default: [{ value: [...
|
|
478
|
+
default: [{ value: [...dt] }],
|
|
447
479
|
description: "Tags that identify embedded Gherkin in template literals. Requires the `prettier-plugin-gherkin` plugin."
|
|
448
480
|
}
|
|
449
|
-
},
|
|
450
|
-
embedder: () =>
|
|
451
|
-
language: () =>
|
|
452
|
-
options: () =>
|
|
453
|
-
}),
|
|
454
|
-
[
|
|
481
|
+
}, ht = /* @__PURE__ */ l({
|
|
482
|
+
embedder: () => lt,
|
|
483
|
+
language: () => ut,
|
|
484
|
+
options: () => mt
|
|
485
|
+
}), gt = D({ parser: "glsl-parser" }), _t = "embeddedGlsl", vt = ["glsl", "shader"], yt = S(_t), bt = C(_t), xt = w(_t), St = {
|
|
486
|
+
[yt]: {
|
|
455
487
|
category: "Embed",
|
|
456
488
|
type: "string",
|
|
457
489
|
array: !0,
|
|
458
|
-
default: [{ value: [...
|
|
490
|
+
default: [{ value: [...vt] }],
|
|
459
491
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin.",
|
|
460
|
-
deprecated: `Please use \`${
|
|
492
|
+
deprecated: `Please use \`${bt}\` or \`${xt}\`.`
|
|
461
493
|
},
|
|
462
|
-
[
|
|
494
|
+
[bt]: {
|
|
463
495
|
category: "Embed",
|
|
464
496
|
type: "string",
|
|
465
497
|
array: !0,
|
|
466
|
-
default: [{ value: [
|
|
498
|
+
default: [{ value: [E] }],
|
|
467
499
|
description: "Block comments that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
468
500
|
},
|
|
469
|
-
[
|
|
501
|
+
[xt]: {
|
|
470
502
|
category: "Embed",
|
|
471
503
|
type: "string",
|
|
472
504
|
array: !0,
|
|
473
|
-
default: [{ value: [
|
|
505
|
+
default: [{ value: [E] }],
|
|
474
506
|
description: "Tags that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin."
|
|
475
507
|
}
|
|
476
|
-
},
|
|
477
|
-
embedder: () =>
|
|
478
|
-
language: () =>
|
|
479
|
-
options: () =>
|
|
480
|
-
}),
|
|
508
|
+
}, Ct = /* @__PURE__ */ l({
|
|
509
|
+
embedder: () => gt,
|
|
510
|
+
language: () => _t,
|
|
511
|
+
options: () => St
|
|
512
|
+
}), wt = D({
|
|
481
513
|
parser: "go-template",
|
|
482
514
|
markup: !0
|
|
483
|
-
}),
|
|
484
|
-
[
|
|
515
|
+
}), Tt = "embeddedGoTemplate", Et = ["goTemplate", "gotmpl"], Dt = C(Tt), Ot = w(Tt), kt = {
|
|
516
|
+
[Dt]: {
|
|
485
517
|
category: "Embed",
|
|
486
518
|
type: "string",
|
|
487
519
|
array: !0,
|
|
488
|
-
default: [{ value: [...
|
|
520
|
+
default: [{ value: [...Et] }],
|
|
489
521
|
description: "Block comments that identify embedded Go Template in template literals. Requires the `@htnabe/prettier-plugin-go-template` plugin."
|
|
490
522
|
},
|
|
491
|
-
[
|
|
523
|
+
[Ot]: {
|
|
492
524
|
category: "Embed",
|
|
493
525
|
type: "string",
|
|
494
526
|
array: !0,
|
|
495
|
-
default: [{ value: [...
|
|
527
|
+
default: [{ value: [...Et] }],
|
|
496
528
|
description: "Tags that identify embedded Go Template in template literals. Requires the `@htnabe/prettier-plugin-go-template` plugin."
|
|
497
529
|
}
|
|
498
|
-
},
|
|
499
|
-
embedder: () =>
|
|
500
|
-
language: () =>
|
|
501
|
-
options: () =>
|
|
502
|
-
}),
|
|
503
|
-
[
|
|
530
|
+
}, At = /* @__PURE__ */ l({
|
|
531
|
+
embedder: () => wt,
|
|
532
|
+
language: () => Tt,
|
|
533
|
+
options: () => kt
|
|
534
|
+
}), jt = D({ parser: "graphql" }), A = "embeddedGraphql", Mt = ["graphql", "gql"], Nt = S(A), Pt = C(A), Ft = w(A), It = {
|
|
535
|
+
[Nt]: {
|
|
504
536
|
category: "Embed",
|
|
505
537
|
type: "string",
|
|
506
538
|
array: !0,
|
|
507
|
-
default: [{ value: [...
|
|
539
|
+
default: [{ value: [...Mt] }],
|
|
508
540
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded GraphQL language.",
|
|
509
|
-
deprecated: `Please use \`${
|
|
541
|
+
deprecated: `Please use \`${Pt}\` or \`${Ft}\`.`
|
|
510
542
|
},
|
|
511
|
-
[
|
|
543
|
+
[Pt]: {
|
|
512
544
|
category: "Embed",
|
|
513
545
|
type: "string",
|
|
514
546
|
array: !0,
|
|
515
|
-
default: [{ value: [
|
|
547
|
+
default: [{ value: [E] }],
|
|
516
548
|
description: "Block comments that make their subsequent template literals be identified as embedded GraphQL language."
|
|
517
549
|
},
|
|
518
|
-
[
|
|
550
|
+
[Ft]: {
|
|
519
551
|
category: "Embed",
|
|
520
552
|
type: "string",
|
|
521
553
|
array: !0,
|
|
522
|
-
default: [{ value: [
|
|
554
|
+
default: [{ value: [E] }],
|
|
523
555
|
description: "Tags that make their subsequent template literals be identified as embedded GraphQL language."
|
|
524
556
|
}
|
|
525
|
-
},
|
|
526
|
-
embedder: () =>
|
|
527
|
-
language: () =>
|
|
528
|
-
options: () =>
|
|
529
|
-
}),
|
|
557
|
+
}, Lt = /* @__PURE__ */ l({
|
|
558
|
+
embedder: () => jt,
|
|
559
|
+
language: () => A,
|
|
560
|
+
options: () => It
|
|
561
|
+
}), Rt = D({
|
|
530
562
|
parser: "handlebars",
|
|
531
563
|
markup: !0
|
|
532
|
-
}),
|
|
533
|
-
[
|
|
564
|
+
}), zt = "embeddedHandlebars", Bt = ["handlebars", "hbs"], Vt = C(zt), Ht = w(zt), Ut = {
|
|
565
|
+
[Vt]: {
|
|
534
566
|
category: "Embed",
|
|
535
567
|
type: "string",
|
|
536
568
|
array: !0,
|
|
537
|
-
default: [{ value: [...
|
|
569
|
+
default: [{ value: [...Bt] }],
|
|
538
570
|
description: "Block comments that identify embedded Handlebars in template literals. Requires the `@poliklot/prettier-plugin-handlebars` plugin."
|
|
539
571
|
},
|
|
540
|
-
[
|
|
572
|
+
[Ht]: {
|
|
541
573
|
category: "Embed",
|
|
542
574
|
type: "string",
|
|
543
575
|
array: !0,
|
|
544
|
-
default: [{ value: [...
|
|
576
|
+
default: [{ value: [...Bt] }],
|
|
545
577
|
description: "Tags that identify embedded Handlebars in template literals. Requires the `@poliklot/prettier-plugin-handlebars` plugin."
|
|
546
578
|
}
|
|
547
|
-
},
|
|
548
|
-
embedder: () =>
|
|
549
|
-
language: () =>
|
|
550
|
-
options: () =>
|
|
551
|
-
}),
|
|
579
|
+
}, Wt = /* @__PURE__ */ l({
|
|
580
|
+
embedder: () => Rt,
|
|
581
|
+
language: () => zt,
|
|
582
|
+
options: () => Ut
|
|
583
|
+
}), Gt = D({
|
|
552
584
|
parser: "html",
|
|
553
585
|
parserOption: "embeddedHtmlParser",
|
|
554
586
|
markup: !0
|
|
555
|
-
}),
|
|
587
|
+
}), j = "embeddedHtml", Kt = ["html", "xhtml"], qt = [
|
|
556
588
|
"html",
|
|
557
589
|
"vue",
|
|
558
590
|
"angular",
|
|
559
591
|
"lwc"
|
|
560
|
-
],
|
|
561
|
-
[
|
|
592
|
+
], Jt = S(j), Yt = C(j), Xt = w(j), Zt = T(j), Qt = {
|
|
593
|
+
[Jt]: {
|
|
562
594
|
category: "Embed",
|
|
563
595
|
type: "string",
|
|
564
596
|
array: !0,
|
|
565
|
-
default: [{ value: [...
|
|
597
|
+
default: [{ value: [...Kt] }],
|
|
566
598
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded HTML language.",
|
|
567
|
-
deprecated: `Please use \`${
|
|
599
|
+
deprecated: `Please use \`${Yt}\` or \`${Xt}\`.`
|
|
568
600
|
},
|
|
569
|
-
[
|
|
601
|
+
[Yt]: {
|
|
570
602
|
category: "Embed",
|
|
571
603
|
type: "string",
|
|
572
604
|
array: !0,
|
|
573
|
-
default: [{ value: [
|
|
605
|
+
default: [{ value: [E] }],
|
|
574
606
|
description: "Block comments that make their subsequent template literals be identified as embedded HTML language."
|
|
575
607
|
},
|
|
576
|
-
[
|
|
608
|
+
[Xt]: {
|
|
577
609
|
category: "Embed",
|
|
578
610
|
type: "string",
|
|
579
611
|
array: !0,
|
|
580
|
-
default: [{ value: [
|
|
612
|
+
default: [{ value: [E] }],
|
|
581
613
|
description: "Tags that make their subsequent template literals be identified as embedded HTML language."
|
|
582
614
|
},
|
|
583
|
-
[
|
|
615
|
+
[Zt]: {
|
|
584
616
|
category: "Embed",
|
|
585
617
|
type: "choice",
|
|
586
618
|
default: "html",
|
|
587
619
|
description: "The parser used to parse the embedded HTML language.",
|
|
588
|
-
choices:
|
|
620
|
+
choices: qt.map((e) => ({
|
|
589
621
|
value: e,
|
|
590
622
|
description: `Use the "${e}" parser.`
|
|
591
623
|
}))
|
|
592
624
|
}
|
|
593
|
-
},
|
|
594
|
-
embedder: () =>
|
|
595
|
-
language: () =>
|
|
596
|
-
options: () =>
|
|
597
|
-
}),
|
|
598
|
-
|
|
599
|
-
newlineHandling: "hardline",
|
|
600
|
-
dedentContent: !0
|
|
601
|
-
}), Kt = "embeddedHugo", qt = ["hugo", "hugoPost"], Jt = T(Kt), Yt = E(Kt), Xt = {
|
|
602
|
-
[Jt]: {
|
|
625
|
+
}, $t = /* @__PURE__ */ l({
|
|
626
|
+
embedder: () => Gt,
|
|
627
|
+
language: () => j,
|
|
628
|
+
options: () => Qt
|
|
629
|
+
}), en = D({ parser: "hugo-post" }), tn = "embeddedHugo", nn = ["hugo", "hugoPost"], rn = C(tn), an = w(tn), on = {
|
|
630
|
+
[rn]: {
|
|
603
631
|
category: "Embed",
|
|
604
632
|
type: "string",
|
|
605
633
|
array: !0,
|
|
606
|
-
default: [{ value: [...
|
|
634
|
+
default: [{ value: [...nn] }],
|
|
607
635
|
description: "Block comments that identify embedded Hugo in template literals. Requires the `@htnabe/prettier-plugin-hugo-post` plugin."
|
|
608
636
|
},
|
|
609
|
-
[
|
|
637
|
+
[an]: {
|
|
610
638
|
category: "Embed",
|
|
611
639
|
type: "string",
|
|
612
640
|
array: !0,
|
|
613
|
-
default: [{ value: [...
|
|
641
|
+
default: [{ value: [...nn] }],
|
|
614
642
|
description: "Tags that identify embedded Hugo in template literals. Requires the `@htnabe/prettier-plugin-hugo-post` plugin."
|
|
615
643
|
}
|
|
616
|
-
},
|
|
617
|
-
embedder: () =>
|
|
618
|
-
language: () =>
|
|
619
|
-
options: () =>
|
|
620
|
-
}),
|
|
644
|
+
}, sn = /* @__PURE__ */ l({
|
|
645
|
+
embedder: () => en,
|
|
646
|
+
language: () => tn,
|
|
647
|
+
options: () => on
|
|
648
|
+
}), cn = D({ parser: "ini" }), M = "embeddedIni", ln = [
|
|
621
649
|
"ini",
|
|
622
650
|
"cfg",
|
|
623
651
|
"pro"
|
|
624
|
-
],
|
|
625
|
-
[
|
|
652
|
+
], un = S(M), dn = C(M), fn = w(M), pn = {
|
|
653
|
+
[un]: {
|
|
626
654
|
category: "Embed",
|
|
627
655
|
type: "string",
|
|
628
656
|
array: !0,
|
|
629
|
-
default: [{ value: [
|
|
657
|
+
default: [{ value: [...ln] }],
|
|
630
658
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin.",
|
|
631
|
-
deprecated: `Please use \`${
|
|
659
|
+
deprecated: `Please use \`${dn}\` or \`${fn}\`.`
|
|
632
660
|
},
|
|
633
|
-
[
|
|
661
|
+
[dn]: {
|
|
634
662
|
category: "Embed",
|
|
635
663
|
type: "string",
|
|
636
664
|
array: !0,
|
|
637
|
-
default: [{ value: [
|
|
665
|
+
default: [{ value: [E] }],
|
|
638
666
|
description: "Block comments that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
639
667
|
},
|
|
640
|
-
[
|
|
668
|
+
[fn]: {
|
|
641
669
|
category: "Embed",
|
|
642
670
|
type: "string",
|
|
643
671
|
array: !0,
|
|
644
|
-
default: [{ value: [
|
|
672
|
+
default: [{ value: [E] }],
|
|
645
673
|
description: "Tags that make their subsequent template literals be identified as embedded INI language. This option requires the `prettier-plugin-ini` plugin."
|
|
646
674
|
}
|
|
647
|
-
},
|
|
648
|
-
embedder: () =>
|
|
649
|
-
language: () =>
|
|
650
|
-
options: () =>
|
|
651
|
-
}),
|
|
652
|
-
|
|
653
|
-
newlineHandling: "hardline"
|
|
654
|
-
}), P = "embeddedJava", sn = ["java"], cn = w(P), ln = T(P), un = E(P), dn = {
|
|
655
|
-
[cn]: {
|
|
675
|
+
}, mn = /* @__PURE__ */ l({
|
|
676
|
+
embedder: () => cn,
|
|
677
|
+
language: () => M,
|
|
678
|
+
options: () => pn
|
|
679
|
+
}), hn = D({ parser: "java" }), N = "embeddedJava", gn = ["java"], _n = S(N), vn = C(N), yn = w(N), bn = {
|
|
680
|
+
[_n]: {
|
|
656
681
|
category: "Embed",
|
|
657
682
|
type: "string",
|
|
658
683
|
array: !0,
|
|
659
|
-
default: [{ value: [...
|
|
684
|
+
default: [{ value: [...gn] }],
|
|
660
685
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.",
|
|
661
|
-
deprecated: `Please use \`${
|
|
686
|
+
deprecated: `Please use \`${vn}\` or \`${yn}\`.`
|
|
662
687
|
},
|
|
663
|
-
[
|
|
688
|
+
[vn]: {
|
|
664
689
|
category: "Embed",
|
|
665
690
|
type: "string",
|
|
666
691
|
array: !0,
|
|
667
|
-
default: [{ value: [
|
|
692
|
+
default: [{ value: [E] }],
|
|
668
693
|
description: "Block comments that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
669
694
|
},
|
|
670
|
-
[
|
|
695
|
+
[yn]: {
|
|
671
696
|
category: "Embed",
|
|
672
697
|
type: "string",
|
|
673
698
|
array: !0,
|
|
674
|
-
default: [{ value: [
|
|
699
|
+
default: [{ value: [E] }],
|
|
675
700
|
description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin."
|
|
676
701
|
}
|
|
677
|
-
},
|
|
678
|
-
embedder: () =>
|
|
679
|
-
language: () =>
|
|
680
|
-
options: () =>
|
|
681
|
-
}),
|
|
702
|
+
}, xn = /* @__PURE__ */ l({
|
|
703
|
+
embedder: () => hn,
|
|
704
|
+
language: () => N,
|
|
705
|
+
options: () => bn
|
|
706
|
+
}), Sn = D({
|
|
682
707
|
parser: "jinja-template",
|
|
683
|
-
markup: !0
|
|
684
|
-
|
|
685
|
-
}), mn = "embeddedJinja", hn = [
|
|
708
|
+
markup: !0
|
|
709
|
+
}), Cn = "embeddedJinja", wn = [
|
|
686
710
|
"jinja",
|
|
687
711
|
"jinja2",
|
|
688
712
|
"j2"
|
|
689
|
-
],
|
|
690
|
-
[
|
|
713
|
+
], Tn = C(Cn), En = w(Cn), Dn = {
|
|
714
|
+
[Tn]: {
|
|
691
715
|
category: "Embed",
|
|
692
716
|
type: "string",
|
|
693
717
|
array: !0,
|
|
694
|
-
default: [{ value: [...
|
|
718
|
+
default: [{ value: [...wn] }],
|
|
695
719
|
description: "Block comments that identify embedded Jinja in template literals. Requires the `prettier-plugin-jinja-template` plugin."
|
|
696
720
|
},
|
|
697
|
-
[
|
|
721
|
+
[En]: {
|
|
698
722
|
category: "Embed",
|
|
699
723
|
type: "string",
|
|
700
724
|
array: !0,
|
|
701
|
-
default: [{ value: [...
|
|
725
|
+
default: [{ value: [...wn] }],
|
|
702
726
|
description: "Tags that identify embedded Jinja in template literals. Requires the `prettier-plugin-jinja-template` plugin."
|
|
703
727
|
}
|
|
704
|
-
},
|
|
705
|
-
embedder: () =>
|
|
706
|
-
language: () =>
|
|
707
|
-
options: () =>
|
|
708
|
-
}),
|
|
728
|
+
}, On = /* @__PURE__ */ l({
|
|
729
|
+
embedder: () => Sn,
|
|
730
|
+
language: () => Cn,
|
|
731
|
+
options: () => Dn
|
|
732
|
+
}), kn = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
709
733
|
let o = {
|
|
710
734
|
...r,
|
|
711
735
|
...a
|
|
712
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } =
|
|
713
|
-
return b(
|
|
736
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = An(), { text: u, leadingWhitespaces: d, trailingWhitespaces: f } = y(s, c), p = Ce(n, t);
|
|
737
|
+
return b(x(await e(u, {
|
|
714
738
|
...o,
|
|
715
739
|
parser: o.embeddedJsonParser ?? "json"
|
|
716
740
|
}), l, p), o, i, d, f);
|
|
717
741
|
};
|
|
718
|
-
function
|
|
719
|
-
let e =
|
|
742
|
+
function An() {
|
|
743
|
+
let e = De(), t = De();
|
|
720
744
|
return {
|
|
721
745
|
createPlaceholder: (n) => `'0${e}${n}${t}'`,
|
|
722
746
|
placeholderRegex: RegExp(`["']?0${e}(\\d+)${t}['"]?`, "ig")
|
|
@@ -724,101 +748,101 @@ function xn() {
|
|
|
724
748
|
}
|
|
725
749
|
//#endregion
|
|
726
750
|
//#region src/embedded/json/language.ts
|
|
727
|
-
var
|
|
751
|
+
var P = "embeddedJson", jn = ["json", "jsonl"], Mn = [
|
|
728
752
|
"json",
|
|
729
753
|
"json5",
|
|
730
754
|
"jsonc",
|
|
731
755
|
"json-stringify"
|
|
732
|
-
],
|
|
733
|
-
[
|
|
756
|
+
], Nn = S(P), Pn = C(P), Fn = w(P), In = T(P), Ln = {
|
|
757
|
+
[Nn]: {
|
|
734
758
|
category: "Embed",
|
|
735
759
|
type: "string",
|
|
736
760
|
array: !0,
|
|
737
|
-
default: [{ value: [...
|
|
761
|
+
default: [{ value: [...jn] }],
|
|
738
762
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSON language.",
|
|
739
|
-
deprecated: `Please use \`${
|
|
763
|
+
deprecated: `Please use \`${Pn}\` or \`${Fn}\`.`
|
|
740
764
|
},
|
|
741
|
-
[
|
|
765
|
+
[Pn]: {
|
|
742
766
|
category: "Embed",
|
|
743
767
|
type: "string",
|
|
744
768
|
array: !0,
|
|
745
|
-
default: [{ value: [
|
|
769
|
+
default: [{ value: [E] }],
|
|
746
770
|
description: "Block comments that make their subsequent template literals be identified as embedded JSON language."
|
|
747
771
|
},
|
|
748
|
-
[
|
|
772
|
+
[Fn]: {
|
|
749
773
|
category: "Embed",
|
|
750
774
|
type: "string",
|
|
751
775
|
array: !0,
|
|
752
|
-
default: [{ value: [
|
|
776
|
+
default: [{ value: [E] }],
|
|
753
777
|
description: "Tags that make their subsequent template literals be identified as embedded JSON language."
|
|
754
778
|
},
|
|
755
|
-
[
|
|
779
|
+
[In]: {
|
|
756
780
|
category: "Embed",
|
|
757
781
|
type: "choice",
|
|
758
782
|
default: "json",
|
|
759
783
|
description: "The parser used to parse the embedded JSON language.",
|
|
760
|
-
choices:
|
|
784
|
+
choices: Mn.map((e) => ({
|
|
761
785
|
value: e,
|
|
762
786
|
description: `Use the "${e}" parser.`
|
|
763
787
|
}))
|
|
764
788
|
}
|
|
765
|
-
},
|
|
766
|
-
embedder: () =>
|
|
767
|
-
language: () =>
|
|
768
|
-
options: () =>
|
|
769
|
-
}),
|
|
789
|
+
}, Rn = /* @__PURE__ */ l({
|
|
790
|
+
embedder: () => kn,
|
|
791
|
+
language: () => P,
|
|
792
|
+
options: () => Ln
|
|
793
|
+
}), zn = D({
|
|
770
794
|
parser: "JSONata",
|
|
771
795
|
placeholderPrefix: "$p"
|
|
772
|
-
}),
|
|
773
|
-
[
|
|
796
|
+
}), F = "embeddedJsonata", Bn = ["jsonata"], Vn = S(F), Hn = C(F), Un = w(F), Wn = {
|
|
797
|
+
[Vn]: {
|
|
774
798
|
category: "Embed",
|
|
775
799
|
type: "string",
|
|
776
800
|
array: !0,
|
|
777
|
-
default: [{ value: [...
|
|
801
|
+
default: [{ value: [...Bn] }],
|
|
778
802
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.",
|
|
779
|
-
deprecated: `Please use \`${
|
|
803
|
+
deprecated: `Please use \`${Hn}\` or \`${Un}\`.`
|
|
780
804
|
},
|
|
781
|
-
[
|
|
805
|
+
[Hn]: {
|
|
782
806
|
category: "Embed",
|
|
783
807
|
type: "string",
|
|
784
808
|
array: !0,
|
|
785
|
-
default: [{ value: [
|
|
809
|
+
default: [{ value: [E] }],
|
|
786
810
|
description: "Block comments that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
787
811
|
},
|
|
788
|
-
[
|
|
812
|
+
[Un]: {
|
|
789
813
|
category: "Embed",
|
|
790
814
|
type: "string",
|
|
791
815
|
array: !0,
|
|
792
|
-
default: [{ value: [
|
|
816
|
+
default: [{ value: [E] }],
|
|
793
817
|
description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin."
|
|
794
818
|
}
|
|
795
|
-
},
|
|
796
|
-
embedder: () =>
|
|
797
|
-
language: () =>
|
|
798
|
-
options: () =>
|
|
799
|
-
}),
|
|
819
|
+
}, Gn = /* @__PURE__ */ l({
|
|
820
|
+
embedder: () => zn,
|
|
821
|
+
language: () => F,
|
|
822
|
+
options: () => Wn
|
|
823
|
+
}), Kn = D({
|
|
800
824
|
parser: "jte",
|
|
801
825
|
markup: !0
|
|
802
|
-
}),
|
|
803
|
-
[
|
|
826
|
+
}), qn = "embeddedJte", Jn = ["jte"], Yn = C(qn), Xn = w(qn), Zn = {
|
|
827
|
+
[Yn]: {
|
|
804
828
|
category: "Embed",
|
|
805
829
|
type: "string",
|
|
806
830
|
array: !0,
|
|
807
|
-
default: [{ value: [...
|
|
831
|
+
default: [{ value: [...Jn] }],
|
|
808
832
|
description: "Block comments that identify embedded JTE in template literals. Requires the `prettier-plugin-jte` plugin."
|
|
809
833
|
},
|
|
810
|
-
[
|
|
834
|
+
[Xn]: {
|
|
811
835
|
category: "Embed",
|
|
812
836
|
type: "string",
|
|
813
837
|
array: !0,
|
|
814
|
-
default: [{ value: [...
|
|
838
|
+
default: [{ value: [...Jn] }],
|
|
815
839
|
description: "Tags that identify embedded JTE in template literals. Requires the `prettier-plugin-jte` plugin."
|
|
816
840
|
}
|
|
817
|
-
},
|
|
818
|
-
embedder: () =>
|
|
819
|
-
language: () =>
|
|
820
|
-
options: () =>
|
|
821
|
-
}),
|
|
841
|
+
}, Qn = /* @__PURE__ */ l({
|
|
842
|
+
embedder: () => Kn,
|
|
843
|
+
language: () => qn,
|
|
844
|
+
options: () => Zn
|
|
845
|
+
}), $n = D({ parser: "latex-parser" }), I = "embeddedLatex", er = [
|
|
822
846
|
"latex",
|
|
823
847
|
"tex",
|
|
824
848
|
"aux",
|
|
@@ -827,537 +851,500 @@ var F = "embeddedJson", Sn = ["json", "jsonl"], Cn = [
|
|
|
827
851
|
"bib",
|
|
828
852
|
"toc",
|
|
829
853
|
"sty"
|
|
830
|
-
],
|
|
831
|
-
[
|
|
854
|
+
], tr = S(I), nr = C(I), rr = w(I), ir = {
|
|
855
|
+
[tr]: {
|
|
832
856
|
category: "Embed",
|
|
833
857
|
type: "string",
|
|
834
858
|
array: !0,
|
|
835
|
-
default: [{ value: [...
|
|
859
|
+
default: [{ value: [...er] }],
|
|
836
860
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin.",
|
|
837
|
-
deprecated: `Please use \`${
|
|
861
|
+
deprecated: `Please use \`${nr}\` or \`${rr}\`.`
|
|
838
862
|
},
|
|
839
|
-
[
|
|
863
|
+
[nr]: {
|
|
840
864
|
category: "Embed",
|
|
841
865
|
type: "string",
|
|
842
866
|
array: !0,
|
|
843
|
-
default: [{ value: [
|
|
867
|
+
default: [{ value: [E] }],
|
|
844
868
|
description: "Block comments that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
845
869
|
},
|
|
846
|
-
[
|
|
870
|
+
[rr]: {
|
|
847
871
|
category: "Embed",
|
|
848
872
|
type: "string",
|
|
849
873
|
array: !0,
|
|
850
|
-
default: [{ value: [
|
|
874
|
+
default: [{ value: [E] }],
|
|
851
875
|
description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin."
|
|
852
876
|
}
|
|
853
|
-
},
|
|
854
|
-
embedder: () =>
|
|
855
|
-
language: () =>
|
|
856
|
-
options: () =>
|
|
857
|
-
}),
|
|
877
|
+
}, ar = /* @__PURE__ */ l({
|
|
878
|
+
embedder: () => $n,
|
|
879
|
+
language: () => I,
|
|
880
|
+
options: () => ir
|
|
881
|
+
}), or = D({
|
|
858
882
|
parser: "liquid-html",
|
|
859
883
|
markup: !0
|
|
860
|
-
}),
|
|
861
|
-
[
|
|
884
|
+
}), sr = "embeddedLiquid", cr = ["liquid"], lr = C(sr), ur = w(sr), dr = {
|
|
885
|
+
[lr]: {
|
|
862
886
|
category: "Embed",
|
|
863
887
|
type: "string",
|
|
864
888
|
array: !0,
|
|
865
|
-
default: [{ value: [
|
|
889
|
+
default: [{ value: [...cr] }],
|
|
866
890
|
description: "Block comments that identify embedded Liquid in template literals. Requires the `@shopify/prettier-plugin-liquid` plugin."
|
|
867
891
|
},
|
|
868
|
-
[
|
|
892
|
+
[ur]: {
|
|
869
893
|
category: "Embed",
|
|
870
894
|
type: "string",
|
|
871
895
|
array: !0,
|
|
872
|
-
default: [{ value: [
|
|
896
|
+
default: [{ value: [...cr] }],
|
|
873
897
|
description: "Tags that identify embedded Liquid in template literals. Requires the `@shopify/prettier-plugin-liquid` plugin."
|
|
874
898
|
}
|
|
875
|
-
},
|
|
876
|
-
embedder: () =>
|
|
877
|
-
language: () =>
|
|
878
|
-
options: () =>
|
|
879
|
-
}),
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
...o,
|
|
885
|
-
parser: o.embeddedMarkdownParser ?? "markdown",
|
|
886
|
-
__inJsTemplate: !0
|
|
887
|
-
}), l, p, "hardline");
|
|
888
|
-
if (o.preserveEmbeddedExteriorWhitespaces?.includes(i)) return R([
|
|
889
|
-
"`",
|
|
890
|
-
d,
|
|
891
|
-
o.noEmbeddedMultiLineIndentation?.includes(i) ? sr(R(m)) : ar([R(m)]),
|
|
892
|
-
f,
|
|
893
|
-
"`"
|
|
894
|
-
]);
|
|
895
|
-
let h = d.length ? ir : or, ee = f.length ? ir : or;
|
|
896
|
-
return o.noEmbeddedMultiLineIndentation?.includes(i) ? [
|
|
897
|
-
"`",
|
|
898
|
-
cr,
|
|
899
|
-
sr(m),
|
|
900
|
-
or,
|
|
901
|
-
"`"
|
|
902
|
-
] : R([
|
|
903
|
-
"`",
|
|
904
|
-
ar([h, R(m)]),
|
|
905
|
-
ee,
|
|
906
|
-
"`"
|
|
907
|
-
]);
|
|
908
|
-
}, z = "embeddedMarkdown", ur = ["md", "markdown"], dr = [
|
|
899
|
+
}, fr = /* @__PURE__ */ l({
|
|
900
|
+
embedder: () => or,
|
|
901
|
+
language: () => sr,
|
|
902
|
+
options: () => dr
|
|
903
|
+
}), pr = D({
|
|
904
|
+
parser: "markdown",
|
|
905
|
+
parserOption: "embeddedMarkdownParser",
|
|
906
|
+
parserOptions: { __inJsTemplate: !0 }
|
|
907
|
+
}), L = "embeddedMarkdown", mr = ["md", "markdown"], hr = [
|
|
909
908
|
"markdown",
|
|
910
909
|
"mdx",
|
|
911
910
|
"remark"
|
|
912
|
-
],
|
|
913
|
-
[
|
|
911
|
+
], gr = S(L), _r = C(L), vr = w(L), yr = T(L), br = {
|
|
912
|
+
[gr]: {
|
|
914
913
|
category: "Embed",
|
|
915
914
|
type: "string",
|
|
916
915
|
array: !0,
|
|
917
|
-
default: [{ value: [...
|
|
916
|
+
default: [{ value: [...mr] }],
|
|
918
917
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Markdown language.",
|
|
919
|
-
deprecated: `Please use \`${
|
|
918
|
+
deprecated: `Please use \`${_r}\` or \`${vr}\`.`
|
|
920
919
|
},
|
|
921
|
-
[
|
|
920
|
+
[_r]: {
|
|
922
921
|
category: "Embed",
|
|
923
922
|
type: "string",
|
|
924
923
|
array: !0,
|
|
925
|
-
default: [{ value: [
|
|
924
|
+
default: [{ value: [E] }],
|
|
926
925
|
description: "Block comments that make their subsequent template literals be identified as embedded Markdown language."
|
|
927
926
|
},
|
|
928
|
-
[
|
|
927
|
+
[vr]: {
|
|
929
928
|
category: "Embed",
|
|
930
929
|
type: "string",
|
|
931
930
|
array: !0,
|
|
932
|
-
default: [{ value: [
|
|
931
|
+
default: [{ value: [E] }],
|
|
933
932
|
description: "Tags that make their subsequent template literals be identified as embedded Markdown language."
|
|
934
933
|
},
|
|
935
|
-
[
|
|
934
|
+
[yr]: {
|
|
936
935
|
category: "Embed",
|
|
937
936
|
type: "choice",
|
|
938
937
|
default: "markdown",
|
|
939
938
|
description: "The parser used to parse the embedded Markdown language.",
|
|
940
|
-
choices:
|
|
939
|
+
choices: hr.map((e) => ({
|
|
941
940
|
value: e,
|
|
942
941
|
description: `Use the "${e}" parser.`
|
|
943
942
|
}))
|
|
944
943
|
}
|
|
945
|
-
},
|
|
946
|
-
embedder: () =>
|
|
947
|
-
language: () =>
|
|
948
|
-
options: () =>
|
|
949
|
-
}),
|
|
944
|
+
}, xr = /* @__PURE__ */ l({
|
|
945
|
+
embedder: () => pr,
|
|
946
|
+
language: () => L,
|
|
947
|
+
options: () => br
|
|
948
|
+
}), Sr = D({
|
|
950
949
|
parser: "marko",
|
|
951
950
|
markup: !0
|
|
952
|
-
}),
|
|
953
|
-
[
|
|
951
|
+
}), Cr = "embeddedMarko", wr = ["marko"], Tr = C(Cr), Er = w(Cr), Dr = {
|
|
952
|
+
[Tr]: {
|
|
954
953
|
category: "Embed",
|
|
955
954
|
type: "string",
|
|
956
955
|
array: !0,
|
|
957
|
-
default: [{ value: [...
|
|
956
|
+
default: [{ value: [...wr] }],
|
|
958
957
|
description: "Block comments that identify embedded Marko in template literals. Requires the `prettier-plugin-marko` plugin."
|
|
959
958
|
},
|
|
960
|
-
[
|
|
959
|
+
[Er]: {
|
|
961
960
|
category: "Embed",
|
|
962
961
|
type: "string",
|
|
963
962
|
array: !0,
|
|
964
|
-
default: [{ value: [...
|
|
963
|
+
default: [{ value: [...wr] }],
|
|
965
964
|
description: "Tags that identify embedded Marko in template literals. Requires the `prettier-plugin-marko` plugin."
|
|
966
965
|
}
|
|
967
|
-
},
|
|
968
|
-
embedder: () =>
|
|
969
|
-
language: () =>
|
|
970
|
-
options: () =>
|
|
971
|
-
}),
|
|
966
|
+
}, Or = /* @__PURE__ */ l({
|
|
967
|
+
embedder: () => Sr,
|
|
968
|
+
language: () => Cr,
|
|
969
|
+
options: () => Dr
|
|
970
|
+
}), kr = D({
|
|
972
971
|
parser: "motoko-tt-parse",
|
|
973
|
-
transformDoc:
|
|
972
|
+
transformDoc: Ar
|
|
974
973
|
});
|
|
975
|
-
function
|
|
974
|
+
function Ar(e) {
|
|
976
975
|
if (!Array.isArray(e)) return e;
|
|
977
976
|
let t = e.at(-1);
|
|
978
977
|
return t && !Array.isArray(t) && typeof t == "object" && t.type === "line" && t.hard && t.literal ? e.slice(0, -1) : e;
|
|
979
978
|
}
|
|
980
979
|
//#endregion
|
|
981
980
|
//#region src/embedded/motoko/language.ts
|
|
982
|
-
var
|
|
983
|
-
[
|
|
981
|
+
var jr = "embeddedMotoko", Mr = ["motoko", "mo"], Nr = C(jr), Pr = w(jr), Fr = {
|
|
982
|
+
[Nr]: {
|
|
984
983
|
category: "Embed",
|
|
985
984
|
type: "string",
|
|
986
985
|
array: !0,
|
|
987
|
-
default: [{ value: [...
|
|
986
|
+
default: [{ value: [...Mr] }],
|
|
988
987
|
description: "Block comments that identify embedded Motoko in template literals. Requires the `prettier-plugin-motoko` plugin."
|
|
989
988
|
},
|
|
990
|
-
[
|
|
989
|
+
[Pr]: {
|
|
991
990
|
category: "Embed",
|
|
992
991
|
type: "string",
|
|
993
992
|
array: !0,
|
|
994
|
-
default: [{ value: [...
|
|
993
|
+
default: [{ value: [...Mr] }],
|
|
995
994
|
description: "Tags that identify embedded Motoko in template literals. Requires the `prettier-plugin-motoko` plugin."
|
|
996
995
|
}
|
|
997
|
-
},
|
|
998
|
-
embedder: () =>
|
|
999
|
-
language: () =>
|
|
1000
|
-
options: () =>
|
|
1001
|
-
}),
|
|
996
|
+
}, Ir = /* @__PURE__ */ l({
|
|
997
|
+
embedder: () => kr,
|
|
998
|
+
language: () => jr,
|
|
999
|
+
options: () => Fr
|
|
1000
|
+
}), Lr = D({
|
|
1002
1001
|
parser: "mustache",
|
|
1003
1002
|
markup: !0
|
|
1004
|
-
}),
|
|
1005
|
-
[
|
|
1003
|
+
}), Rr = "embeddedMustache", zr = ["mustache"], Br = C(Rr), Vr = w(Rr), Hr = {
|
|
1004
|
+
[Br]: {
|
|
1006
1005
|
category: "Embed",
|
|
1007
1006
|
type: "string",
|
|
1008
1007
|
array: !0,
|
|
1009
|
-
default: [{ value: [...
|
|
1008
|
+
default: [{ value: [...zr] }],
|
|
1010
1009
|
description: "Block comments that identify embedded Mustache in template literals. Requires the `prettier-plugin-mustache` plugin."
|
|
1011
1010
|
},
|
|
1012
|
-
[
|
|
1011
|
+
[Vr]: {
|
|
1013
1012
|
category: "Embed",
|
|
1014
1013
|
type: "string",
|
|
1015
1014
|
array: !0,
|
|
1016
|
-
default: [{ value: [...
|
|
1015
|
+
default: [{ value: [...zr] }],
|
|
1017
1016
|
description: "Tags that identify embedded Mustache in template literals. Requires the `prettier-plugin-mustache` plugin."
|
|
1018
1017
|
}
|
|
1019
|
-
},
|
|
1020
|
-
embedder: () =>
|
|
1021
|
-
language: () =>
|
|
1022
|
-
options: () =>
|
|
1023
|
-
}),
|
|
1024
|
-
[
|
|
1018
|
+
}, Ur = /* @__PURE__ */ l({
|
|
1019
|
+
embedder: () => Lr,
|
|
1020
|
+
language: () => Rr,
|
|
1021
|
+
options: () => Hr
|
|
1022
|
+
}), Wr = D({ parser: "nginx" }), R = "embeddedNginx", Gr = ["nginx"], Kr = S(R), qr = C(R), Jr = w(R), Yr = {
|
|
1023
|
+
[Kr]: {
|
|
1025
1024
|
category: "Embed",
|
|
1026
1025
|
type: "string",
|
|
1027
1026
|
array: !0,
|
|
1028
|
-
default: [{ value: [...
|
|
1027
|
+
default: [{ value: [...Gr] }],
|
|
1029
1028
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.",
|
|
1030
|
-
deprecated: `Please use \`${
|
|
1029
|
+
deprecated: `Please use \`${qr}\` or \`${Jr}\`.`
|
|
1031
1030
|
},
|
|
1032
|
-
[
|
|
1031
|
+
[qr]: {
|
|
1033
1032
|
category: "Embed",
|
|
1034
1033
|
type: "string",
|
|
1035
1034
|
array: !0,
|
|
1036
|
-
default: [{ value: [
|
|
1035
|
+
default: [{ value: [E] }],
|
|
1037
1036
|
description: "Block comments that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
1038
1037
|
},
|
|
1039
|
-
[
|
|
1038
|
+
[Jr]: {
|
|
1040
1039
|
category: "Embed",
|
|
1041
1040
|
type: "string",
|
|
1042
1041
|
array: !0,
|
|
1043
|
-
default: [{ value: [
|
|
1042
|
+
default: [{ value: [E] }],
|
|
1044
1043
|
description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin."
|
|
1045
1044
|
}
|
|
1046
|
-
},
|
|
1047
|
-
embedder: () =>
|
|
1048
|
-
language: () =>
|
|
1049
|
-
options: () =>
|
|
1050
|
-
}),
|
|
1051
|
-
[
|
|
1045
|
+
}, Xr = /* @__PURE__ */ l({
|
|
1046
|
+
embedder: () => Wr,
|
|
1047
|
+
language: () => R,
|
|
1048
|
+
options: () => Yr
|
|
1049
|
+
}), z = "embeddedNoop", Zr = S(z), Qr = C(z), $r = w(z), ei = {
|
|
1050
|
+
[Zr]: {
|
|
1052
1051
|
category: "Embed",
|
|
1053
1052
|
type: "string",
|
|
1054
1053
|
array: !0,
|
|
1055
1054
|
default: [{ value: [] }],
|
|
1056
1055
|
description: "Tag or comment identifiers that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted.",
|
|
1057
|
-
deprecated: `Please use \`${
|
|
1056
|
+
deprecated: `Please use \`${Qr}\` or \`${$r}\`.`
|
|
1058
1057
|
},
|
|
1059
|
-
[
|
|
1058
|
+
[Qr]: {
|
|
1060
1059
|
category: "Embed",
|
|
1061
1060
|
type: "string",
|
|
1062
1061
|
array: !0,
|
|
1063
|
-
default: [{ value: [
|
|
1062
|
+
default: [{ value: [E] }],
|
|
1064
1063
|
description: "Block comments that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
1065
1064
|
},
|
|
1066
|
-
[
|
|
1065
|
+
[$r]: {
|
|
1067
1066
|
category: "Embed",
|
|
1068
1067
|
type: "string",
|
|
1069
1068
|
array: !0,
|
|
1070
|
-
default: [{ value: [
|
|
1069
|
+
default: [{ value: [E] }],
|
|
1071
1070
|
description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted."
|
|
1072
1071
|
}
|
|
1073
|
-
},
|
|
1074
|
-
language: () =>
|
|
1075
|
-
options: () =>
|
|
1076
|
-
}),
|
|
1072
|
+
}, ti = /* @__PURE__ */ l({
|
|
1073
|
+
language: () => z,
|
|
1074
|
+
options: () => ei
|
|
1075
|
+
}), ni = D({
|
|
1077
1076
|
parser: "nunjucks",
|
|
1078
1077
|
markup: !0
|
|
1079
|
-
}),
|
|
1080
|
-
[
|
|
1078
|
+
}), ri = "embeddedNunjucks", ii = ["nunjucks", "njk"], ai = C(ri), oi = w(ri), si = {
|
|
1079
|
+
[ai]: {
|
|
1081
1080
|
category: "Embed",
|
|
1082
1081
|
type: "string",
|
|
1083
1082
|
array: !0,
|
|
1084
|
-
default: [{ value: [...
|
|
1083
|
+
default: [{ value: [...ii] }],
|
|
1085
1084
|
description: "Block comments that identify embedded Nunjucks in template literals. Requires the `prettier-plugin-nunjucks` plugin."
|
|
1086
1085
|
},
|
|
1087
|
-
[
|
|
1086
|
+
[oi]: {
|
|
1088
1087
|
category: "Embed",
|
|
1089
1088
|
type: "string",
|
|
1090
1089
|
array: !0,
|
|
1091
|
-
default: [{ value: [...
|
|
1090
|
+
default: [{ value: [...ii] }],
|
|
1092
1091
|
description: "Tags that identify embedded Nunjucks in template literals. Requires the `prettier-plugin-nunjucks` plugin."
|
|
1093
1092
|
}
|
|
1094
|
-
},
|
|
1095
|
-
embedder: () =>
|
|
1096
|
-
language: () =>
|
|
1097
|
-
options: () =>
|
|
1098
|
-
}),
|
|
1093
|
+
}, ci = /* @__PURE__ */ l({
|
|
1094
|
+
embedder: () => ni,
|
|
1095
|
+
language: () => ri,
|
|
1096
|
+
options: () => si
|
|
1097
|
+
}), li = D({ parser: "pegjs-parser" }), B = "embeddedPegjs", ui = [
|
|
1099
1098
|
"pegjs",
|
|
1100
1099
|
"peggy",
|
|
1101
1100
|
"peg"
|
|
1102
|
-
],
|
|
1103
|
-
[
|
|
1101
|
+
], di = S(B), fi = C(B), pi = w(B), mi = {
|
|
1102
|
+
[di]: {
|
|
1104
1103
|
category: "Embed",
|
|
1105
1104
|
type: "string",
|
|
1106
1105
|
array: !0,
|
|
1107
|
-
default: [{ value: [...
|
|
1106
|
+
default: [{ value: [...ui] }],
|
|
1108
1107
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin.",
|
|
1109
|
-
deprecated: `Please use \`${
|
|
1108
|
+
deprecated: `Please use \`${fi}\` or \`${pi}\`.`
|
|
1110
1109
|
},
|
|
1111
|
-
[
|
|
1110
|
+
[fi]: {
|
|
1112
1111
|
category: "Embed",
|
|
1113
1112
|
type: "string",
|
|
1114
1113
|
array: !0,
|
|
1115
|
-
default: [{ value: [
|
|
1114
|
+
default: [{ value: [E] }],
|
|
1116
1115
|
description: "Block comments that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
1117
1116
|
},
|
|
1118
|
-
[
|
|
1117
|
+
[pi]: {
|
|
1119
1118
|
category: "Embed",
|
|
1120
1119
|
type: "string",
|
|
1121
1120
|
array: !0,
|
|
1122
|
-
default: [{ value: [
|
|
1121
|
+
default: [{ value: [E] }],
|
|
1123
1122
|
description: "Tags that make their subsequent template literals be identified as embedded Pegjs language. This option requires the `prettier-plugin-pegjs` plugin."
|
|
1124
1123
|
}
|
|
1125
|
-
},
|
|
1126
|
-
embedder: () =>
|
|
1127
|
-
language: () =>
|
|
1128
|
-
options: () =>
|
|
1129
|
-
}),
|
|
1124
|
+
}, hi = /* @__PURE__ */ l({
|
|
1125
|
+
embedder: () => li,
|
|
1126
|
+
language: () => B,
|
|
1127
|
+
options: () => mi
|
|
1128
|
+
}), gi = D({
|
|
1130
1129
|
parser: "php",
|
|
1131
1130
|
placeholderPrefix: "$p"
|
|
1132
|
-
}),
|
|
1133
|
-
[
|
|
1131
|
+
}), V = "embeddedPhp", _i = ["php", "php5"], vi = S(V), yi = C(V), bi = w(V), xi = {
|
|
1132
|
+
[vi]: {
|
|
1134
1133
|
category: "Embed",
|
|
1135
1134
|
type: "string",
|
|
1136
1135
|
array: !0,
|
|
1137
|
-
default: [{ value: [...
|
|
1136
|
+
default: [{ value: [..._i] }],
|
|
1138
1137
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.",
|
|
1139
|
-
deprecated: `Please use \`${
|
|
1138
|
+
deprecated: `Please use \`${yi}\` or \`${bi}\`.`
|
|
1140
1139
|
},
|
|
1141
|
-
[
|
|
1140
|
+
[yi]: {
|
|
1142
1141
|
category: "Embed",
|
|
1143
1142
|
type: "string",
|
|
1144
1143
|
array: !0,
|
|
1145
|
-
default: [{ value: [
|
|
1144
|
+
default: [{ value: [E] }],
|
|
1146
1145
|
description: "Block comments that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
1147
1146
|
},
|
|
1148
|
-
[
|
|
1147
|
+
[bi]: {
|
|
1149
1148
|
category: "Embed",
|
|
1150
1149
|
type: "string",
|
|
1151
1150
|
array: !0,
|
|
1152
|
-
default: [{ value: [
|
|
1151
|
+
default: [{ value: [E] }],
|
|
1153
1152
|
description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin."
|
|
1154
1153
|
}
|
|
1155
|
-
},
|
|
1156
|
-
embedder: () =>
|
|
1157
|
-
language: () =>
|
|
1158
|
-
options: () =>
|
|
1159
|
-
}),
|
|
1160
|
-
|
|
1161
|
-
newlineHandling: "hardline"
|
|
1162
|
-
}), bi = "embeddedPowerShell", xi = ["powershell", "ps1"], Si = T(bi), Ci = E(bi), wi = {
|
|
1163
|
-
[Si]: {
|
|
1154
|
+
}, Si = /* @__PURE__ */ l({
|
|
1155
|
+
embedder: () => gi,
|
|
1156
|
+
language: () => V,
|
|
1157
|
+
options: () => xi
|
|
1158
|
+
}), Ci = D({ parser: "powershell" }), wi = "embeddedPowerShell", Ti = ["powershell", "ps1"], Ei = C(wi), Di = w(wi), Oi = {
|
|
1159
|
+
[Ei]: {
|
|
1164
1160
|
category: "Embed",
|
|
1165
1161
|
type: "string",
|
|
1166
1162
|
array: !0,
|
|
1167
|
-
default: [{ value: [...
|
|
1163
|
+
default: [{ value: [...Ti] }],
|
|
1168
1164
|
description: "Block comments that identify embedded PowerShell in template literals. Requires the `prettier-plugin-powershell` plugin."
|
|
1169
1165
|
},
|
|
1170
|
-
[
|
|
1166
|
+
[Di]: {
|
|
1171
1167
|
category: "Embed",
|
|
1172
1168
|
type: "string",
|
|
1173
1169
|
array: !0,
|
|
1174
|
-
default: [{ value: [...
|
|
1170
|
+
default: [{ value: [...Ti] }],
|
|
1175
1171
|
description: "Tags that identify embedded PowerShell in template literals. Requires the `prettier-plugin-powershell` plugin."
|
|
1176
1172
|
}
|
|
1177
|
-
},
|
|
1178
|
-
embedder: () =>
|
|
1179
|
-
language: () =>
|
|
1180
|
-
options: () =>
|
|
1181
|
-
}),
|
|
1182
|
-
|
|
1183
|
-
newlineHandling: "hardline"
|
|
1184
|
-
}), W = "embeddedPrisma", Di = ["prisma"], Oi = w(W), ki = T(W), Ai = E(W), ji = {
|
|
1185
|
-
[Oi]: {
|
|
1173
|
+
}, ki = /* @__PURE__ */ l({
|
|
1174
|
+
embedder: () => Ci,
|
|
1175
|
+
language: () => wi,
|
|
1176
|
+
options: () => Oi
|
|
1177
|
+
}), Ai = D({ parser: "prisma-parse" }), H = "embeddedPrisma", ji = ["prisma"], Mi = S(H), Ni = C(H), Pi = w(H), Fi = {
|
|
1178
|
+
[Mi]: {
|
|
1186
1179
|
category: "Embed",
|
|
1187
1180
|
type: "string",
|
|
1188
1181
|
array: !0,
|
|
1189
|
-
default: [{ value: [...
|
|
1182
|
+
default: [{ value: [...ji] }],
|
|
1190
1183
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin.",
|
|
1191
|
-
deprecated: `Please use \`${
|
|
1184
|
+
deprecated: `Please use \`${Ni}\` or \`${Pi}\`.`
|
|
1192
1185
|
},
|
|
1193
|
-
[
|
|
1186
|
+
[Ni]: {
|
|
1194
1187
|
category: "Embed",
|
|
1195
1188
|
type: "string",
|
|
1196
1189
|
array: !0,
|
|
1197
|
-
default: [{ value: [
|
|
1190
|
+
default: [{ value: [E] }],
|
|
1198
1191
|
description: "Block comments that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
1199
1192
|
},
|
|
1200
|
-
[
|
|
1193
|
+
[Pi]: {
|
|
1201
1194
|
category: "Embed",
|
|
1202
1195
|
type: "string",
|
|
1203
1196
|
array: !0,
|
|
1204
|
-
default: [{ value: [
|
|
1197
|
+
default: [{ value: [E] }],
|
|
1205
1198
|
description: "Tags that make their subsequent template literals be identified as embedded Prisma language. This option requires the `prettier-plugin-prisma` plugin."
|
|
1206
1199
|
}
|
|
1207
|
-
},
|
|
1208
|
-
embedder: () =>
|
|
1209
|
-
language: () =>
|
|
1210
|
-
options: () =>
|
|
1211
|
-
}),
|
|
1212
|
-
[
|
|
1200
|
+
}, Ii = /* @__PURE__ */ l({
|
|
1201
|
+
embedder: () => Ai,
|
|
1202
|
+
language: () => H,
|
|
1203
|
+
options: () => Fi
|
|
1204
|
+
}), Li = D({ parser: "dot-properties" }), U = "embeddedProperties", Ri = ["properties"], zi = S(U), Bi = C(U), Vi = w(U), Hi = {
|
|
1205
|
+
[zi]: {
|
|
1213
1206
|
category: "Embed",
|
|
1214
1207
|
type: "string",
|
|
1215
1208
|
array: !0,
|
|
1216
|
-
default: [{ value: [...
|
|
1209
|
+
default: [{ value: [...Ri] }],
|
|
1217
1210
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin.",
|
|
1218
|
-
deprecated: `Please use \`${
|
|
1211
|
+
deprecated: `Please use \`${Bi}\` or \`${Vi}\`.`
|
|
1219
1212
|
},
|
|
1220
|
-
[
|
|
1213
|
+
[Bi]: {
|
|
1221
1214
|
category: "Embed",
|
|
1222
1215
|
type: "string",
|
|
1223
1216
|
array: !0,
|
|
1224
|
-
default: [{ value: [
|
|
1217
|
+
default: [{ value: [E] }],
|
|
1225
1218
|
description: "Block comments that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
1226
1219
|
},
|
|
1227
|
-
[
|
|
1220
|
+
[Vi]: {
|
|
1228
1221
|
category: "Embed",
|
|
1229
1222
|
type: "string",
|
|
1230
1223
|
array: !0,
|
|
1231
|
-
default: [{ value: [
|
|
1224
|
+
default: [{ value: [E] }],
|
|
1232
1225
|
description: "Tags that make their subsequent template literals be identified as embedded Properties language. This option requires the `prettier-plugin-properties` plugin."
|
|
1233
1226
|
}
|
|
1234
|
-
},
|
|
1235
|
-
embedder: () =>
|
|
1236
|
-
language: () =>
|
|
1237
|
-
options: () =>
|
|
1238
|
-
}),
|
|
1239
|
-
|
|
1240
|
-
newlineHandling: "hardline"
|
|
1241
|
-
}), Vi = "embeddedPug", Hi = ["pug", "jade"], Ui = w(Vi), Wi = T(Vi), Gi = E(Vi), Ki = {
|
|
1242
|
-
[Ui]: {
|
|
1227
|
+
}, Ui = /* @__PURE__ */ l({
|
|
1228
|
+
embedder: () => Li,
|
|
1229
|
+
language: () => U,
|
|
1230
|
+
options: () => Hi
|
|
1231
|
+
}), Wi = D({ parser: "pug" }), W = "embeddedPug", Gi = ["pug", "jade"], Ki = S(W), qi = C(W), Ji = w(W), Yi = {
|
|
1232
|
+
[Ki]: {
|
|
1243
1233
|
category: "Embed",
|
|
1244
1234
|
type: "string",
|
|
1245
1235
|
array: !0,
|
|
1246
|
-
default: [{ value: [...
|
|
1236
|
+
default: [{ value: [...Gi] }],
|
|
1247
1237
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin.",
|
|
1248
|
-
deprecated: `Please use \`${
|
|
1238
|
+
deprecated: `Please use \`${qi}\` or \`${Ji}\`.`
|
|
1249
1239
|
},
|
|
1250
|
-
[
|
|
1240
|
+
[qi]: {
|
|
1251
1241
|
category: "Embed",
|
|
1252
1242
|
type: "string",
|
|
1253
1243
|
array: !0,
|
|
1254
|
-
default: [{ value: [
|
|
1244
|
+
default: [{ value: [E] }],
|
|
1255
1245
|
description: "Block comments that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1256
1246
|
},
|
|
1257
|
-
[
|
|
1247
|
+
[Ji]: {
|
|
1258
1248
|
category: "Embed",
|
|
1259
1249
|
type: "string",
|
|
1260
1250
|
array: !0,
|
|
1261
|
-
default: [{ value: [
|
|
1251
|
+
default: [{ value: [E] }],
|
|
1262
1252
|
description: "Tags that make their subsequent template literals be identified as embedded Pug language. This option requires the `@prettier/plugin-pug` plugin."
|
|
1263
1253
|
}
|
|
1264
|
-
},
|
|
1265
|
-
embedder: () =>
|
|
1266
|
-
language: () =>
|
|
1267
|
-
options: () =>
|
|
1268
|
-
}),
|
|
1254
|
+
}, Xi = /* @__PURE__ */ l({
|
|
1255
|
+
embedder: () => Wi,
|
|
1256
|
+
language: () => W,
|
|
1257
|
+
options: () => Yi
|
|
1258
|
+
}), Zi = D({
|
|
1269
1259
|
parser: "ruby",
|
|
1270
1260
|
parserOption: "embeddedRubyParser"
|
|
1271
|
-
}),
|
|
1261
|
+
}), G = "embeddedRuby", Qi = ["ruby"], $i = [
|
|
1272
1262
|
"ruby",
|
|
1273
1263
|
"rbs",
|
|
1274
1264
|
"haml"
|
|
1275
|
-
],
|
|
1276
|
-
[
|
|
1265
|
+
], ea = S(G), ta = C(G), na = w(G), ra = T(G), ia = {
|
|
1266
|
+
[ea]: {
|
|
1277
1267
|
category: "Embed",
|
|
1278
1268
|
type: "string",
|
|
1279
1269
|
array: !0,
|
|
1280
|
-
default: [{ value: [...
|
|
1270
|
+
default: [{ value: [...Qi] }],
|
|
1281
1271
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1282
|
-
deprecated: `Please use \`${
|
|
1272
|
+
deprecated: `Please use \`${ta}\` or \`${na}\`.`
|
|
1283
1273
|
},
|
|
1284
|
-
[
|
|
1274
|
+
[ta]: {
|
|
1285
1275
|
category: "Embed",
|
|
1286
1276
|
type: "string",
|
|
1287
1277
|
array: !0,
|
|
1288
|
-
default: [{ value: [
|
|
1278
|
+
default: [{ value: [E] }],
|
|
1289
1279
|
description: "Block comments that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1290
1280
|
},
|
|
1291
|
-
[
|
|
1281
|
+
[na]: {
|
|
1292
1282
|
category: "Embed",
|
|
1293
1283
|
type: "string",
|
|
1294
1284
|
array: !0,
|
|
1295
|
-
default: [{ value: [
|
|
1285
|
+
default: [{ value: [E] }],
|
|
1296
1286
|
description: "Tags that make their subsequent template literals be identified as embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin."
|
|
1297
1287
|
},
|
|
1298
|
-
[
|
|
1288
|
+
[ra]: {
|
|
1299
1289
|
category: "Embed",
|
|
1300
1290
|
type: "choice",
|
|
1301
1291
|
default: "ruby",
|
|
1302
1292
|
description: "The parser used to parse the embedded Ruby language. This option requires the `@prettier/plugin-ruby` plugin.",
|
|
1303
|
-
choices:
|
|
1293
|
+
choices: $i.map((e) => ({
|
|
1304
1294
|
value: e,
|
|
1305
1295
|
description: `Use the "${e}" parser.`
|
|
1306
1296
|
}))
|
|
1307
1297
|
}
|
|
1308
|
-
},
|
|
1309
|
-
embedder: () =>
|
|
1310
|
-
language: () =>
|
|
1311
|
-
options: () =>
|
|
1312
|
-
}),
|
|
1313
|
-
|
|
1314
|
-
newlineHandling: "hardline"
|
|
1315
|
-
}), ia = "embeddedSh", aa = ["sh"], oa = w(ia), sa = T(ia), ca = E(ia), la = {
|
|
1316
|
-
[oa]: {
|
|
1298
|
+
}, aa = /* @__PURE__ */ l({
|
|
1299
|
+
embedder: () => Zi,
|
|
1300
|
+
language: () => G,
|
|
1301
|
+
options: () => ia
|
|
1302
|
+
}), oa = D({ parser: "sh" }), sa = "embeddedSh", ca = ["sh"], la = S(sa), ua = C(sa), da = w(sa), fa = {
|
|
1303
|
+
[la]: {
|
|
1317
1304
|
category: "Embed",
|
|
1318
1305
|
type: "string",
|
|
1319
1306
|
array: !0,
|
|
1320
|
-
default: [{ value: [...
|
|
1307
|
+
default: [{ value: [...ca] }],
|
|
1321
1308
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin.",
|
|
1322
|
-
deprecated: `Please use \`${
|
|
1309
|
+
deprecated: `Please use \`${ua}\` or \`${da}\`.`
|
|
1323
1310
|
},
|
|
1324
|
-
[
|
|
1311
|
+
[ua]: {
|
|
1325
1312
|
category: "Embed",
|
|
1326
1313
|
type: "string",
|
|
1327
1314
|
array: !0,
|
|
1328
|
-
default: [{ value: [
|
|
1315
|
+
default: [{ value: [E] }],
|
|
1329
1316
|
description: "Block comments that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1330
1317
|
},
|
|
1331
|
-
[
|
|
1318
|
+
[da]: {
|
|
1332
1319
|
category: "Embed",
|
|
1333
1320
|
type: "string",
|
|
1334
1321
|
array: !0,
|
|
1335
|
-
default: [{ value: [
|
|
1322
|
+
default: [{ value: [E] }],
|
|
1336
1323
|
description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin."
|
|
1337
1324
|
}
|
|
1338
|
-
},
|
|
1339
|
-
embedder: () =>
|
|
1340
|
-
language: () =>
|
|
1341
|
-
options: () =>
|
|
1342
|
-
}),
|
|
1325
|
+
}, pa = /* @__PURE__ */ l({
|
|
1326
|
+
embedder: () => oa,
|
|
1327
|
+
language: () => sa,
|
|
1328
|
+
options: () => fa
|
|
1329
|
+
}), K = "embeddedSolidity", ma = D({
|
|
1343
1330
|
parser: "slang",
|
|
1344
|
-
parserOption: `${
|
|
1345
|
-
}),
|
|
1346
|
-
[
|
|
1331
|
+
parserOption: `${K}Parser`
|
|
1332
|
+
}), ha = ["solidity", "sol"], ga = C(K), _a = w(K), va = `${K}Parser`, ya = {
|
|
1333
|
+
[ga]: {
|
|
1347
1334
|
category: "Embed",
|
|
1348
1335
|
type: "string",
|
|
1349
1336
|
array: !0,
|
|
1350
|
-
default: [{ value: [...
|
|
1337
|
+
default: [{ value: [...ha] }],
|
|
1351
1338
|
description: "Block comments that identify embedded Solidity in template literals. Requires the `prettier-plugin-solidity` plugin."
|
|
1352
1339
|
},
|
|
1353
|
-
[
|
|
1340
|
+
[_a]: {
|
|
1354
1341
|
category: "Embed",
|
|
1355
1342
|
type: "string",
|
|
1356
1343
|
array: !0,
|
|
1357
|
-
default: [{ value: [...
|
|
1344
|
+
default: [{ value: [...ha] }],
|
|
1358
1345
|
description: "Tags that identify embedded Solidity in template literals. Requires the `prettier-plugin-solidity` plugin."
|
|
1359
1346
|
},
|
|
1360
|
-
[
|
|
1347
|
+
[va]: {
|
|
1361
1348
|
category: "Embed",
|
|
1362
1349
|
type: "choice",
|
|
1363
1350
|
default: "slang",
|
|
@@ -1377,221 +1364,222 @@ var Dr = "embeddedMotoko", Or = ["motoko", "mo"], kr = T(Dr), Ar = E(Dr), jr = {
|
|
|
1377
1364
|
}
|
|
1378
1365
|
]
|
|
1379
1366
|
}
|
|
1380
|
-
},
|
|
1381
|
-
embedder: () =>
|
|
1382
|
-
language: () =>
|
|
1383
|
-
options: () =>
|
|
1384
|
-
}),
|
|
1367
|
+
}, ba = /* @__PURE__ */ l({
|
|
1368
|
+
embedder: () => ma,
|
|
1369
|
+
language: () => K,
|
|
1370
|
+
options: () => ya
|
|
1371
|
+
}), xa = /\n[\t ]*$/, Sa = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1385
1372
|
let o = {
|
|
1386
1373
|
...r,
|
|
1387
1374
|
...a
|
|
1388
|
-
}, s = o.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: c } = n, { createPlaceholder: l, placeholderRegex: u } =
|
|
1389
|
-
if (s === "prettier-plugin-sql-cst") h =
|
|
1375
|
+
}, s = o.embeddedSqlPlugin ?? "prettier-plugin-sql", { node: c } = n, { createPlaceholder: l, placeholderRegex: u } = Oe(), { text: d, leadingWhitespaces: f, trailingWhitespaces: p } = y(c, l), m = Ce(n, t, o, !1), h;
|
|
1376
|
+
if (s === "prettier-plugin-sql-cst") h = x(await e(d, {
|
|
1390
1377
|
...o,
|
|
1391
1378
|
parser: o.embeddedSqlParser ?? "sqlite"
|
|
1392
1379
|
}), u, m);
|
|
1393
1380
|
else {
|
|
1394
|
-
let t =
|
|
1395
|
-
|
|
1381
|
+
let t = /* @__PURE__ */ new Set();
|
|
1382
|
+
for (let e = 0; e < c.expressions.length; e++) xa.test(c.quasis[e].value.raw) && t.add(e);
|
|
1383
|
+
h = x(await e(d, {
|
|
1396
1384
|
...o,
|
|
1397
1385
|
parser: "sql"
|
|
1398
|
-
}), u, m,
|
|
1386
|
+
}), u, m, {
|
|
1387
|
+
lineBreakBeforeExpressions: t,
|
|
1388
|
+
interpolationTabWidth: o.tabWidth ?? 2
|
|
1389
|
+
});
|
|
1399
1390
|
}
|
|
1400
1391
|
return b(h, o, i, f, p);
|
|
1401
|
-
},
|
|
1392
|
+
}, q = "embeddedSql", Ca = ["sql"], wa = ["prettier-plugin-sql", "prettier-plugin-sql-cst"], Ta = [
|
|
1402
1393
|
"sqlite",
|
|
1403
1394
|
"bigquery",
|
|
1404
1395
|
"mysql",
|
|
1405
1396
|
"mariadb",
|
|
1406
1397
|
"postgresql"
|
|
1407
|
-
],
|
|
1408
|
-
[
|
|
1398
|
+
], Ea = S(q), Da = C(q), Oa = w(q), ka = Ae(q), Aa = T(q), ja = {
|
|
1399
|
+
[Ea]: {
|
|
1409
1400
|
category: "Embed",
|
|
1410
1401
|
type: "string",
|
|
1411
1402
|
array: !0,
|
|
1412
|
-
default: [{ value: [...
|
|
1403
|
+
default: [{ value: [...Ca] }],
|
|
1413
1404
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1414
|
-
deprecated: `Please use \`${
|
|
1405
|
+
deprecated: `Please use \`${Da}\` or \`${Oa}\`.`
|
|
1415
1406
|
},
|
|
1416
|
-
[
|
|
1407
|
+
[Da]: {
|
|
1417
1408
|
category: "Embed",
|
|
1418
1409
|
type: "string",
|
|
1419
1410
|
array: !0,
|
|
1420
|
-
default: [{ value: [
|
|
1411
|
+
default: [{ value: [E] }],
|
|
1421
1412
|
description: "Block comments that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1422
1413
|
},
|
|
1423
|
-
[
|
|
1414
|
+
[Oa]: {
|
|
1424
1415
|
category: "Embed",
|
|
1425
1416
|
type: "string",
|
|
1426
1417
|
array: !0,
|
|
1427
|
-
default: [{ value: [
|
|
1418
|
+
default: [{ value: [E] }],
|
|
1428
1419
|
description: "Tags that make their subsequent template literals be identified as embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin."
|
|
1429
1420
|
},
|
|
1430
|
-
[
|
|
1421
|
+
[ka]: {
|
|
1431
1422
|
category: "Embed",
|
|
1432
1423
|
type: "choice",
|
|
1433
1424
|
default: "prettier-plugin-sql",
|
|
1434
1425
|
description: "The plugin used to format the embedded SQL language. This option requires the `prettier-plugin-sql` plugin or the `prettier-plugin-sql-cst` plugin.",
|
|
1435
|
-
choices:
|
|
1426
|
+
choices: wa.map((e) => ({
|
|
1436
1427
|
value: e,
|
|
1437
1428
|
description: `Use the "${e}" plugin.`
|
|
1438
1429
|
}))
|
|
1439
1430
|
},
|
|
1440
|
-
[
|
|
1431
|
+
[Aa]: {
|
|
1441
1432
|
category: "Embed",
|
|
1442
1433
|
type: "choice",
|
|
1443
1434
|
default: "sqlite",
|
|
1444
1435
|
description: "Specify the embedded SQL language parser. This option is only needed with the `prettier-plugin-sql-cst` plugin.",
|
|
1445
|
-
choices:
|
|
1436
|
+
choices: Ta.map((e) => ({
|
|
1446
1437
|
value: e,
|
|
1447
1438
|
description: `Use the "${e}" parser.`
|
|
1448
1439
|
}))
|
|
1449
1440
|
}
|
|
1450
|
-
},
|
|
1451
|
-
embedder: () =>
|
|
1452
|
-
language: () =>
|
|
1453
|
-
options: () =>
|
|
1454
|
-
}),
|
|
1441
|
+
}, Ma = /* @__PURE__ */ l({
|
|
1442
|
+
embedder: () => Sa,
|
|
1443
|
+
language: () => q,
|
|
1444
|
+
options: () => ja
|
|
1445
|
+
}), Na = D({
|
|
1455
1446
|
parser: "svelte",
|
|
1456
1447
|
markup: !0
|
|
1457
|
-
}),
|
|
1458
|
-
[
|
|
1448
|
+
}), Pa = "embeddedSvelte", Fa = ["svelte"], Ia = C(Pa), La = w(Pa), Ra = {
|
|
1449
|
+
[Ia]: {
|
|
1459
1450
|
category: "Embed",
|
|
1460
1451
|
type: "string",
|
|
1461
1452
|
array: !0,
|
|
1462
|
-
default: [{ value: [...
|
|
1453
|
+
default: [{ value: [...Fa] }],
|
|
1463
1454
|
description: "Block comments that identify embedded Svelte in template literals. Requires the `prettier-plugin-svelte` plugin."
|
|
1464
1455
|
},
|
|
1465
|
-
[
|
|
1456
|
+
[La]: {
|
|
1466
1457
|
category: "Embed",
|
|
1467
1458
|
type: "string",
|
|
1468
1459
|
array: !0,
|
|
1469
|
-
default: [{ value: [...
|
|
1460
|
+
default: [{ value: [...Fa] }],
|
|
1470
1461
|
description: "Tags that identify embedded Svelte in template literals. Requires the `prettier-plugin-svelte` plugin."
|
|
1471
1462
|
}
|
|
1472
|
-
},
|
|
1473
|
-
embedder: () =>
|
|
1474
|
-
language: () =>
|
|
1475
|
-
options: () =>
|
|
1476
|
-
}),
|
|
1477
|
-
|
|
1478
|
-
newlineHandling: "hardline"
|
|
1479
|
-
}), La = "embeddedToml", Ra = ["toml"], za = w(La), Ba = T(La), Va = E(La), Ha = {
|
|
1480
|
-
[za]: {
|
|
1463
|
+
}, za = /* @__PURE__ */ l({
|
|
1464
|
+
embedder: () => Na,
|
|
1465
|
+
language: () => Pa,
|
|
1466
|
+
options: () => Ra
|
|
1467
|
+
}), Ba = D({ parser: "toml" }), Va = "embeddedToml", Ha = ["toml"], Ua = S(Va), Wa = C(Va), Ga = w(Va), Ka = {
|
|
1468
|
+
[Ua]: {
|
|
1481
1469
|
category: "Embed",
|
|
1482
1470
|
type: "string",
|
|
1483
1471
|
array: !0,
|
|
1484
|
-
default: [{ value: [...
|
|
1472
|
+
default: [{ value: [...Ha] }],
|
|
1485
1473
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin.",
|
|
1486
|
-
deprecated: `Please use \`${
|
|
1474
|
+
deprecated: `Please use \`${Wa}\` or \`${Ga}\`.`
|
|
1487
1475
|
},
|
|
1488
|
-
[
|
|
1476
|
+
[Wa]: {
|
|
1489
1477
|
category: "Embed",
|
|
1490
1478
|
type: "string",
|
|
1491
1479
|
array: !0,
|
|
1492
|
-
default: [{ value: [
|
|
1480
|
+
default: [{ value: [E] }],
|
|
1493
1481
|
description: "Block comments that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1494
1482
|
},
|
|
1495
|
-
[
|
|
1483
|
+
[Ga]: {
|
|
1496
1484
|
category: "Embed",
|
|
1497
1485
|
type: "string",
|
|
1498
1486
|
array: !0,
|
|
1499
|
-
default: [{ value: [
|
|
1487
|
+
default: [{ value: [E] }],
|
|
1500
1488
|
description: "Tags that make their subsequent template literals be identified as embedded TOML language. This option requires the `prettier-plugin-toml` plugin."
|
|
1501
1489
|
}
|
|
1502
|
-
},
|
|
1503
|
-
embedder: () =>
|
|
1504
|
-
language: () =>
|
|
1505
|
-
options: () =>
|
|
1506
|
-
}),
|
|
1490
|
+
}, qa = /* @__PURE__ */ l({
|
|
1491
|
+
embedder: () => Ba,
|
|
1492
|
+
language: () => Va,
|
|
1493
|
+
options: () => Ka
|
|
1494
|
+
}), Ja = D({
|
|
1507
1495
|
parser: "typescript",
|
|
1508
1496
|
parserOption: "embeddedTsParser",
|
|
1509
1497
|
parserOptions: { filepath: void 0 }
|
|
1510
|
-
}),
|
|
1498
|
+
}), J = "embeddedTs", Ya = [
|
|
1511
1499
|
"ts",
|
|
1512
1500
|
"tsx",
|
|
1513
1501
|
"cts",
|
|
1514
1502
|
"mts",
|
|
1515
1503
|
"typescript"
|
|
1516
|
-
],
|
|
1517
|
-
[
|
|
1504
|
+
], Xa = ["typescript", "babel-ts"], Za = S(J), Qa = C(J), $a = w(J), eo = T(J), to = {
|
|
1505
|
+
[Za]: {
|
|
1518
1506
|
category: "Embed",
|
|
1519
1507
|
type: "string",
|
|
1520
1508
|
array: !0,
|
|
1521
|
-
default: [{ value: [...
|
|
1509
|
+
default: [{ value: [...Ya] }],
|
|
1522
1510
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded TypeScript language.",
|
|
1523
|
-
deprecated: `Please use \`${
|
|
1511
|
+
deprecated: `Please use \`${Qa}\` or \`${$a}\`.`
|
|
1524
1512
|
},
|
|
1525
|
-
[
|
|
1513
|
+
[Qa]: {
|
|
1526
1514
|
category: "Embed",
|
|
1527
1515
|
type: "string",
|
|
1528
1516
|
array: !0,
|
|
1529
|
-
default: [{ value: [
|
|
1517
|
+
default: [{ value: [E] }],
|
|
1530
1518
|
description: "Block comments that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1531
1519
|
},
|
|
1532
|
-
[
|
|
1520
|
+
[$a]: {
|
|
1533
1521
|
category: "Embed",
|
|
1534
1522
|
type: "string",
|
|
1535
1523
|
array: !0,
|
|
1536
|
-
default: [{ value: [
|
|
1524
|
+
default: [{ value: [E] }],
|
|
1537
1525
|
description: "Tags that make their subsequent template literals be identified as embedded TypeScript language."
|
|
1538
1526
|
},
|
|
1539
|
-
[
|
|
1527
|
+
[eo]: {
|
|
1540
1528
|
category: "Embed",
|
|
1541
1529
|
type: "choice",
|
|
1542
1530
|
default: "typescript",
|
|
1543
1531
|
description: "The parser used to parse the embedded TypeScript language.",
|
|
1544
|
-
choices:
|
|
1532
|
+
choices: Xa.map((e) => ({
|
|
1545
1533
|
value: e,
|
|
1546
1534
|
description: `Use the "${e}" parser.`
|
|
1547
1535
|
}))
|
|
1548
1536
|
}
|
|
1549
|
-
},
|
|
1550
|
-
embedder: () =>
|
|
1551
|
-
language: () =>
|
|
1552
|
-
options: () =>
|
|
1553
|
-
}),
|
|
1537
|
+
}, no = /* @__PURE__ */ l({
|
|
1538
|
+
embedder: () => Ja,
|
|
1539
|
+
language: () => J,
|
|
1540
|
+
options: () => to
|
|
1541
|
+
}), Y = "embeddedXml", { softline: ro } = e, io = async (e, t, n, r, { commentOrTag: i, embeddedOverrideOptions: a }) => {
|
|
1554
1542
|
let o = {
|
|
1555
1543
|
...r,
|
|
1556
1544
|
...a
|
|
1557
|
-
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } =
|
|
1545
|
+
}, { node: s } = n, { createPlaceholder: c, placeholderRegex: l } = Oe(), { text: u, leadingWhitespaces: d, trailingWhitespaces: f } = y(s, c), p = Ce(n, t), m = [], h = 0;
|
|
1558
1546
|
for (; h !== void 0;) {
|
|
1559
1547
|
let t = u.slice(h);
|
|
1560
1548
|
if (t.length === 0) break;
|
|
1561
|
-
h > 0 && o.xmlWhitespaceSensitivity !== "strict" && m.push(
|
|
1549
|
+
h > 0 && o.xmlWhitespaceSensitivity !== "strict" && m.push(ro), o.__embeddedXmlFragmentRecoverIndex?.splice(0, o.__embeddedXmlFragmentRecoverIndex.length);
|
|
1562
1550
|
let n = await e(t, {
|
|
1563
1551
|
...o,
|
|
1564
|
-
parser:
|
|
1552
|
+
parser: Y
|
|
1565
1553
|
}), [r, i] = o.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1566
1554
|
r === void 0 ? h = void 0 : i === void 0 ? h += r : (n = t.slice(r, i + 1), h += i + 1), m.push(n);
|
|
1567
1555
|
}
|
|
1568
|
-
return b(
|
|
1569
|
-
},
|
|
1556
|
+
return b(x(m, l, p), o, i, d, f, o.xmlWhitespaceSensitivity === "strict");
|
|
1557
|
+
}, ao = [
|
|
1570
1558
|
"xml",
|
|
1571
1559
|
"opml",
|
|
1572
1560
|
"rss",
|
|
1573
1561
|
"svg"
|
|
1574
|
-
],
|
|
1575
|
-
[
|
|
1562
|
+
], oo = S(Y), so = C(Y), co = w(Y), lo = {
|
|
1563
|
+
[oo]: {
|
|
1576
1564
|
category: "Embed",
|
|
1577
1565
|
type: "string",
|
|
1578
1566
|
array: !0,
|
|
1579
|
-
default: [{ value: [...
|
|
1567
|
+
default: [{ value: [...ao] }],
|
|
1580
1568
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin.",
|
|
1581
|
-
deprecated: `Please use \`${
|
|
1569
|
+
deprecated: `Please use \`${so}\` or \`${co}\`.`
|
|
1582
1570
|
},
|
|
1583
|
-
[
|
|
1571
|
+
[so]: {
|
|
1584
1572
|
category: "Embed",
|
|
1585
1573
|
type: "string",
|
|
1586
1574
|
array: !0,
|
|
1587
|
-
default: [{ value: [
|
|
1575
|
+
default: [{ value: [E] }],
|
|
1588
1576
|
description: "Block comments that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1589
1577
|
},
|
|
1590
|
-
[
|
|
1578
|
+
[co]: {
|
|
1591
1579
|
category: "Embed",
|
|
1592
1580
|
type: "string",
|
|
1593
1581
|
array: !0,
|
|
1594
|
-
default: [{ value: [
|
|
1582
|
+
default: [{ value: [E] }],
|
|
1595
1583
|
description: "Tags that make their subsequent template literals be identified as embedded XML language. This option requires the `@prettier/plugin-xml` plugin."
|
|
1596
1584
|
},
|
|
1597
1585
|
__embeddedXmlFragmentRecoverIndex: {
|
|
@@ -1604,15 +1592,15 @@ var Dr = "embeddedMotoko", Or = ["motoko", "mo"], kr = T(Dr), Ar = E(Dr), jr = {
|
|
|
1604
1592
|
};
|
|
1605
1593
|
//#endregion
|
|
1606
1594
|
//#region src/embedded/xml/parser.ts
|
|
1607
|
-
function
|
|
1595
|
+
function uo(e, t) {
|
|
1608
1596
|
if (t && Number.isFinite(t.line) && Number.isFinite(t.column)) return e.split("\n").slice(0, t.line - 1).reduce((e, t) => e + t.length + 1, 0) + t.column - 1;
|
|
1609
1597
|
}
|
|
1610
|
-
async function
|
|
1598
|
+
async function X(e, t, n) {
|
|
1611
1599
|
try {
|
|
1612
1600
|
return await n.parse(e, t);
|
|
1613
1601
|
} catch (r) {
|
|
1614
1602
|
if (!(r instanceof Error)) throw r;
|
|
1615
|
-
let { loc: i } = r, a =
|
|
1603
|
+
let { loc: i } = r, a = uo(e, i?.start), o = uo(e, i?.end), s = t, c = (...e) => s.__embeddedXmlFragmentRecoverIndex?.splice(0, s.__embeddedXmlFragmentRecoverIndex.length, ...e), l = "Expecting token of type --> OPEN <-- but found --> ";
|
|
1616
1604
|
if (r.message.startsWith(`${l}'' <--`)) {
|
|
1617
1605
|
let r = await n.parse(`${e}<prettier-embed-fragment />`, t);
|
|
1618
1606
|
return r.children ? delete r.children.element : r.element = null, r.location = {
|
|
@@ -1620,39 +1608,48 @@ async function Z(e, t, n) {
|
|
|
1620
1608
|
endOffset: e.length - 1
|
|
1621
1609
|
}, r;
|
|
1622
1610
|
}
|
|
1623
|
-
if (a !== void 0 && a > 0 && (r.message.startsWith("Expecting token of type --> EOF <--") || r.message.startsWith("Redundant input, expecting EOF but found: "))) return c(a),
|
|
1624
|
-
if (a !== void 0 && o !== void 0 && r.message.startsWith(l)) return c(a, o),
|
|
1611
|
+
if (a !== void 0 && a > 0 && (r.message.startsWith("Expecting token of type --> EOF <--") || r.message.startsWith("Redundant input, expecting EOF but found: "))) return c(a), X(e.slice(0, a), t, n);
|
|
1612
|
+
if (a !== void 0 && o !== void 0 && r.message.startsWith(l)) return c(a, o), X("", t, n);
|
|
1625
1613
|
throw r;
|
|
1626
1614
|
}
|
|
1627
1615
|
}
|
|
1628
|
-
function
|
|
1616
|
+
function fo(e) {
|
|
1629
1617
|
if (typeof e == "object" && e && "parsers" in e) return e.parsers?.xml;
|
|
1630
1618
|
}
|
|
1631
|
-
function
|
|
1632
|
-
let t =
|
|
1619
|
+
function po(e) {
|
|
1620
|
+
let t = fo(typeof e == "object" && e && "default" in e ? e.default : e);
|
|
1633
1621
|
if (!t) throw Error("The XML plugin must provide the \"xml\" parser.");
|
|
1634
1622
|
return t;
|
|
1635
1623
|
}
|
|
1636
|
-
async function
|
|
1624
|
+
async function mo(e, t = () => import("@prettier/plugin-xml"), n = import.meta.url) {
|
|
1637
1625
|
try {
|
|
1638
|
-
return
|
|
1626
|
+
return po(await t());
|
|
1639
1627
|
} catch (t) {
|
|
1640
|
-
|
|
1641
|
-
let
|
|
1642
|
-
|
|
1643
|
-
|
|
1628
|
+
if (typeof process < "u" && process.versions?.node) {
|
|
1629
|
+
let [{ createRequire: t }, r, { pathToFileURL: i }] = await Promise.all([
|
|
1630
|
+
import("node:module"),
|
|
1631
|
+
import("node:path"),
|
|
1632
|
+
import("node:url")
|
|
1633
|
+
]);
|
|
1634
|
+
for (let a of [n, e ? r.resolve(e) : `${process.cwd()}/package.json`]) try {
|
|
1635
|
+
return po(await import(
|
|
1636
|
+
/* @vite-ignore */
|
|
1637
|
+
i(t(a).resolve("@prettier/plugin-xml")).href
|
|
1638
|
+
));
|
|
1639
|
+
} catch {}
|
|
1640
|
+
}
|
|
1644
1641
|
throw Error("Formatting embedded XML requires the consumer to install and load \"@prettier/plugin-xml\".", { cause: t });
|
|
1645
1642
|
}
|
|
1646
1643
|
}
|
|
1647
|
-
async function
|
|
1644
|
+
async function ho(e, t, n = mo) {
|
|
1648
1645
|
for (let n = (t.plugins?.length ?? 0) - 1; n >= 0; n--) {
|
|
1649
|
-
let r =
|
|
1650
|
-
if (r) return
|
|
1646
|
+
let r = fo(t.plugins[n]);
|
|
1647
|
+
if (r) return X(e, t, r);
|
|
1651
1648
|
}
|
|
1652
|
-
return
|
|
1649
|
+
return X(e, t, await n(t.filepath));
|
|
1653
1650
|
}
|
|
1654
|
-
var
|
|
1655
|
-
parse:
|
|
1651
|
+
var go = {
|
|
1652
|
+
parse: ho,
|
|
1656
1653
|
astFormat: "xml",
|
|
1657
1654
|
locStart(e) {
|
|
1658
1655
|
return e.location?.startOffset ?? 0;
|
|
@@ -1660,33 +1657,33 @@ var fo = {
|
|
|
1660
1657
|
locEnd(e) {
|
|
1661
1658
|
return e.location?.endOffset ?? NaN;
|
|
1662
1659
|
}
|
|
1663
|
-
},
|
|
1664
|
-
embedder: () =>
|
|
1665
|
-
language: () =>
|
|
1666
|
-
loadXmlParser: () =>
|
|
1667
|
-
options: () =>
|
|
1668
|
-
parseWithXmlPlugin: () =>
|
|
1669
|
-
parseXml: () =>
|
|
1670
|
-
parser: () =>
|
|
1671
|
-
}),
|
|
1660
|
+
}, _o = /* @__PURE__ */ l({
|
|
1661
|
+
embedder: () => io,
|
|
1662
|
+
language: () => Y,
|
|
1663
|
+
loadXmlParser: () => mo,
|
|
1664
|
+
options: () => lo,
|
|
1665
|
+
parseWithXmlPlugin: () => X,
|
|
1666
|
+
parseXml: () => ho,
|
|
1667
|
+
parser: () => go
|
|
1668
|
+
}), Z = "embeddedXQuery", vo = D({
|
|
1672
1669
|
parser: "xquery",
|
|
1673
|
-
parserOption: `${
|
|
1674
|
-
}),
|
|
1675
|
-
[
|
|
1670
|
+
parserOption: `${Z}Parser`
|
|
1671
|
+
}), yo = ["xquery", "xq"], bo = C(Z), xo = w(Z), So = `${Z}Parser`, Co = {
|
|
1672
|
+
[bo]: {
|
|
1676
1673
|
category: "Embed",
|
|
1677
1674
|
type: "string",
|
|
1678
1675
|
array: !0,
|
|
1679
|
-
default: [{ value: [...
|
|
1676
|
+
default: [{ value: [...yo] }],
|
|
1680
1677
|
description: "Block comments that identify embedded XQuery in template literals. Requires the `prettier-plugin-xquery` plugin."
|
|
1681
1678
|
},
|
|
1682
|
-
[
|
|
1679
|
+
[xo]: {
|
|
1683
1680
|
category: "Embed",
|
|
1684
1681
|
type: "string",
|
|
1685
1682
|
array: !0,
|
|
1686
|
-
default: [{ value: [...
|
|
1683
|
+
default: [{ value: [...yo] }],
|
|
1687
1684
|
description: "Tags that identify embedded XQuery in template literals. Requires the `prettier-plugin-xquery` plugin."
|
|
1688
1685
|
},
|
|
1689
|
-
[
|
|
1686
|
+
[So]: {
|
|
1690
1687
|
category: "Embed",
|
|
1691
1688
|
type: "choice",
|
|
1692
1689
|
default: "xquery",
|
|
@@ -1699,96 +1696,92 @@ var fo = {
|
|
|
1699
1696
|
description: "Use the `xquery4` parser."
|
|
1700
1697
|
}]
|
|
1701
1698
|
}
|
|
1702
|
-
},
|
|
1703
|
-
embedder: () =>
|
|
1704
|
-
language: () =>
|
|
1705
|
-
options: () =>
|
|
1706
|
-
}),
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
parser: "yaml"
|
|
1714
|
-
}), l, m), o, i, d, f);
|
|
1715
|
-
}, So = "embeddedYaml", Co = ["yaml", "yml"], wo = w(So), To = T(So), Eo = E(So), Do = {
|
|
1716
|
-
[wo]: {
|
|
1699
|
+
}, wo = /* @__PURE__ */ l({
|
|
1700
|
+
embedder: () => vo,
|
|
1701
|
+
language: () => Z,
|
|
1702
|
+
options: () => Co
|
|
1703
|
+
}), To = D({
|
|
1704
|
+
parser: "yaml",
|
|
1705
|
+
parserOptions: { useTabs: !1 },
|
|
1706
|
+
preserveTrailingWhitespace: !0,
|
|
1707
|
+
transformDoc: (e) => t.mapDoc(e, (e) => e && typeof e == "object" && !Array.isArray(e) && e.type === "align" && e.n === -Infinity && Array.isArray(e.contents) && e.contents.length === 2 && typeof e.contents[0] == "object" && !Array.isArray(e.contents[0]) && e.contents[0]?.type === "line" && e.contents[0].hard && typeof e.contents[1] == "object" && !Array.isArray(e.contents[1]) && e.contents[1]?.type === "break-parent" ? "" : e)
|
|
1708
|
+
}), Eo = "embeddedYaml", Do = ["yaml", "yml"], Oo = S(Eo), ko = C(Eo), Ao = w(Eo), jo = {
|
|
1709
|
+
[Oo]: {
|
|
1717
1710
|
category: "Embed",
|
|
1718
1711
|
type: "string",
|
|
1719
1712
|
array: !0,
|
|
1720
|
-
default: [{ value: [...
|
|
1713
|
+
default: [{ value: [...Do] }],
|
|
1721
1714
|
description: "Tag or comment identifiers that make their subsequent template literals be identified as embedded YAML language.",
|
|
1722
|
-
deprecated: `Please use \`${
|
|
1715
|
+
deprecated: `Please use \`${ko}\` or \`${Ao}\`.`
|
|
1723
1716
|
},
|
|
1724
|
-
[
|
|
1717
|
+
[ko]: {
|
|
1725
1718
|
category: "Embed",
|
|
1726
1719
|
type: "string",
|
|
1727
1720
|
array: !0,
|
|
1728
|
-
default: [{ value: [
|
|
1721
|
+
default: [{ value: [E] }],
|
|
1729
1722
|
description: "Block comments that make their subsequent template literals be identified as embedded YAML language."
|
|
1730
1723
|
},
|
|
1731
|
-
[
|
|
1724
|
+
[Ao]: {
|
|
1732
1725
|
category: "Embed",
|
|
1733
1726
|
type: "string",
|
|
1734
1727
|
array: !0,
|
|
1735
|
-
default: [{ value: [
|
|
1728
|
+
default: [{ value: [E] }],
|
|
1736
1729
|
description: "Tags that make their subsequent template literals be identified as embedded YAML language."
|
|
1737
1730
|
}
|
|
1738
|
-
},
|
|
1739
|
-
embedder: () =>
|
|
1740
|
-
language: () =>
|
|
1741
|
-
options: () =>
|
|
1742
|
-
}),
|
|
1743
|
-
"./astro/index.ts":
|
|
1744
|
-
"./css/index.ts":
|
|
1745
|
-
"./dockerfile/index.ts":
|
|
1746
|
-
"./es/index.ts":
|
|
1747
|
-
"./gherkin/index.ts":
|
|
1748
|
-
"./glsl/index.ts":
|
|
1749
|
-
"./go-template/index.ts":
|
|
1750
|
-
"./graphql/index.ts":
|
|
1751
|
-
"./handlebars/index.ts":
|
|
1752
|
-
"./html/index.ts":
|
|
1753
|
-
"./hugo/index.ts":
|
|
1754
|
-
"./ini/index.ts":
|
|
1755
|
-
"./java/index.ts":
|
|
1756
|
-
"./jinja/index.ts":
|
|
1757
|
-
"./json/index.ts":
|
|
1758
|
-
"./jsonata/index.ts":
|
|
1759
|
-
"./jte/index.ts":
|
|
1760
|
-
"./latex/index.ts":
|
|
1761
|
-
"./liquid/index.ts":
|
|
1762
|
-
"./markdown/index.ts":
|
|
1763
|
-
"./marko/index.ts":
|
|
1764
|
-
"./motoko/index.ts":
|
|
1765
|
-
"./mustache/index.ts":
|
|
1766
|
-
"./nginx/index.ts":
|
|
1767
|
-
"./noop/index.ts":
|
|
1768
|
-
"./nunjucks/index.ts":
|
|
1769
|
-
"./pegjs/index.ts":
|
|
1770
|
-
"./php/index.ts":
|
|
1771
|
-
"./powershell/index.ts":
|
|
1772
|
-
"./prisma/index.ts":
|
|
1773
|
-
"./properties/index.ts":
|
|
1774
|
-
"./pug/index.ts":
|
|
1775
|
-
"./ruby/index.ts":
|
|
1776
|
-
"./sh/index.ts":
|
|
1777
|
-
"./solidity/index.ts":
|
|
1778
|
-
"./sql/index.ts":
|
|
1779
|
-
"./svelte/index.ts":
|
|
1780
|
-
"./toml/index.ts":
|
|
1781
|
-
"./ts/index.ts":
|
|
1782
|
-
"./xml/index.ts":
|
|
1783
|
-
"./xquery/index.ts":
|
|
1784
|
-
"./yaml/index.ts":
|
|
1731
|
+
}, Mo = /* @__PURE__ */ l({
|
|
1732
|
+
embedder: () => To,
|
|
1733
|
+
language: () => Eo,
|
|
1734
|
+
options: () => jo
|
|
1735
|
+
}), Q = [], No = {}, Po = {}, Fo = {}, Io = /* #__PURE__ */ Object.assign({
|
|
1736
|
+
"./astro/index.ts": Le,
|
|
1737
|
+
"./css/index.ts": Ke,
|
|
1738
|
+
"./dockerfile/index.ts": $e,
|
|
1739
|
+
"./es/index.ts": ct,
|
|
1740
|
+
"./gherkin/index.ts": ht,
|
|
1741
|
+
"./glsl/index.ts": Ct,
|
|
1742
|
+
"./go-template/index.ts": At,
|
|
1743
|
+
"./graphql/index.ts": Lt,
|
|
1744
|
+
"./handlebars/index.ts": Wt,
|
|
1745
|
+
"./html/index.ts": $t,
|
|
1746
|
+
"./hugo/index.ts": sn,
|
|
1747
|
+
"./ini/index.ts": mn,
|
|
1748
|
+
"./java/index.ts": xn,
|
|
1749
|
+
"./jinja/index.ts": On,
|
|
1750
|
+
"./json/index.ts": Rn,
|
|
1751
|
+
"./jsonata/index.ts": Gn,
|
|
1752
|
+
"./jte/index.ts": Qn,
|
|
1753
|
+
"./latex/index.ts": ar,
|
|
1754
|
+
"./liquid/index.ts": fr,
|
|
1755
|
+
"./markdown/index.ts": xr,
|
|
1756
|
+
"./marko/index.ts": Or,
|
|
1757
|
+
"./motoko/index.ts": Ir,
|
|
1758
|
+
"./mustache/index.ts": Ur,
|
|
1759
|
+
"./nginx/index.ts": Xr,
|
|
1760
|
+
"./noop/index.ts": ti,
|
|
1761
|
+
"./nunjucks/index.ts": ci,
|
|
1762
|
+
"./pegjs/index.ts": hi,
|
|
1763
|
+
"./php/index.ts": Si,
|
|
1764
|
+
"./powershell/index.ts": ki,
|
|
1765
|
+
"./prisma/index.ts": Ii,
|
|
1766
|
+
"./properties/index.ts": Ui,
|
|
1767
|
+
"./pug/index.ts": Xi,
|
|
1768
|
+
"./ruby/index.ts": aa,
|
|
1769
|
+
"./sh/index.ts": pa,
|
|
1770
|
+
"./solidity/index.ts": ba,
|
|
1771
|
+
"./sql/index.ts": Ma,
|
|
1772
|
+
"./svelte/index.ts": za,
|
|
1773
|
+
"./toml/index.ts": qa,
|
|
1774
|
+
"./ts/index.ts": no,
|
|
1775
|
+
"./xml/index.ts": _o,
|
|
1776
|
+
"./xquery/index.ts": wo,
|
|
1777
|
+
"./yaml/index.ts": Mo
|
|
1785
1778
|
});
|
|
1786
|
-
for (let { language: e, parser: t, embedder: n, options: r } of Object.values(
|
|
1779
|
+
for (let { language: e, parser: t, embedder: n, options: r } of Object.values(Io)) Te(Q, e, z), t && (No[e] = t), n && (Po[e] = n), Object.assign(Fo, r);
|
|
1787
1780
|
//#endregion
|
|
1788
1781
|
//#region src/options.ts
|
|
1789
|
-
var
|
|
1790
|
-
...
|
|
1791
|
-
[
|
|
1782
|
+
var Lo = "noEmbeddedIdentificationByComment", Ro = "noEmbeddedIdentificationByTag", zo = "preserveEmbeddedExteriorWhitespaces", Bo = "noEmbeddedMultiLineIndentation", Vo = "embeddedOverrides", Ho = {
|
|
1783
|
+
...Fo,
|
|
1784
|
+
[Lo]: {
|
|
1792
1785
|
category: "Embed",
|
|
1793
1786
|
type: "string",
|
|
1794
1787
|
array: !0,
|
|
@@ -1796,7 +1789,7 @@ var Po = "noEmbeddedIdentificationByComment", Fo = "noEmbeddedIdentificationByTa
|
|
|
1796
1789
|
description: "Turns off `` /* comment */ `...` `` comment-based embedded language identification for the specified identifiers.",
|
|
1797
1790
|
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1798
1791
|
},
|
|
1799
|
-
[
|
|
1792
|
+
[Ro]: {
|
|
1800
1793
|
category: "Embed",
|
|
1801
1794
|
type: "string",
|
|
1802
1795
|
array: !0,
|
|
@@ -1804,53 +1797,53 @@ var Po = "noEmbeddedIdentificationByComment", Fo = "noEmbeddedIdentificationByTa
|
|
|
1804
1797
|
description: "Turns off `` tag`...` `` tag-based embedded language identification for the specified identifiers.",
|
|
1805
1798
|
deprecated: "Please use `embedded<Language>Comments` or `embedded<Language>Tags` to configure each embedded language, and you won't need this option anymore."
|
|
1806
1799
|
},
|
|
1807
|
-
[
|
|
1800
|
+
[zo]: {
|
|
1808
1801
|
category: "Embed",
|
|
1809
1802
|
type: "string",
|
|
1810
1803
|
array: !0,
|
|
1811
1804
|
default: [{ value: [] }],
|
|
1812
1805
|
description: "Preserves leading and trailing whitespaces in the formatting results for the specified comments or tags."
|
|
1813
1806
|
},
|
|
1814
|
-
[
|
|
1807
|
+
[Bo]: {
|
|
1815
1808
|
category: "Embed",
|
|
1816
1809
|
type: "string",
|
|
1817
1810
|
array: !0,
|
|
1818
1811
|
default: [{ value: [] }],
|
|
1819
1812
|
description: "Turns off auto indentation in the formatting results for the specified comments or tags when they are formatted to span multi lines."
|
|
1820
1813
|
},
|
|
1821
|
-
[
|
|
1814
|
+
[Vo]: {
|
|
1822
1815
|
category: "Embed",
|
|
1823
1816
|
type: "string",
|
|
1824
1817
|
array: !1,
|
|
1825
1818
|
default: void 0,
|
|
1826
1819
|
description: "Option overrides for the specified comments or tags. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
1827
1820
|
}
|
|
1828
|
-
},
|
|
1829
|
-
...
|
|
1821
|
+
}, Uo = {
|
|
1822
|
+
...n.parsers,
|
|
1823
|
+
...r.parsers,
|
|
1824
|
+
...i.parsers,
|
|
1830
1825
|
...o.parsers,
|
|
1831
|
-
...
|
|
1832
|
-
...
|
|
1833
|
-
|
|
1834
|
-
...Ao
|
|
1835
|
-
}, Vo = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, Ho = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, Uo = { parse: (e) => {
|
|
1826
|
+
...a.parsers,
|
|
1827
|
+
...No
|
|
1828
|
+
}, Wo = /("(?:\\?[^])*?")|(\/\/.*)|(\/\*[^]*?\*\/)/g, Go = /("(?:\\?[^])*?")|(,\s*)(?=]|})/g, Ko = { parse: (e) => {
|
|
1836
1829
|
e = String(e);
|
|
1837
1830
|
try {
|
|
1838
1831
|
return JSON.parse(e);
|
|
1839
1832
|
} catch {
|
|
1840
|
-
return JSON.parse(e.replace(
|
|
1833
|
+
return JSON.parse(e.replace(Wo, "$1").replace(Go, "$1"));
|
|
1841
1834
|
}
|
|
1842
|
-
} }, { label:
|
|
1843
|
-
async function
|
|
1835
|
+
} }, { label: qo } = e;
|
|
1836
|
+
async function Jo(e) {
|
|
1844
1837
|
try {
|
|
1845
1838
|
let { readFile: t } = await import("node:fs/promises"), n = await t(e, { encoding: "utf-8" });
|
|
1846
|
-
return
|
|
1839
|
+
return Ko.parse(n);
|
|
1847
1840
|
} catch {}
|
|
1848
1841
|
}
|
|
1849
|
-
var
|
|
1850
|
-
async function
|
|
1842
|
+
var Yo = /* @__PURE__ */ new URL("./import-module-worker.js", import.meta.url);
|
|
1843
|
+
async function Xo(e) {
|
|
1851
1844
|
let { Worker: t } = await import("node:worker_threads");
|
|
1852
1845
|
return new Promise((n) => {
|
|
1853
|
-
let r = new t(
|
|
1846
|
+
let r = new t(Yo, { workerData: { absolutePath: e } });
|
|
1854
1847
|
r.once("message", (e) => {
|
|
1855
1848
|
r.terminate(), e.error && console.error(e.error), n(e.overrides);
|
|
1856
1849
|
}), r.once("error", (e) => {
|
|
@@ -1860,15 +1853,18 @@ async function qo(e) {
|
|
|
1860
1853
|
});
|
|
1861
1854
|
});
|
|
1862
1855
|
}
|
|
1863
|
-
async function
|
|
1856
|
+
async function Zo(e, t) {
|
|
1864
1857
|
let { isAbsolute: n, dirname: r, resolve: i } = await import("node:path");
|
|
1865
1858
|
if (n(e)) return e;
|
|
1866
|
-
let a = await
|
|
1867
|
-
|
|
1859
|
+
let { resolveConfigFile: a } = await import(
|
|
1860
|
+
/* @vite-ignore */
|
|
1861
|
+
"prettier"
|
|
1862
|
+
), o = await a(t);
|
|
1863
|
+
return i(typeof o == "string" ? r(o) : process.env.PWD ?? process.cwd(), e);
|
|
1868
1864
|
}
|
|
1869
|
-
var
|
|
1865
|
+
var Qo = async (e, t) => {
|
|
1870
1866
|
try {
|
|
1871
|
-
return
|
|
1867
|
+
return Ko.parse(e);
|
|
1872
1868
|
} catch {}
|
|
1873
1869
|
let n;
|
|
1874
1870
|
try {
|
|
@@ -1877,39 +1873,39 @@ var Yo = async (e, t) => {
|
|
|
1877
1873
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1878
1874
|
return;
|
|
1879
1875
|
}
|
|
1880
|
-
let r = () =>
|
|
1876
|
+
let r = () => Zo(e, t);
|
|
1881
1877
|
if (n === ".json" || n === ".jsonc") {
|
|
1882
|
-
let e = await r(), t = await
|
|
1878
|
+
let e = await r(), t = await Jo(e);
|
|
1883
1879
|
if (t !== void 0) return t;
|
|
1884
1880
|
console.error(`Failed to parse the json file: ${e}`);
|
|
1885
1881
|
} else if (n === ".mjs" || n === ".cjs" || n === ".js") {
|
|
1886
|
-
let e = await r(), t = await
|
|
1882
|
+
let e = await r(), t = await Xo(e);
|
|
1887
1883
|
if (t !== void 0) return t;
|
|
1888
1884
|
console.error(`Failed to parse the js module file: ${e}`);
|
|
1889
1885
|
} else if (n === ".mts" || n === ".cts" || n === ".ts") {
|
|
1890
|
-
let e = await r(), t = await
|
|
1886
|
+
let e = await r(), t = await Xo(e);
|
|
1891
1887
|
if (t !== void 0) return t;
|
|
1892
1888
|
console.error(`Failed to parse the ts module file: ${e}`);
|
|
1893
1889
|
} else {
|
|
1894
1890
|
if (n === "") {
|
|
1895
|
-
let e = await
|
|
1891
|
+
let e = await Jo(await r());
|
|
1896
1892
|
if (e !== void 0) return e;
|
|
1897
1893
|
}
|
|
1898
1894
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1899
1895
|
}
|
|
1900
|
-
},
|
|
1901
|
-
async function
|
|
1896
|
+
}, $o = /* @__PURE__ */ new WeakMap();
|
|
1897
|
+
async function es(e, { commentOrTag: t, kind: n }) {
|
|
1902
1898
|
if (e.embeddedOverrides === void 0) return;
|
|
1903
|
-
let r =
|
|
1904
|
-
r === void 0 && (r =
|
|
1899
|
+
let r = $o.get(e);
|
|
1900
|
+
r === void 0 && (r = Qo(e.embeddedOverrides, e.filepath), $o.set(e, r));
|
|
1905
1901
|
let i = await r;
|
|
1906
1902
|
if (i !== void 0) for (let { [`${n}s`]: e, identifiers: r, options: a } of i) {
|
|
1907
1903
|
let n = e ?? [];
|
|
1908
1904
|
if (n.length === 0 && r?.includes(t) || n.includes(t)) return a;
|
|
1909
1905
|
}
|
|
1910
1906
|
}
|
|
1911
|
-
function*
|
|
1912
|
-
yield e, e.type === "CallExpression" && (yield*
|
|
1907
|
+
function* ts(e) {
|
|
1908
|
+
yield e, e.type === "CallExpression" && (yield* ts(e.callee));
|
|
1913
1909
|
}
|
|
1914
1910
|
function $(e) {
|
|
1915
1911
|
if (e.type === "Identifier") return e.name;
|
|
@@ -1926,7 +1922,7 @@ function $(e) {
|
|
|
1926
1922
|
}
|
|
1927
1923
|
if (e.type === "ChainExpression") return $(e.expression);
|
|
1928
1924
|
}
|
|
1929
|
-
function
|
|
1925
|
+
function ns(e, t) {
|
|
1930
1926
|
let n = /^\/(.*)\/([dgimsuvy]*)$/.exec(t);
|
|
1931
1927
|
if (!n) return !1;
|
|
1932
1928
|
try {
|
|
@@ -1936,7 +1932,7 @@ function $o(e, t) {
|
|
|
1936
1932
|
return !1;
|
|
1937
1933
|
}
|
|
1938
1934
|
}
|
|
1939
|
-
var
|
|
1935
|
+
var rs = (() => {
|
|
1940
1936
|
let e = /* @__PURE__ */ new Set([
|
|
1941
1937
|
"start",
|
|
1942
1938
|
"end",
|
|
@@ -1947,7 +1943,7 @@ var es = (() => {
|
|
|
1947
1943
|
"decorators"
|
|
1948
1944
|
]);
|
|
1949
1945
|
return (t, n, r, i) => {
|
|
1950
|
-
if (/^\/.*\/[dgimsuvy]*$/.test(n)) return
|
|
1946
|
+
if (/^\/.*\/[dgimsuvy]*$/.test(n)) return ns(t, n);
|
|
1951
1947
|
let a = i?.get(n);
|
|
1952
1948
|
try {
|
|
1953
1949
|
let e = i?.has(n) ? a : r(`${n}\`\``);
|
|
@@ -1959,11 +1955,11 @@ var es = (() => {
|
|
|
1959
1955
|
if (i?.set(n, a), !a || (a.type === "File" && (a = a.program), a.type !== "Program" || a.body[0]?.type !== "ExpressionStatement")) return !1;
|
|
1960
1956
|
let o = a.body[0]?.expression;
|
|
1961
1957
|
if (o?.type !== "TaggedTemplateExpression") return !1;
|
|
1962
|
-
for (let n of
|
|
1958
|
+
for (let n of ts(t)) if (ds(n, o.tag, e)) return !0;
|
|
1963
1959
|
return !1;
|
|
1964
1960
|
};
|
|
1965
1961
|
})();
|
|
1966
|
-
function
|
|
1962
|
+
function is({ node: e, parent: t }) {
|
|
1967
1963
|
let n = e.comments ?? t?.comments;
|
|
1968
1964
|
if (!n) return;
|
|
1969
1965
|
let r = n[n.length - 1];
|
|
@@ -1975,32 +1971,32 @@ function ts({ node: e, parent: t }) {
|
|
|
1975
1971
|
let i = r.value;
|
|
1976
1972
|
if (i.length > 1 && i.startsWith(" ") && i.endsWith(" ")) return i.slice(1, -1);
|
|
1977
1973
|
}
|
|
1978
|
-
function
|
|
1974
|
+
function as({ parent: e }) {
|
|
1979
1975
|
if (e?.type === "TaggedTemplateExpression") return e.tag.type === "Identifier" ? e.tag.name : e.tag;
|
|
1980
1976
|
}
|
|
1981
|
-
function
|
|
1977
|
+
function os(e, t) {
|
|
1982
1978
|
return e.noEmbeddedIdentificationByComment?.includes(t) ?? !1 ? function* (e) {} : function* (t) {
|
|
1983
|
-
let n = e[
|
|
1984
|
-
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[
|
|
1979
|
+
let n = e[C(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1980
|
+
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[S(t)] ?? [] : yield* n;
|
|
1985
1981
|
};
|
|
1986
1982
|
}
|
|
1987
|
-
function
|
|
1983
|
+
function ss(e, t) {
|
|
1988
1984
|
return typeof t == "string" ? e.noEmbeddedIdentificationByTag?.includes(t) ?? !1 ? function* (e) {} : function* (t) {
|
|
1989
|
-
let n = e[
|
|
1990
|
-
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[
|
|
1985
|
+
let n = e[w(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1986
|
+
n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed" ? yield* e[S(t)] ?? [] : yield* n;
|
|
1991
1987
|
} : function* (t) {
|
|
1992
|
-
let n = e[
|
|
1988
|
+
let n = e[w(t)] ?? ["9ff2b366e8ca4c97b9aed1a29b5b94ed"];
|
|
1993
1989
|
if (n[0] === "9ff2b366e8ca4c97b9aed1a29b5b94ed") {
|
|
1994
1990
|
let { noEmbeddedIdentificationByTag: n } = e;
|
|
1995
|
-
for (let r of e[
|
|
1991
|
+
for (let r of e[S(t)] ?? []) n?.includes(r) || (yield r);
|
|
1996
1992
|
} else yield* n;
|
|
1997
1993
|
};
|
|
1998
1994
|
}
|
|
1999
|
-
function
|
|
2000
|
-
let a =
|
|
1995
|
+
function cs(e, t, n, r, i) {
|
|
1996
|
+
let a = Po[t];
|
|
2001
1997
|
if (!a) return null;
|
|
2002
1998
|
if (e.quasis.length === 1 && e.quasis[0]?.value.raw.trim() === "") return "``";
|
|
2003
|
-
let o =
|
|
1999
|
+
let o = es(i, {
|
|
2004
2000
|
commentOrTag: n,
|
|
2005
2001
|
kind: r
|
|
2006
2002
|
});
|
|
@@ -2010,76 +2006,76 @@ function as(e, t, n, r, i) {
|
|
|
2010
2006
|
kind: r,
|
|
2011
2007
|
embeddedOverrideOptions: await o
|
|
2012
2008
|
});
|
|
2013
|
-
return
|
|
2009
|
+
return qo({
|
|
2014
2010
|
embed: !0,
|
|
2015
2011
|
...t.label
|
|
2016
2012
|
}, t);
|
|
2017
2013
|
};
|
|
2018
2014
|
}
|
|
2019
|
-
function
|
|
2020
|
-
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ?
|
|
2015
|
+
function ls(e, t, n) {
|
|
2016
|
+
return Object.is(e, t) ? !0 : e === null || t === null ? !1 : Array.isArray(e) ? us(e, t, n) : typeof e == "object" && ds(e, t, n);
|
|
2021
2017
|
}
|
|
2022
|
-
function
|
|
2018
|
+
function us(e, t, n) {
|
|
2023
2019
|
let r = e.length;
|
|
2024
2020
|
if (r !== t.length) return !1;
|
|
2025
|
-
for (let i = 0; i < r; i++) if (!
|
|
2021
|
+
for (let i = 0; i < r; i++) if (!ls(e[i], t[i], n)) return !1;
|
|
2026
2022
|
return !0;
|
|
2027
2023
|
}
|
|
2028
|
-
function
|
|
2029
|
-
for (let r of Object.keys(e)) if (!n?.has(r) && !(Object.hasOwn(t, r) &&
|
|
2024
|
+
function ds(e, t, n) {
|
|
2025
|
+
for (let r of Object.keys(e)) if (!n?.has(r) && !(Object.hasOwn(t, r) && ls(e[r], t[r], n))) return !1;
|
|
2030
2026
|
return !0;
|
|
2031
2027
|
}
|
|
2032
2028
|
//#endregion
|
|
2033
2029
|
//#region src/printers.ts
|
|
2034
|
-
var { estree:
|
|
2030
|
+
var { estree: fs } = s, { embed: ps } = fs, ms = /* @__PURE__ */ new WeakMap(), hs = (e, t) => {
|
|
2035
2031
|
let { node: n } = e;
|
|
2036
2032
|
if (n.type !== "TemplateLiteral" || n.quasis.some(({ value: { cooked: e } }) => e === null)) return null;
|
|
2037
|
-
let r =
|
|
2033
|
+
let r = is(e);
|
|
2038
2034
|
if (typeof r == "string") {
|
|
2039
|
-
let i =
|
|
2040
|
-
for (let e of
|
|
2035
|
+
let i = os(t, r);
|
|
2036
|
+
for (let e of Q) {
|
|
2041
2037
|
let a = !1;
|
|
2042
2038
|
for (let t of i(e)) if (r === t) {
|
|
2043
2039
|
a = !0;
|
|
2044
2040
|
break;
|
|
2045
2041
|
}
|
|
2046
|
-
if (a) return
|
|
2042
|
+
if (a) return cs(n, e, r, "comment", t);
|
|
2047
2043
|
}
|
|
2048
|
-
return
|
|
2044
|
+
return ps?.(e, t) ?? null;
|
|
2049
2045
|
}
|
|
2050
|
-
let i =
|
|
2046
|
+
let i = as(e);
|
|
2051
2047
|
if (typeof i == "string") {
|
|
2052
|
-
let r =
|
|
2053
|
-
for (let e of
|
|
2048
|
+
let r = ss(t, i);
|
|
2049
|
+
for (let e of Q) {
|
|
2054
2050
|
let a;
|
|
2055
|
-
for (let t of r(e)) if (i === t ||
|
|
2051
|
+
for (let t of r(e)) if (i === t || ns({
|
|
2056
2052
|
type: "Identifier",
|
|
2057
2053
|
name: i
|
|
2058
2054
|
}, t)) {
|
|
2059
2055
|
a = t;
|
|
2060
2056
|
break;
|
|
2061
2057
|
}
|
|
2062
|
-
if (a !== void 0) return
|
|
2058
|
+
if (a !== void 0) return cs(n, e, a, "tag", t);
|
|
2063
2059
|
}
|
|
2064
|
-
return
|
|
2060
|
+
return ps?.(e, t) ?? null;
|
|
2065
2061
|
}
|
|
2066
2062
|
if (i !== void 0) {
|
|
2067
|
-
let e =
|
|
2068
|
-
e || (e = /* @__PURE__ */ new Map(),
|
|
2069
|
-
let r = (e) =>
|
|
2070
|
-
for (let o of
|
|
2063
|
+
let e = ms.get(t);
|
|
2064
|
+
e || (e = /* @__PURE__ */ new Map(), ms.set(t, e));
|
|
2065
|
+
let r = (e) => Uo[t.parser].parse(e, t), a = ss(t);
|
|
2066
|
+
for (let o of Q) {
|
|
2071
2067
|
let s;
|
|
2072
|
-
for (let t of a(o)) if (
|
|
2068
|
+
for (let t of a(o)) if (rs(i, t, r, e)) {
|
|
2073
2069
|
s = t;
|
|
2074
2070
|
break;
|
|
2075
2071
|
}
|
|
2076
|
-
if (s !== void 0) return
|
|
2072
|
+
if (s !== void 0) return cs(n, o, s, "tag", t);
|
|
2077
2073
|
}
|
|
2078
2074
|
}
|
|
2079
|
-
return
|
|
2080
|
-
},
|
|
2081
|
-
...
|
|
2082
|
-
embed:
|
|
2075
|
+
return ps?.(e, t) ?? null;
|
|
2076
|
+
}, gs = { estree: {
|
|
2077
|
+
...fs,
|
|
2078
|
+
embed: hs
|
|
2083
2079
|
} };
|
|
2084
2080
|
//#endregion
|
|
2085
|
-
export {
|
|
2081
|
+
export { Ho as options, Uo as parsers, gs as printers };
|