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