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