prettier-plugin-embed 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -9
- package/dist/embedded/css/embedder.d.ts +5 -2
- package/dist/embedded/css/index.d.ts +1 -1
- package/dist/embedded/css/language.d.ts +9 -0
- package/dist/embedded/css/options.d.ts +11 -9
- package/dist/embedded/es/embedder.d.ts +5 -2
- package/dist/embedded/es/index.d.ts +1 -1
- package/dist/embedded/es/language.d.ts +9 -0
- package/dist/embedded/es/options.d.ts +21 -16
- package/dist/embedded/glsl/embedder.d.ts +5 -2
- package/dist/embedded/glsl/index.d.ts +1 -1
- package/dist/embedded/glsl/language.d.ts +9 -0
- package/dist/embedded/glsl/options.d.ts +14 -12
- package/dist/embedded/graphql/embedder.d.ts +12 -0
- package/dist/embedded/graphql/index.d.ts +3 -0
- package/dist/embedded/graphql/language.d.ts +9 -0
- package/dist/embedded/graphql/options.d.ts +38 -0
- package/dist/embedded/html/embedder.d.ts +5 -2
- package/dist/embedded/html/index.d.ts +1 -1
- package/dist/embedded/html/language.d.ts +9 -0
- package/dist/embedded/html/options.d.ts +14 -12
- package/dist/embedded/ini/embedder.d.ts +12 -0
- package/dist/embedded/ini/index.d.ts +3 -0
- package/dist/embedded/ini/language.d.ts +9 -0
- package/dist/embedded/ini/options.d.ts +39 -0
- package/dist/embedded/json/embedder.d.ts +12 -0
- package/dist/embedded/json/index.d.ts +3 -0
- package/dist/embedded/json/language.d.ts +9 -0
- package/dist/embedded/json/options.d.ts +52 -0
- package/dist/embedded/latex/embedder.d.ts +12 -0
- package/dist/embedded/latex/index.d.ts +3 -0
- package/dist/embedded/latex/language.d.ts +9 -0
- package/dist/embedded/latex/options.d.ts +38 -0
- package/dist/embedded/markdown/embedder.d.ts +5 -2
- package/dist/embedded/markdown/index.d.ts +1 -1
- package/dist/embedded/markdown/language.d.ts +9 -0
- package/dist/embedded/markdown/options.d.ts +12 -10
- package/dist/embedded/noop/index.d.ts +1 -1
- package/dist/embedded/noop/language.d.ts +9 -0
- package/dist/embedded/noop/options.d.ts +10 -10
- package/dist/embedded/php/embedder.d.ts +5 -2
- package/dist/embedded/php/index.d.ts +1 -1
- package/dist/embedded/php/language.d.ts +9 -0
- package/dist/embedded/php/options.d.ts +14 -12
- package/dist/embedded/properties/embedder.d.ts +12 -0
- package/dist/embedded/properties/index.d.ts +3 -0
- package/dist/embedded/properties/language.d.ts +9 -0
- package/dist/embedded/properties/options.d.ts +40 -0
- package/dist/embedded/register.d.ts +17 -9
- package/dist/embedded/ruby/embedder.d.ts +5 -2
- package/dist/embedded/ruby/index.d.ts +1 -1
- package/dist/embedded/ruby/language.d.ts +9 -0
- package/dist/embedded/ruby/options.d.ts +24 -25
- package/dist/embedded/sh/embedder.d.ts +12 -0
- package/dist/embedded/sh/index.d.ts +3 -0
- package/dist/embedded/sh/language.d.ts +9 -0
- package/dist/embedded/sh/options.d.ts +39 -0
- package/dist/embedded/sql/embedder.d.ts +5 -2
- package/dist/embedded/sql/index.d.ts +1 -1
- package/dist/embedded/sql/language.d.ts +9 -0
- package/dist/embedded/sql/options.d.ts +55 -15
- package/dist/embedded/toml/embedder.d.ts +12 -0
- package/dist/embedded/toml/index.d.ts +3 -0
- package/dist/embedded/toml/language.d.ts +9 -0
- package/dist/embedded/toml/options.d.ts +39 -0
- package/dist/embedded/ts/embedder.d.ts +5 -2
- package/dist/embedded/ts/index.d.ts +1 -1
- package/dist/embedded/ts/language.d.ts +9 -0
- package/dist/embedded/ts/options.d.ts +21 -16
- package/dist/embedded/utils.d.ts +3 -1
- package/dist/embedded/xml/embedder.d.ts +5 -2
- package/dist/embedded/xml/index.d.ts +1 -1
- package/dist/embedded/xml/language.d.ts +9 -0
- package/dist/embedded/xml/options.d.ts +25 -21
- package/dist/embedded/xml/parser.d.ts +2 -2
- package/dist/embedded/yaml/embedder.d.ts +12 -0
- package/dist/embedded/yaml/index.d.ts +3 -0
- package/dist/embedded/yaml/language.d.ts +9 -0
- package/dist/embedded/yaml/options.d.ts +38 -0
- package/dist/index.js +1101 -702
- package/dist/options.d.ts +263 -146
- package/dist/utils.d.ts +1 -1
- package/package.json +26 -23
- package/dist/embedded/css/embedded-language.d.ts +0 -6
- package/dist/embedded/es/embedded-language.d.ts +0 -6
- package/dist/embedded/glsl/embedded-language.d.ts +0 -6
- package/dist/embedded/html/embedded-language.d.ts +0 -6
- package/dist/embedded/markdown/embedded-language.d.ts +0 -6
- package/dist/embedded/noop/embedded-language.d.ts +0 -6
- package/dist/embedded/php/embedded-language.d.ts +0 -6
- package/dist/embedded/ruby/embedded-language.d.ts +0 -6
- package/dist/embedded/sql/embedded-language.d.ts +0 -6
- package/dist/embedded/ts/embedded-language.d.ts +0 -6
- package/dist/embedded/xml/embedded-language.d.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { utils as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { printers as
|
|
8
|
-
import { readFile as
|
|
9
|
-
import { isAbsolute as
|
|
10
|
-
import { Worker as
|
|
11
|
-
import { resolveConfigFile as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
1
|
+
import { utils as X, builders as I } from "prettier/doc";
|
|
2
|
+
import Rt from "prettier/parser-babel";
|
|
3
|
+
import jt from "prettier/parser-espree";
|
|
4
|
+
import Ft from "prettier/parser-flow";
|
|
5
|
+
import wt from "prettier/parser-meriyah";
|
|
6
|
+
import Bt from "prettier/parser-typescript";
|
|
7
|
+
import { printers as Ut } from "prettier/plugins/estree.mjs";
|
|
8
|
+
import { readFile as Wt } from "node:fs/promises";
|
|
9
|
+
import { isAbsolute as Ct, dirname as Gt, resolve as qt, extname as zt } from "node:path";
|
|
10
|
+
import { Worker as Kt } from "node:worker_threads";
|
|
11
|
+
import { resolveConfigFile as Ht } from "prettier";
|
|
12
|
+
const { group: Jt, indent: Xt, softline: ie, lineSuffixBoundary: Yt } = I, { mapDoc: Qt } = X;
|
|
13
|
+
function Vt(t, n) {
|
|
14
14
|
const { node: r } = t;
|
|
15
15
|
let e = n();
|
|
16
|
-
return r?.comments?.length && (e =
|
|
16
|
+
return r?.comments?.length && (e = Jt([Xt([ie, e]), ie])), ["${", e, Yt, "}"];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function x(t, n) {
|
|
19
19
|
return t.map(
|
|
20
|
-
(r) =>
|
|
20
|
+
(r) => Vt(r, n),
|
|
21
21
|
"expressions"
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
function L(t, n, r) {
|
|
25
|
-
return
|
|
26
|
-
if (typeof
|
|
27
|
-
return
|
|
28
|
-
const
|
|
29
|
-
for (let
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
if (!
|
|
25
|
+
return Qt(t, (o) => {
|
|
26
|
+
if (typeof o != "string")
|
|
27
|
+
return o;
|
|
28
|
+
const s = [], l = o.split(n);
|
|
29
|
+
for (let d = 0; d < l.length; d++) {
|
|
30
|
+
let p = l[d];
|
|
31
|
+
if (d % 2 == 0) {
|
|
32
|
+
if (!p)
|
|
33
33
|
continue;
|
|
34
|
-
|
|
34
|
+
p = p.replaceAll(/([\\`]|\${)/g, "\\$1"), s.push(p);
|
|
35
35
|
} else {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const c = Number(p);
|
|
37
|
+
s.push(r[c]);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return s;
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function M(t, n, r) {
|
|
44
44
|
if (!(n.plugins?.some(
|
|
45
|
-
(e) => e.name?.
|
|
45
|
+
(e) => e.name?.endsWith(t) ?? !1
|
|
46
46
|
) ?? !1))
|
|
47
47
|
throw new Error(
|
|
48
48
|
`Cannot format embedded language identified by "${r}", because plugin "${t}" is not loaded.`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Zt(t, n, r) {
|
|
52
52
|
if (n === r) {
|
|
53
53
|
t.unshift(n);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
let e = 0,
|
|
57
|
-
for (; e <
|
|
58
|
-
const
|
|
59
|
-
if (t[
|
|
56
|
+
let e = 0, o = t.length;
|
|
57
|
+
for (; e < o; ) {
|
|
58
|
+
const s = e + o >>> 1;
|
|
59
|
+
if (t[s] === r) {
|
|
60
60
|
t.push(n);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
t[
|
|
63
|
+
t[s] < n ? e = s + 1 : o = s;
|
|
64
64
|
}
|
|
65
65
|
t.splice(e, 0, n);
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const Y = (() => {
|
|
68
68
|
const t = [...Array(26).keys()].map((n) => String.fromCharCode(n + 97)).concat([...Array(10).keys()].map((n) => `${n}`));
|
|
69
69
|
return () => {
|
|
70
70
|
let r = "";
|
|
@@ -73,91 +73,100 @@ const Q = (() => {
|
|
|
73
73
|
return r;
|
|
74
74
|
};
|
|
75
75
|
})();
|
|
76
|
-
function
|
|
77
|
-
const r =
|
|
78
|
-
`${
|
|
76
|
+
function T(t = "p", n = "") {
|
|
77
|
+
const r = Y(), e = Y(), o = ce(t), s = ce(n), l = (p) => `${t}${r}${p}${e}${n}`, d = new RegExp(
|
|
78
|
+
`${o}${r}(\\d+)${e}${s}`,
|
|
79
79
|
"g"
|
|
80
80
|
);
|
|
81
81
|
return {
|
|
82
|
-
createPlaceholder:
|
|
83
|
-
placeholderRegex:
|
|
82
|
+
createPlaceholder: l,
|
|
83
|
+
placeholderRegex: d
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function ce(t) {
|
|
87
87
|
return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function S(t) {
|
|
90
90
|
return `${t}Identifiers`;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function en(t) {
|
|
93
|
+
return `${t}Plugin`;
|
|
94
|
+
}
|
|
95
|
+
function V(t) {
|
|
93
96
|
return `${t}Parser`;
|
|
94
97
|
}
|
|
95
|
-
const { line:
|
|
98
|
+
const { line: ae, group: k, indent: de, softline: le } = I, tn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
96
99
|
e = {
|
|
97
100
|
...e,
|
|
98
|
-
...
|
|
101
|
+
...s
|
|
99
102
|
};
|
|
100
|
-
const { node:
|
|
101
|
-
(
|
|
102
|
-
).join(""),
|
|
103
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T("@p"), c = l.quasis.map(
|
|
104
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
105
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
106
|
+
a.length,
|
|
107
|
+
-u.length || void 0
|
|
108
|
+
), b = x(r, n), E = await t(y, {
|
|
103
109
|
...e,
|
|
104
110
|
parser: "scss"
|
|
105
|
-
}),
|
|
106
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
111
|
+
}), i = L(E, p, b);
|
|
112
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
107
113
|
return k([
|
|
108
114
|
"`",
|
|
109
|
-
|
|
110
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
115
|
+
a,
|
|
116
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [k(i)] : de([k(i)]),
|
|
111
117
|
u,
|
|
112
118
|
"`"
|
|
113
119
|
]);
|
|
114
|
-
const
|
|
120
|
+
const h = a.length ? ae : le, v = u.length ? ae : le;
|
|
115
121
|
return k([
|
|
116
122
|
"`",
|
|
117
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
118
|
-
|
|
123
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, k(i)] : de([h, k(i)]),
|
|
124
|
+
v,
|
|
119
125
|
"`"
|
|
120
126
|
]);
|
|
121
|
-
},
|
|
122
|
-
[
|
|
123
|
-
category: "
|
|
127
|
+
}, gt = "embeddedCss", nn = ["css"], rn = S(gt), on = {
|
|
128
|
+
[rn]: {
|
|
129
|
+
category: "Embed",
|
|
124
130
|
type: "string",
|
|
125
131
|
array: !0,
|
|
126
|
-
default: [{ value: [...
|
|
132
|
+
default: [{ value: [...nn] }],
|
|
127
133
|
description: "Specify embedded CSS language identifiers."
|
|
128
134
|
}
|
|
129
|
-
},
|
|
135
|
+
}, sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
130
136
|
__proto__: null,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
options:
|
|
134
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
137
|
+
embedder: tn,
|
|
138
|
+
language: gt,
|
|
139
|
+
options: on
|
|
140
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ue, group: N, indent: ge, softline: pe } = I, cn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
135
141
|
e = {
|
|
136
142
|
...e,
|
|
137
|
-
...
|
|
143
|
+
...s
|
|
138
144
|
};
|
|
139
|
-
const { node:
|
|
140
|
-
(
|
|
141
|
-
).join(""),
|
|
145
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
146
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
147
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
148
|
+
a.length,
|
|
149
|
+
-u.length || void 0
|
|
150
|
+
), b = x(r, n), E = await t(y, {
|
|
142
151
|
...e,
|
|
143
152
|
parser: e.embeddedEsParser ?? "babel"
|
|
144
|
-
}),
|
|
145
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
146
|
-
return
|
|
153
|
+
}), i = L(E, p, b);
|
|
154
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
155
|
+
return N([
|
|
147
156
|
"`",
|
|
148
|
-
|
|
149
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
157
|
+
a,
|
|
158
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [N(i)] : ge([N(i)]),
|
|
150
159
|
u,
|
|
151
160
|
"`"
|
|
152
161
|
]);
|
|
153
|
-
const
|
|
154
|
-
return
|
|
162
|
+
const h = a.length ? ue : pe, v = u.length ? ue : pe;
|
|
163
|
+
return N([
|
|
155
164
|
"`",
|
|
156
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
157
|
-
|
|
165
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, N(i)] : ge([h, N(i)]),
|
|
166
|
+
v,
|
|
158
167
|
"`"
|
|
159
168
|
]);
|
|
160
|
-
},
|
|
169
|
+
}, te = "embeddedEs", an = [
|
|
161
170
|
"js",
|
|
162
171
|
"jsx",
|
|
163
172
|
"es",
|
|
@@ -166,595 +175,937 @@ const { line: ee, group: k, indent: te, softline: ne } = I, pt = async (t, n, r,
|
|
|
166
175
|
"cjs",
|
|
167
176
|
"pac",
|
|
168
177
|
"javascript"
|
|
169
|
-
],
|
|
170
|
-
|
|
171
|
-
|
|
178
|
+
], dn = [
|
|
179
|
+
"babel",
|
|
180
|
+
"babel-flow",
|
|
181
|
+
"acorn",
|
|
182
|
+
"espree",
|
|
183
|
+
"flow",
|
|
184
|
+
"meriyah"
|
|
185
|
+
], ln = S(te), un = V(te), gn = {
|
|
186
|
+
[ln]: {
|
|
187
|
+
category: "Embed",
|
|
172
188
|
type: "string",
|
|
173
189
|
array: !0,
|
|
174
|
-
default: [{ value: [...
|
|
190
|
+
default: [{ value: [...an] }],
|
|
175
191
|
description: "Specify embedded ES language identifiers."
|
|
176
192
|
},
|
|
177
|
-
[
|
|
178
|
-
category: "
|
|
179
|
-
type: "
|
|
180
|
-
array: !1,
|
|
193
|
+
[un]: {
|
|
194
|
+
category: "Embed",
|
|
195
|
+
type: "choice",
|
|
181
196
|
default: "babel",
|
|
182
|
-
description:
|
|
197
|
+
description: 'Specify the embedded ES language parser. Default is "babel".',
|
|
198
|
+
choices: dn.map((t) => ({
|
|
199
|
+
value: t,
|
|
200
|
+
description: `Use "${t}".`
|
|
201
|
+
}))
|
|
183
202
|
}
|
|
184
|
-
},
|
|
203
|
+
}, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
185
204
|
__proto__: null,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
options:
|
|
189
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
190
|
-
|
|
205
|
+
embedder: cn,
|
|
206
|
+
language: te,
|
|
207
|
+
options: gn
|
|
208
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: me, group: A, indent: he, softline: fe } = I, mn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
209
|
+
M("prettier-plugin-glsl", e, o), e = {
|
|
191
210
|
...e,
|
|
192
|
-
...
|
|
211
|
+
...s
|
|
193
212
|
};
|
|
194
|
-
const { node:
|
|
195
|
-
(
|
|
196
|
-
).join(""),
|
|
197
|
-
|
|
213
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
214
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
215
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
216
|
+
a.length,
|
|
198
217
|
-u.length || void 0
|
|
199
|
-
), b =
|
|
218
|
+
), b = x(r, n), E = await t(y, {
|
|
200
219
|
...e,
|
|
201
220
|
parser: "glsl-parser"
|
|
202
|
-
}),
|
|
203
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
204
|
-
return
|
|
221
|
+
}), i = L(E, p, b);
|
|
222
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
223
|
+
return A([
|
|
205
224
|
"`",
|
|
206
|
-
|
|
207
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
225
|
+
a,
|
|
226
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [A(i)] : he([A(i)]),
|
|
208
227
|
u,
|
|
209
228
|
"`"
|
|
210
229
|
]);
|
|
211
|
-
const
|
|
212
|
-
return
|
|
230
|
+
const h = a.length ? me : fe, v = u.length ? me : fe;
|
|
231
|
+
return A([
|
|
213
232
|
"`",
|
|
214
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
215
|
-
|
|
233
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, A(i)] : he([h, A(i)]),
|
|
234
|
+
v,
|
|
216
235
|
"`"
|
|
217
236
|
]);
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"frag",
|
|
222
|
-
"frg",
|
|
223
|
-
"fs",
|
|
224
|
-
"fsh",
|
|
225
|
-
"fshader",
|
|
226
|
-
"geo",
|
|
227
|
-
"geom",
|
|
228
|
-
"glslf",
|
|
229
|
-
"glslv",
|
|
230
|
-
"gs",
|
|
231
|
-
"gshader",
|
|
232
|
-
"rchit",
|
|
233
|
-
"rmiss",
|
|
234
|
-
"shader",
|
|
235
|
-
"tesc",
|
|
236
|
-
"tese",
|
|
237
|
-
"vert",
|
|
238
|
-
"vrx",
|
|
239
|
-
"vsh",
|
|
240
|
-
"vshader"
|
|
241
|
-
], Lt = $(Re), kt = {
|
|
242
|
-
[Lt]: {
|
|
243
|
-
category: "Global",
|
|
237
|
+
}, pt = "embeddedGlsl", hn = ["glsl", "shader"], fn = S(pt), En = {
|
|
238
|
+
[fn]: {
|
|
239
|
+
category: "Embed",
|
|
244
240
|
type: "string",
|
|
245
241
|
array: !0,
|
|
246
|
-
default: [{ value: [...
|
|
242
|
+
default: [{ value: [...hn] }],
|
|
247
243
|
description: 'Specify embedded GLSL language identifiers. This requires "prettier-plugin-glsl".'
|
|
248
244
|
}
|
|
249
|
-
},
|
|
245
|
+
}, bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
246
|
+
__proto__: null,
|
|
247
|
+
embedder: mn,
|
|
248
|
+
language: pt,
|
|
249
|
+
options: En
|
|
250
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ee, group: P, indent: be, softline: ye } = I, yn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
251
|
+
e = {
|
|
252
|
+
...e,
|
|
253
|
+
...s
|
|
254
|
+
};
|
|
255
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
256
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
257
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
258
|
+
a.length,
|
|
259
|
+
-u.length || void 0
|
|
260
|
+
), b = x(r, n), E = await t(y, {
|
|
261
|
+
...e,
|
|
262
|
+
parser: "graphql"
|
|
263
|
+
}), i = L(E, p, b);
|
|
264
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
265
|
+
return P([
|
|
266
|
+
"`",
|
|
267
|
+
a,
|
|
268
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [P(i)] : be([P(i)]),
|
|
269
|
+
u,
|
|
270
|
+
"`"
|
|
271
|
+
]);
|
|
272
|
+
const h = a.length ? Ee : ye, v = u.length ? Ee : ye;
|
|
273
|
+
return P([
|
|
274
|
+
"`",
|
|
275
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, P(i)] : be([h, P(i)]),
|
|
276
|
+
v,
|
|
277
|
+
"`"
|
|
278
|
+
]);
|
|
279
|
+
}, mt = "embeddedGraphql", _n = ["graphql", "gql"], vn = S(mt), $n = {
|
|
280
|
+
[vn]: {
|
|
281
|
+
category: "Embed",
|
|
282
|
+
type: "string",
|
|
283
|
+
array: !0,
|
|
284
|
+
default: [{ value: [..._n] }],
|
|
285
|
+
description: "Specify embedded GraphQL language identifiers."
|
|
286
|
+
}
|
|
287
|
+
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
250
288
|
__proto__: null,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
options:
|
|
254
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
289
|
+
embedder: yn,
|
|
290
|
+
language: mt,
|
|
291
|
+
options: $n
|
|
292
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: _e, group: R, indent: ve, softline: $e } = I, { mapDoc: In } = X, Sn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
255
293
|
e = {
|
|
256
294
|
...e,
|
|
257
|
-
...
|
|
295
|
+
...s
|
|
258
296
|
};
|
|
259
|
-
const { node:
|
|
260
|
-
(
|
|
261
|
-
).join(""),
|
|
297
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
298
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
299
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
300
|
+
a.length,
|
|
301
|
+
-u.length || void 0
|
|
302
|
+
), b = x(r, n), E = await t(y, {
|
|
262
303
|
...e,
|
|
263
304
|
parser: "html"
|
|
264
|
-
}),
|
|
265
|
-
if (typeof
|
|
266
|
-
return
|
|
267
|
-
const g = [],
|
|
268
|
-
for (let
|
|
269
|
-
let _ =
|
|
270
|
-
if (
|
|
305
|
+
}), i = In(E, (m) => {
|
|
306
|
+
if (typeof m != "string")
|
|
307
|
+
return m;
|
|
308
|
+
const g = [], f = m.split(p);
|
|
309
|
+
for (let $ = 0; $ < f.length; $++) {
|
|
310
|
+
let _ = f[$];
|
|
311
|
+
if ($ % 2 == 0) {
|
|
271
312
|
if (!_)
|
|
272
313
|
continue;
|
|
273
314
|
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), e.__embeddedInHtml && (_ = _.replaceAll(/<\/(?=script\b)/gi, "<\\/")), g.push(_);
|
|
274
315
|
} else {
|
|
275
|
-
const
|
|
276
|
-
g.push(
|
|
316
|
+
const D = Number(_);
|
|
317
|
+
g.push(b[D]);
|
|
277
318
|
}
|
|
278
319
|
}
|
|
279
320
|
return g;
|
|
280
321
|
});
|
|
281
322
|
if (e.htmlWhitespaceSensitivity === "strict" || // TODO: is css mode should be included here?
|
|
282
|
-
e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
323
|
+
e.htmlWhitespaceSensitivity === "css" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
324
|
+
return R([
|
|
325
|
+
"`",
|
|
326
|
+
a,
|
|
327
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [R(i)] : ve([R(i)]),
|
|
328
|
+
u,
|
|
329
|
+
"`"
|
|
330
|
+
]);
|
|
331
|
+
const h = a.length ? _e : $e, v = u.length ? _e : $e;
|
|
332
|
+
return R([
|
|
333
|
+
"`",
|
|
334
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, R(i)] : ve([h, R(i)]),
|
|
335
|
+
v,
|
|
336
|
+
"`"
|
|
337
|
+
]);
|
|
338
|
+
}, ht = "embeddedHtml", xn = ["html", "xhtml"], Tn = S(ht), Ln = {
|
|
339
|
+
[Tn]: {
|
|
340
|
+
category: "Embed",
|
|
341
|
+
type: "string",
|
|
342
|
+
array: !0,
|
|
343
|
+
default: [{ value: [...xn] }],
|
|
344
|
+
description: "Specify embedded HTML language identifiers."
|
|
345
|
+
}
|
|
346
|
+
}, On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
347
|
+
__proto__: null,
|
|
348
|
+
embedder: Sn,
|
|
349
|
+
language: ht,
|
|
350
|
+
options: Ln
|
|
351
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: De, group: j, indent: Ie, softline: Se } = I, Mn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
352
|
+
M("prettier-plugin-ini", e, o), e = {
|
|
353
|
+
...e,
|
|
354
|
+
...s
|
|
355
|
+
};
|
|
356
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
357
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
358
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
359
|
+
a.length,
|
|
360
|
+
-u.length || void 0
|
|
361
|
+
), b = x(r, n), E = await t(y, {
|
|
362
|
+
...e,
|
|
363
|
+
parser: "ini"
|
|
364
|
+
}), i = L(E, p, b);
|
|
365
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
366
|
+
return j([
|
|
367
|
+
"`",
|
|
368
|
+
a,
|
|
369
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [j(i)] : Ie([j(i)]),
|
|
370
|
+
u,
|
|
371
|
+
"`"
|
|
372
|
+
]);
|
|
373
|
+
const h = a.length ? De : Se, v = u.length ? De : Se;
|
|
374
|
+
return j([
|
|
375
|
+
"`",
|
|
376
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, j(i)] : Ie([h, j(i)]),
|
|
377
|
+
v,
|
|
378
|
+
"`"
|
|
379
|
+
]);
|
|
380
|
+
}, ft = "embeddedIni", kn = ["ini", "cfg", "pro"], Nn = S(ft), An = {
|
|
381
|
+
[Nn]: {
|
|
382
|
+
category: "Embed",
|
|
383
|
+
type: "string",
|
|
384
|
+
array: !0,
|
|
385
|
+
default: [{ value: [...kn] }],
|
|
386
|
+
description: 'Specify embedded INI language identifiers. This requires "prettier-plugin-ini".'
|
|
387
|
+
}
|
|
388
|
+
}, Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
389
|
+
__proto__: null,
|
|
390
|
+
embedder: Mn,
|
|
391
|
+
language: ft,
|
|
392
|
+
options: An
|
|
393
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: xe, group: F, indent: Te, softline: Le } = I, Rn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
394
|
+
e = {
|
|
395
|
+
...e,
|
|
396
|
+
...s
|
|
397
|
+
};
|
|
398
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = jn(), c = l.quasis.map(
|
|
399
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
400
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
401
|
+
a.length,
|
|
402
|
+
-u.length || void 0
|
|
403
|
+
), b = x(r, n), E = await t(y, {
|
|
404
|
+
...e,
|
|
405
|
+
parser: e.embeddedJsonParser ?? "json"
|
|
406
|
+
}), i = L(E, p, b);
|
|
407
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
408
|
+
return F([
|
|
409
|
+
"`",
|
|
410
|
+
a,
|
|
411
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [F(i)] : Te([F(i)]),
|
|
412
|
+
u,
|
|
413
|
+
"`"
|
|
414
|
+
]);
|
|
415
|
+
const h = a.length ? xe : Le, v = u.length ? xe : Le;
|
|
416
|
+
return F([
|
|
417
|
+
"`",
|
|
418
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, F(i)] : Te([h, F(i)]),
|
|
419
|
+
v,
|
|
420
|
+
"`"
|
|
421
|
+
]);
|
|
422
|
+
};
|
|
423
|
+
function jn() {
|
|
424
|
+
const t = Y(), n = Y(), r = (o) => `'0${t}${o}${n}'`, e = new RegExp(`["']?0${t}(\\d+)${n}['"]?`, "g");
|
|
425
|
+
return {
|
|
426
|
+
createPlaceholder: r,
|
|
427
|
+
placeholderRegex: e
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
const ne = "embeddedJson", Fn = ["json", "jsonl"], wn = ["json", "json-stringify", "json5"], Bn = V(ne), Un = S(ne), Wn = {
|
|
431
|
+
[Un]: {
|
|
432
|
+
category: "Embed",
|
|
433
|
+
type: "string",
|
|
434
|
+
array: !0,
|
|
435
|
+
default: [{ value: [...Fn] }],
|
|
436
|
+
description: "Specify embedded JSON language identifiers."
|
|
437
|
+
},
|
|
438
|
+
[Bn]: {
|
|
439
|
+
category: "Embed",
|
|
440
|
+
type: "choice",
|
|
441
|
+
default: "json",
|
|
442
|
+
description: 'Specify the embedded JSON language parser. Default is "json".',
|
|
443
|
+
choices: wn.map((t) => ({
|
|
444
|
+
value: t,
|
|
445
|
+
description: `Use "${t}".`
|
|
446
|
+
}))
|
|
447
|
+
}
|
|
448
|
+
}, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
449
|
+
__proto__: null,
|
|
450
|
+
embedder: Rn,
|
|
451
|
+
language: ne,
|
|
452
|
+
options: Wn
|
|
453
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Oe, group: w, indent: Me, softline: ke } = I, Gn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
454
|
+
M("prettier-plugin-latex", e, o), e = {
|
|
455
|
+
...e,
|
|
456
|
+
...s
|
|
457
|
+
};
|
|
458
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
459
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
460
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
461
|
+
a.length,
|
|
462
|
+
-u.length || void 0
|
|
463
|
+
), b = x(r, n), E = await t(y, {
|
|
464
|
+
...e,
|
|
465
|
+
parser: "latex-parser"
|
|
466
|
+
}), i = L(E, p, b);
|
|
467
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
283
468
|
return w([
|
|
284
469
|
"`",
|
|
285
|
-
|
|
286
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
470
|
+
a,
|
|
471
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [w(i)] : Me([w(i)]),
|
|
287
472
|
u,
|
|
288
473
|
"`"
|
|
289
474
|
]);
|
|
290
|
-
const
|
|
475
|
+
const h = a.length ? Oe : ke, v = u.length ? Oe : ke;
|
|
291
476
|
return w([
|
|
292
477
|
"`",
|
|
293
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
294
|
-
|
|
478
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, w(i)] : Me([h, w(i)]),
|
|
479
|
+
v,
|
|
295
480
|
"`"
|
|
296
481
|
]);
|
|
297
|
-
},
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
301
|
-
"
|
|
302
|
-
"
|
|
303
|
-
"
|
|
304
|
-
"
|
|
305
|
-
"
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
"rhtml"
|
|
310
|
-
], Mt = $(Ne), Rt = {
|
|
311
|
-
[Mt]: {
|
|
312
|
-
category: "Global",
|
|
482
|
+
}, Et = "embeddedLatex", qn = [
|
|
483
|
+
"latex",
|
|
484
|
+
"tex",
|
|
485
|
+
"aux",
|
|
486
|
+
"cls",
|
|
487
|
+
"bbl",
|
|
488
|
+
"bib",
|
|
489
|
+
"toc",
|
|
490
|
+
"sty"
|
|
491
|
+
], zn = S(Et), Kn = {
|
|
492
|
+
[zn]: {
|
|
493
|
+
category: "Embed",
|
|
313
494
|
type: "string",
|
|
314
495
|
array: !0,
|
|
315
|
-
default: [{ value: [...
|
|
316
|
-
description:
|
|
496
|
+
default: [{ value: [...qn] }],
|
|
497
|
+
description: 'Specify embedded LaTeX language identifiers. This requires "prettier-plugin-latex".'
|
|
317
498
|
}
|
|
318
|
-
},
|
|
499
|
+
}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
319
500
|
__proto__: null,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
options:
|
|
323
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
501
|
+
embedder: Gn,
|
|
502
|
+
language: Et,
|
|
503
|
+
options: Kn
|
|
504
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ne, group: B, indent: Ae, softline: Pe } = I, Jn = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
324
505
|
e = {
|
|
325
506
|
...e,
|
|
326
|
-
...
|
|
507
|
+
...s
|
|
327
508
|
};
|
|
328
|
-
const { node:
|
|
329
|
-
(
|
|
330
|
-
).join(""),
|
|
509
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
510
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
511
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
512
|
+
a.length,
|
|
513
|
+
-u.length || void 0
|
|
514
|
+
), b = x(r, n), E = await t(y, {
|
|
331
515
|
...e,
|
|
332
516
|
parser: "markdown",
|
|
333
517
|
__inJsTemplate: !0
|
|
334
|
-
}),
|
|
335
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
336
|
-
return
|
|
518
|
+
}), i = L(E, p, b);
|
|
519
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
520
|
+
return B([
|
|
337
521
|
"`",
|
|
338
|
-
|
|
339
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
522
|
+
a,
|
|
523
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [B(i)] : Ae([B(i)]),
|
|
340
524
|
u,
|
|
341
525
|
"`"
|
|
342
526
|
]);
|
|
343
|
-
const
|
|
344
|
-
return
|
|
527
|
+
const h = a.length ? Ne : Pe, v = u.length ? Ne : Pe;
|
|
528
|
+
return B([
|
|
345
529
|
"`",
|
|
346
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
347
|
-
|
|
530
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, B(i)] : Ae([h, B(i)]),
|
|
531
|
+
v,
|
|
348
532
|
"`"
|
|
349
533
|
]);
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"markdown",
|
|
354
|
-
"mdown",
|
|
355
|
-
"mdwn",
|
|
356
|
-
"mkd",
|
|
357
|
-
"mkdn",
|
|
358
|
-
"mkdown",
|
|
359
|
-
"ronn",
|
|
360
|
-
"scd",
|
|
361
|
-
"workbook"
|
|
362
|
-
], jt = $(Fe), At = {
|
|
363
|
-
[jt]: {
|
|
364
|
-
category: "Global",
|
|
534
|
+
}, bt = "embeddedMarkdown", Xn = ["md", "markdown"], Yn = S(bt), Qn = {
|
|
535
|
+
[Yn]: {
|
|
536
|
+
category: "Embed",
|
|
365
537
|
type: "string",
|
|
366
538
|
array: !0,
|
|
367
|
-
default: [{ value: [...
|
|
539
|
+
default: [{ value: [...Xn] }],
|
|
368
540
|
description: "Specify embedded Markdown language identifiers."
|
|
369
541
|
}
|
|
370
|
-
},
|
|
542
|
+
}, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
371
543
|
__proto__: null,
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
options:
|
|
375
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
376
|
-
[
|
|
377
|
-
category: "
|
|
544
|
+
embedder: Jn,
|
|
545
|
+
language: bt,
|
|
546
|
+
options: Qn
|
|
547
|
+
}, Symbol.toStringTag, { value: "Module" })), re = "embeddedNoop", Zn = S(re), er = {
|
|
548
|
+
[Zn]: {
|
|
549
|
+
category: "Embed",
|
|
378
550
|
type: "string",
|
|
379
551
|
array: !0,
|
|
380
552
|
default: [{ value: [] }],
|
|
381
553
|
description: "Specify embedded language identifiers that will not be formatted."
|
|
382
554
|
}
|
|
383
|
-
},
|
|
555
|
+
}, tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
384
556
|
__proto__: null,
|
|
385
|
-
|
|
386
|
-
options:
|
|
387
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
388
|
-
|
|
557
|
+
language: re,
|
|
558
|
+
options: er
|
|
559
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Re, group: U, indent: je, softline: Fe } = I, nr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
560
|
+
M("@prettier/plugin-php", e, o), e = {
|
|
389
561
|
...e,
|
|
390
|
-
...
|
|
562
|
+
...s
|
|
391
563
|
};
|
|
392
|
-
const { node:
|
|
393
|
-
(
|
|
394
|
-
).join(""),
|
|
395
|
-
|
|
564
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T("$p"), c = l.quasis.map(
|
|
565
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
566
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
567
|
+
a.length,
|
|
396
568
|
-u.length || void 0
|
|
397
|
-
), b =
|
|
569
|
+
), b = x(r, n), E = await t(y, {
|
|
398
570
|
...e,
|
|
399
571
|
parser: "php"
|
|
400
|
-
}),
|
|
401
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
402
|
-
return
|
|
572
|
+
}), i = L(E, p, b);
|
|
573
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
574
|
+
return U([
|
|
403
575
|
"`",
|
|
404
|
-
|
|
405
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
576
|
+
a,
|
|
577
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [U(i)] : je([U(i)]),
|
|
406
578
|
u,
|
|
407
579
|
"`"
|
|
408
580
|
]);
|
|
409
|
-
const
|
|
410
|
-
return
|
|
581
|
+
const h = a.length ? Re : Fe, v = u.length ? Re : Fe;
|
|
582
|
+
return U([
|
|
411
583
|
"`",
|
|
412
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
413
|
-
|
|
584
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, U(i)] : je([h, U(i)]),
|
|
585
|
+
v,
|
|
414
586
|
"`"
|
|
415
587
|
]);
|
|
416
|
-
},
|
|
417
|
-
[
|
|
418
|
-
category: "
|
|
588
|
+
}, yt = "embeddedPhp", rr = ["php", "php5"], or = S(yt), sr = {
|
|
589
|
+
[or]: {
|
|
590
|
+
category: "Embed",
|
|
419
591
|
type: "string",
|
|
420
592
|
array: !0,
|
|
421
|
-
default: [{ value: [...
|
|
593
|
+
default: [{ value: [...rr] }],
|
|
422
594
|
description: 'Specify embedded PHP language identifiers. This requires "@prettier/plugin-php".'
|
|
423
595
|
}
|
|
424
|
-
},
|
|
596
|
+
}, ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
425
597
|
__proto__: null,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
options:
|
|
429
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
430
|
-
"
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
"
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
]
|
|
460
|
-
|
|
461
|
-
category: "Global",
|
|
598
|
+
embedder: nr,
|
|
599
|
+
language: yt,
|
|
600
|
+
options: sr
|
|
601
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: we, group: W, indent: Be, softline: Ue } = I, cr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
602
|
+
M("prettier-plugin-properties", e, o), e = {
|
|
603
|
+
...e,
|
|
604
|
+
...s
|
|
605
|
+
};
|
|
606
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
607
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
608
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
609
|
+
a.length,
|
|
610
|
+
-u.length || void 0
|
|
611
|
+
), b = x(r, n), E = await t(y, {
|
|
612
|
+
...e,
|
|
613
|
+
parser: "dot-properties"
|
|
614
|
+
}), i = L(E, p, b);
|
|
615
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
616
|
+
return W([
|
|
617
|
+
"`",
|
|
618
|
+
a,
|
|
619
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [W(i)] : Be([W(i)]),
|
|
620
|
+
u,
|
|
621
|
+
"`"
|
|
622
|
+
]);
|
|
623
|
+
const h = a.length ? we : Ue, v = u.length ? we : Ue;
|
|
624
|
+
return W([
|
|
625
|
+
"`",
|
|
626
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, W(i)] : Be([h, W(i)]),
|
|
627
|
+
v,
|
|
628
|
+
"`"
|
|
629
|
+
]);
|
|
630
|
+
}, _t = "embeddedProperties", ar = ["properties"], dr = S(_t), lr = {
|
|
631
|
+
[dr]: {
|
|
632
|
+
category: "Embed",
|
|
462
633
|
type: "string",
|
|
463
634
|
array: !0,
|
|
464
|
-
default: [{ value: [...
|
|
635
|
+
default: [{ value: [...ar] }],
|
|
636
|
+
description: 'Specify embedded Java Properties language identifiers. This requires "prettier-plugin-properties".'
|
|
637
|
+
}
|
|
638
|
+
}, ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
639
|
+
__proto__: null,
|
|
640
|
+
embedder: cr,
|
|
641
|
+
language: _t,
|
|
642
|
+
options: lr
|
|
643
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: We, group: C, indent: Ce, softline: Ge } = I, gr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
644
|
+
M("@prettier/plugin-ruby", e, o), e = {
|
|
645
|
+
...e,
|
|
646
|
+
...s
|
|
647
|
+
};
|
|
648
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
649
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
650
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
651
|
+
a.length,
|
|
652
|
+
-u.length || void 0
|
|
653
|
+
), b = x(r, n), E = await t(y, {
|
|
654
|
+
...e,
|
|
655
|
+
parser: e.embeddedRubyParser ?? "ruby"
|
|
656
|
+
}), i = L(E, p, b);
|
|
657
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
658
|
+
return C([
|
|
659
|
+
"`",
|
|
660
|
+
a,
|
|
661
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [C(i)] : Ce([C(i)]),
|
|
662
|
+
u,
|
|
663
|
+
"`"
|
|
664
|
+
]);
|
|
665
|
+
const h = a.length ? We : Ge, v = u.length ? We : Ge;
|
|
666
|
+
return C([
|
|
667
|
+
"`",
|
|
668
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, C(i)] : Ce([h, C(i)]),
|
|
669
|
+
v,
|
|
670
|
+
"`"
|
|
671
|
+
]);
|
|
672
|
+
}, vt = "embeddedRuby", pr = ["ruby"], mr = ["ruby", "rbs", "haml"], hr = "embeddedRubyParser", fr = S(vt), Er = {
|
|
673
|
+
[fr]: {
|
|
674
|
+
category: "Embed",
|
|
675
|
+
type: "string",
|
|
676
|
+
array: !0,
|
|
677
|
+
default: [{ value: [...pr] }],
|
|
465
678
|
description: 'Specify embedded Ruby language identifiers. This requires "@prettier/plugin-ruby".'
|
|
466
679
|
},
|
|
467
|
-
[
|
|
468
|
-
category: "
|
|
469
|
-
type: "
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
680
|
+
[hr]: {
|
|
681
|
+
category: "Embed",
|
|
682
|
+
type: "choice",
|
|
683
|
+
default: "ruby",
|
|
684
|
+
description: 'Specify the embedded Ruby language parser. Default is "ruby".',
|
|
685
|
+
choices: mr.map((t) => ({
|
|
686
|
+
value: t,
|
|
687
|
+
description: `Use "${t}".`
|
|
688
|
+
}))
|
|
473
689
|
}
|
|
474
|
-
},
|
|
475
|
-
|
|
690
|
+
}, br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
691
|
+
__proto__: null,
|
|
692
|
+
embedder: gr,
|
|
693
|
+
language: vt,
|
|
694
|
+
options: Er
|
|
695
|
+
}, Symbol.toStringTag, { value: "Module" })), { hardline: yr, group: G, line: qe, softline: ze, indent: Ke } = I, { mapDoc: _r } = X, vr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
696
|
+
e = {
|
|
476
697
|
...e,
|
|
477
|
-
...
|
|
698
|
+
...s
|
|
478
699
|
};
|
|
479
|
-
const { node:
|
|
480
|
-
(
|
|
481
|
-
).join(""),
|
|
482
|
-
|
|
483
|
-
-
|
|
484
|
-
),
|
|
700
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
701
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
702
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
703
|
+
a.length,
|
|
704
|
+
-u.length || void 0
|
|
705
|
+
), b = x(r, n), E = await t(y, {
|
|
485
706
|
...e,
|
|
486
|
-
parser:
|
|
487
|
-
}),
|
|
488
|
-
|
|
489
|
-
|
|
707
|
+
parser: "sh"
|
|
708
|
+
}), i = _r(E, (m) => {
|
|
709
|
+
if (typeof m != "string")
|
|
710
|
+
return m;
|
|
711
|
+
const g = [], f = m.split(p);
|
|
712
|
+
for (let $ = 0; $ < f.length; $++) {
|
|
713
|
+
let _ = f[$];
|
|
714
|
+
if ($ % 2 == 0) {
|
|
715
|
+
if (!_)
|
|
716
|
+
continue;
|
|
717
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((D) => D === `
|
|
718
|
+
` ? g.push(yr) : g.push(D));
|
|
719
|
+
} else {
|
|
720
|
+
const D = Number(_);
|
|
721
|
+
g.push(b[D]);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return g;
|
|
725
|
+
});
|
|
726
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
727
|
+
return G([
|
|
490
728
|
"`",
|
|
729
|
+
a,
|
|
730
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [G(i)] : Ke([G(i)]),
|
|
491
731
|
u,
|
|
492
|
-
e.noEmbeddedMultiLineIndentation?.includes(s) ? [R(f)] : ve([R(f)]),
|
|
493
|
-
v,
|
|
494
732
|
"`"
|
|
495
733
|
]);
|
|
496
|
-
const
|
|
497
|
-
return
|
|
734
|
+
const h = a.length ? qe : ze, v = u.length ? qe : ze;
|
|
735
|
+
return G([
|
|
498
736
|
"`",
|
|
499
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
500
|
-
|
|
737
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, G(i)] : Ke([h, G(i)]),
|
|
738
|
+
v,
|
|
501
739
|
"`"
|
|
502
740
|
]);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
741
|
+
}, $t = "embeddedSh", $r = ["sh"], Dr = S($t), Ir = {
|
|
742
|
+
[Dr]: {
|
|
743
|
+
category: "Embed",
|
|
744
|
+
type: "string",
|
|
745
|
+
array: !0,
|
|
746
|
+
default: [{ value: [...$r] }],
|
|
747
|
+
description: "Specify embedded Shell language identifiers."
|
|
748
|
+
}
|
|
749
|
+
}, Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
750
|
+
__proto__: null,
|
|
751
|
+
embedder: vr,
|
|
752
|
+
language: $t,
|
|
753
|
+
options: Ir
|
|
754
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
755
|
+
function He(t, n) {
|
|
756
|
+
var r = Object.keys(t);
|
|
757
|
+
if (Object.getOwnPropertySymbols) {
|
|
758
|
+
var e = Object.getOwnPropertySymbols(t);
|
|
759
|
+
n && (e = e.filter(function(o) {
|
|
760
|
+
return Object.getOwnPropertyDescriptor(t, o).enumerable;
|
|
761
|
+
})), r.push.apply(r, e);
|
|
515
762
|
}
|
|
516
|
-
|
|
763
|
+
return r;
|
|
517
764
|
}
|
|
518
|
-
function
|
|
519
|
-
|
|
765
|
+
function Je(t) {
|
|
766
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
767
|
+
var r = arguments[n] != null ? arguments[n] : {};
|
|
768
|
+
n % 2 ? He(Object(r), !0).forEach(function(e) {
|
|
769
|
+
xr(t, e, r[e]);
|
|
770
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : He(Object(r)).forEach(function(e) {
|
|
771
|
+
Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e));
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
return t;
|
|
520
775
|
}
|
|
521
|
-
function
|
|
522
|
-
return
|
|
776
|
+
function xr(t, n, r) {
|
|
777
|
+
return n = Tr(n), n in t ? Object.defineProperty(t, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[n] = r, t;
|
|
523
778
|
}
|
|
524
|
-
function
|
|
525
|
-
|
|
779
|
+
function Tr(t) {
|
|
780
|
+
var n = Lr(t, "string");
|
|
781
|
+
return typeof n == "symbol" ? n : String(n);
|
|
526
782
|
}
|
|
527
|
-
|
|
783
|
+
function Lr(t, n) {
|
|
784
|
+
if (typeof t != "object" || t === null)
|
|
785
|
+
return t;
|
|
786
|
+
var r = t[Symbol.toPrimitive];
|
|
787
|
+
if (r !== void 0) {
|
|
788
|
+
var e = r.call(t, n || "default");
|
|
789
|
+
if (typeof e != "object")
|
|
790
|
+
return e;
|
|
791
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
792
|
+
}
|
|
793
|
+
return (n === "string" ? String : Number)(t);
|
|
794
|
+
}
|
|
795
|
+
const Or = Dt({});
|
|
796
|
+
function Dt(t) {
|
|
797
|
+
return n.withOptions = (r) => Dt(Je(Je({}, t), r)), n;
|
|
798
|
+
function n(r, ...e) {
|
|
799
|
+
const o = typeof r == "string" ? [r] : r.raw, {
|
|
800
|
+
escapeSpecialCharacters: s = Array.isArray(r)
|
|
801
|
+
} = t;
|
|
802
|
+
let l = "";
|
|
803
|
+
for (let c = 0; c < o.length; c++) {
|
|
804
|
+
let a = o[c];
|
|
805
|
+
s && (a = a.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{")), l += a, c < e.length && (l += e[c]);
|
|
806
|
+
}
|
|
807
|
+
const d = l.split(`
|
|
808
|
+
`);
|
|
809
|
+
let p = null;
|
|
810
|
+
for (const c of d) {
|
|
811
|
+
const a = c.match(/^(\s+)\S+/);
|
|
812
|
+
if (a) {
|
|
813
|
+
const u = a[1].length;
|
|
814
|
+
p ? p = Math.min(p, u) : p = u;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (p !== null) {
|
|
818
|
+
const c = p;
|
|
819
|
+
l = d.map((a) => a[0] === " " || a[0] === " " ? a.slice(c) : a).join(`
|
|
820
|
+
`);
|
|
821
|
+
}
|
|
822
|
+
return l.trim().replace(/\\n/g, `
|
|
823
|
+
`);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
const { hardline: Mr, group: q, line: Xe, softline: Ye, indent: Qe } = I, { mapDoc: kr } = X, Nr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
827
|
+
e = {
|
|
828
|
+
...e,
|
|
829
|
+
...s
|
|
830
|
+
};
|
|
831
|
+
const l = e.embeddedSqlPlugin ?? "prettier-plugin-sql";
|
|
832
|
+
M(l, e, o);
|
|
833
|
+
const { node: d } = r, { createPlaceholder: p, placeholderRegex: c } = T(), a = d.quasis.map(
|
|
834
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + p(g)
|
|
835
|
+
).join(""), u = a.match(/^\s+/)?.[0] ?? "", y = a.match(/\s+$/)?.[0] ?? "", b = a.slice(
|
|
836
|
+
u.length,
|
|
837
|
+
-y.length || void 0
|
|
838
|
+
), E = x(r, n);
|
|
839
|
+
let i;
|
|
840
|
+
if (l === "prettier-plugin-sql-cst") {
|
|
841
|
+
const m = await t(b, {
|
|
842
|
+
...e,
|
|
843
|
+
parser: e.embeddedSqlParser ?? "sqlite"
|
|
844
|
+
});
|
|
845
|
+
i = L(m, c, E);
|
|
846
|
+
} else {
|
|
847
|
+
const m = await t(Or(b), {
|
|
848
|
+
...e,
|
|
849
|
+
parser: "sql"
|
|
850
|
+
});
|
|
851
|
+
i = kr(m, (g) => {
|
|
852
|
+
if (typeof g != "string")
|
|
853
|
+
return g;
|
|
854
|
+
const f = [], $ = g.split(c);
|
|
855
|
+
for (let _ = 0; _ < $.length; _++) {
|
|
856
|
+
let D = $[_];
|
|
857
|
+
if (_ % 2 == 0) {
|
|
858
|
+
if (!D)
|
|
859
|
+
continue;
|
|
860
|
+
D = D.replaceAll(/([\\`]|\${)/g, "\\$1"), D.split(/(\n)/).forEach(
|
|
861
|
+
(O) => O === `
|
|
862
|
+
` ? f.push(Mr) : f.push(O)
|
|
863
|
+
);
|
|
864
|
+
} else {
|
|
865
|
+
const O = Number(D);
|
|
866
|
+
f.push(E[O]);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return f;
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
873
|
+
return q([
|
|
874
|
+
"`",
|
|
875
|
+
u,
|
|
876
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [q(i)] : Qe([q(i)]),
|
|
877
|
+
y,
|
|
878
|
+
"`"
|
|
879
|
+
]);
|
|
880
|
+
const h = u.length ? Xe : Ye, v = y.length ? Xe : Ye;
|
|
881
|
+
return q([
|
|
882
|
+
"`",
|
|
883
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, q(i)] : Qe([h, q(i)]),
|
|
884
|
+
v,
|
|
885
|
+
"`"
|
|
886
|
+
]);
|
|
887
|
+
}, Z = "embeddedSql", Ar = ["sql"], Pr = S(Z), Rr = en(Z), jr = V(Z), Fr = {
|
|
888
|
+
[Pr]: {
|
|
889
|
+
category: "Embed",
|
|
890
|
+
type: "string",
|
|
891
|
+
array: !0,
|
|
892
|
+
default: [{ value: [...Ar] }],
|
|
893
|
+
description: 'Specify embedded SQL language identifiers. This requires "prettier-plugin-sql" or "prettier-plugin-sql-cst".'
|
|
894
|
+
},
|
|
895
|
+
[Rr]: {
|
|
896
|
+
category: "Embed",
|
|
897
|
+
type: "choice",
|
|
898
|
+
default: "prettier-plugin-sql",
|
|
899
|
+
description: 'Specify the Prettier plugin for parsing and formatting SQL. Default is "prettier-plugin-sql"',
|
|
900
|
+
choices: [
|
|
901
|
+
{
|
|
902
|
+
value: "prettier-plugin-sql",
|
|
903
|
+
description: 'Use "prettier-plugin-sql".'
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
value: "prettier-plugin-sql-cst",
|
|
907
|
+
description: 'Use "prettier-plugin-sql-cst".'
|
|
908
|
+
}
|
|
909
|
+
]
|
|
910
|
+
},
|
|
911
|
+
[jr]: {
|
|
912
|
+
category: "Embed",
|
|
913
|
+
type: "choice",
|
|
914
|
+
default: "sqlite",
|
|
915
|
+
description: 'Specify the embedded SQL language parser. Default is "sqlite". This option is only for "prettier-plugin-sql-cst".',
|
|
916
|
+
choices: [
|
|
917
|
+
{
|
|
918
|
+
value: "sqlite",
|
|
919
|
+
description: "SQLite parser."
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
value: "bigquery",
|
|
923
|
+
description: "BigQuery parser."
|
|
924
|
+
}
|
|
925
|
+
]
|
|
926
|
+
}
|
|
927
|
+
}, wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
528
928
|
__proto__: null,
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
options: Qt
|
|
535
|
-
}, Symbol.toStringTag, { value: "Module" })), Ae = "embeddedSql", { hardline: on, group: N, line: _e, softline: xe, indent: Ie } = I, { mapDoc: an } = q, dn = async (t, n, r, e, { identifier: s, embeddedOverrideOptions: o }) => {
|
|
536
|
-
A("prettier-plugin-sql", e, s), e = {
|
|
929
|
+
embedder: Nr,
|
|
930
|
+
language: Z,
|
|
931
|
+
options: Fr
|
|
932
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: Ve, group: z, indent: Ze, softline: et, hardline: Br } = I, { mapDoc: Ur } = X, Wr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
933
|
+
M("prettier-plugin-toml", e, o), e = {
|
|
537
934
|
...e,
|
|
538
|
-
...
|
|
935
|
+
...s
|
|
539
936
|
};
|
|
540
|
-
const { node:
|
|
541
|
-
(
|
|
542
|
-
).join(""),
|
|
937
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
938
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
939
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
940
|
+
a.length,
|
|
941
|
+
-u.length || void 0
|
|
942
|
+
), b = x(r, n), E = await t(y, {
|
|
543
943
|
...e,
|
|
544
|
-
parser: "
|
|
545
|
-
}),
|
|
546
|
-
if (typeof
|
|
547
|
-
return
|
|
548
|
-
const g = [],
|
|
549
|
-
for (let
|
|
550
|
-
let _ =
|
|
551
|
-
if (
|
|
944
|
+
parser: "toml"
|
|
945
|
+
}), i = Ur(E, (m) => {
|
|
946
|
+
if (typeof m != "string")
|
|
947
|
+
return m;
|
|
948
|
+
const g = [], f = m.split(p);
|
|
949
|
+
for (let $ = 0; $ < f.length; $++) {
|
|
950
|
+
let _ = f[$];
|
|
951
|
+
if ($ % 2 == 0) {
|
|
552
952
|
if (!_)
|
|
553
953
|
continue;
|
|
554
|
-
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((
|
|
555
|
-
` ? g.push(
|
|
954
|
+
_ = _.replaceAll(/([\\`]|\${)/g, "\\$1"), _.split(/(\n)/).forEach((D) => D === `
|
|
955
|
+
` ? g.push(Br) : g.push(D));
|
|
556
956
|
} else {
|
|
557
|
-
const
|
|
558
|
-
g.push(
|
|
957
|
+
const D = Number(_);
|
|
958
|
+
g.push(b[D]);
|
|
559
959
|
}
|
|
560
960
|
}
|
|
561
961
|
return g;
|
|
562
962
|
});
|
|
563
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
564
|
-
return
|
|
963
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
964
|
+
return z([
|
|
565
965
|
"`",
|
|
566
|
-
|
|
567
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
966
|
+
a,
|
|
967
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [z(i)] : Ze([z(i)]),
|
|
568
968
|
u,
|
|
569
969
|
"`"
|
|
570
970
|
]);
|
|
571
|
-
const
|
|
572
|
-
return
|
|
971
|
+
const h = a.length ? Ve : et, v = u.length ? Ve : et;
|
|
972
|
+
return z([
|
|
573
973
|
"`",
|
|
574
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
575
|
-
|
|
974
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, z(i)] : Ze([h, z(i)]),
|
|
975
|
+
v,
|
|
576
976
|
"`"
|
|
577
977
|
]);
|
|
578
|
-
},
|
|
579
|
-
[
|
|
580
|
-
category: "
|
|
978
|
+
}, It = "embeddedToml", Cr = ["toml"], Gr = S(It), qr = {
|
|
979
|
+
[Gr]: {
|
|
980
|
+
category: "Embed",
|
|
581
981
|
type: "string",
|
|
582
982
|
array: !0,
|
|
583
|
-
default: [{ value: [...
|
|
584
|
-
description: 'Specify embedded
|
|
983
|
+
default: [{ value: [...Cr] }],
|
|
984
|
+
description: 'Specify embedded TOML language identifiers. This requires "prettier-plugin-toml".'
|
|
585
985
|
}
|
|
586
|
-
},
|
|
986
|
+
}, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
587
987
|
__proto__: null,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
options:
|
|
591
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
988
|
+
embedder: Wr,
|
|
989
|
+
language: It,
|
|
990
|
+
options: qr
|
|
991
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: tt, group: K, indent: nt, softline: rt } = I, Kr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
592
992
|
e = {
|
|
593
993
|
...e,
|
|
594
|
-
...
|
|
994
|
+
...s
|
|
595
995
|
};
|
|
596
|
-
const { node:
|
|
597
|
-
(
|
|
598
|
-
).join(""),
|
|
996
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
997
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
998
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
999
|
+
a.length,
|
|
1000
|
+
-u.length || void 0
|
|
1001
|
+
), b = x(r, n), E = await t(y, {
|
|
599
1002
|
...e,
|
|
600
1003
|
parser: e.embeddedTsParser ?? "typescript",
|
|
601
1004
|
// set filepath to undefined to enable jsx auto detection:
|
|
602
1005
|
// https://github.com/prettier/prettier/blob/427a84d24203e2d54160cde153a1e6a6390fe65a/src/language-js/parse/typescript.js#L49-L53
|
|
603
1006
|
filepath: void 0
|
|
604
|
-
}),
|
|
605
|
-
if (e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
606
|
-
return
|
|
1007
|
+
}), i = L(E, p, b);
|
|
1008
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1009
|
+
return K([
|
|
607
1010
|
"`",
|
|
608
|
-
|
|
609
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
1011
|
+
a,
|
|
1012
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [K(i)] : nt([K(i)]),
|
|
610
1013
|
u,
|
|
611
1014
|
"`"
|
|
612
1015
|
]);
|
|
613
|
-
const
|
|
614
|
-
return
|
|
1016
|
+
const h = a.length ? tt : rt, v = u.length ? tt : rt;
|
|
1017
|
+
return K([
|
|
615
1018
|
"`",
|
|
616
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
617
|
-
|
|
1019
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, K(i)] : nt([h, K(i)]),
|
|
1020
|
+
v,
|
|
618
1021
|
"`"
|
|
619
1022
|
]);
|
|
620
|
-
},
|
|
621
|
-
[
|
|
622
|
-
category: "
|
|
1023
|
+
}, oe = "embeddedTs", Hr = ["ts", "tsx", "cts", "mts", "typescript"], Jr = ["typescript", "babel-ts"], Xr = V(oe), Yr = S(oe), Qr = {
|
|
1024
|
+
[Yr]: {
|
|
1025
|
+
category: "Embed",
|
|
623
1026
|
type: "string",
|
|
624
1027
|
array: !0,
|
|
625
|
-
default: [{ value: [...
|
|
1028
|
+
default: [{ value: [...Hr] }],
|
|
626
1029
|
description: "Specify embedded TS language parsers."
|
|
627
1030
|
},
|
|
628
|
-
[
|
|
629
|
-
category: "
|
|
630
|
-
type: "
|
|
631
|
-
array: !1,
|
|
1031
|
+
[Xr]: {
|
|
1032
|
+
category: "Embed",
|
|
1033
|
+
type: "choice",
|
|
632
1034
|
default: "typescript",
|
|
633
|
-
description:
|
|
1035
|
+
description: 'Specify the embedded TS language parser. Default is "typescript".',
|
|
1036
|
+
choices: Jr.map((t) => ({
|
|
1037
|
+
value: t,
|
|
1038
|
+
description: `Use "${t}".`
|
|
1039
|
+
}))
|
|
634
1040
|
}
|
|
635
|
-
},
|
|
1041
|
+
}, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
636
1042
|
__proto__: null,
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
options:
|
|
640
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
641
|
-
|
|
1043
|
+
embedder: Kr,
|
|
1044
|
+
language: oe,
|
|
1045
|
+
options: Qr
|
|
1046
|
+
}, Symbol.toStringTag, { value: "Module" })), se = "embeddedXml", { line: ot, group: H, indent: st, softline: ee } = I, Zr = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
1047
|
+
M("@prettier/plugin-xml", e, o), e = {
|
|
642
1048
|
...e,
|
|
643
|
-
...
|
|
1049
|
+
...s
|
|
644
1050
|
};
|
|
645
|
-
const { node:
|
|
646
|
-
(
|
|
647
|
-
).join(""),
|
|
648
|
-
|
|
1051
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
1052
|
+
(g, f, { length: $ }) => f === $ - 1 ? g.value.cooked : g.value.cooked + d(f)
|
|
1053
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
1054
|
+
a.length,
|
|
649
1055
|
-u.length || void 0
|
|
650
|
-
), b =
|
|
651
|
-
let
|
|
652
|
-
for (;
|
|
653
|
-
const
|
|
654
|
-
if (
|
|
1056
|
+
), b = x(r, n), E = [];
|
|
1057
|
+
let i = 0;
|
|
1058
|
+
for (; i !== void 0; ) {
|
|
1059
|
+
const g = y.slice(i);
|
|
1060
|
+
if (g.length === 0)
|
|
655
1061
|
break;
|
|
656
|
-
|
|
1062
|
+
i > 0 && e.xmlWhitespaceSensitivity !== "strict" && E.push(ee), e.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
657
1063
|
0,
|
|
658
1064
|
e.__embeddedXmlFragmentRecoverIndex.length
|
|
659
1065
|
);
|
|
660
|
-
let
|
|
1066
|
+
let f = await t(g, {
|
|
661
1067
|
...e,
|
|
662
|
-
parser:
|
|
1068
|
+
parser: se
|
|
663
1069
|
});
|
|
664
|
-
const [_
|
|
665
|
-
|
|
1070
|
+
const [$, _] = e.__embeddedXmlFragmentRecoverIndex ?? [];
|
|
1071
|
+
$ === void 0 ? i = void 0 : _ === void 0 ? i += $ : (f = g.slice($, _ + 1), i += _ + 1), E.push(f);
|
|
666
1072
|
}
|
|
667
|
-
const
|
|
668
|
-
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(
|
|
669
|
-
return
|
|
1073
|
+
const h = L(E, p, b);
|
|
1074
|
+
if (e.xmlWhitespaceSensitivity === "strict" || e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1075
|
+
return H([
|
|
670
1076
|
"`",
|
|
671
|
-
|
|
672
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
1077
|
+
a,
|
|
1078
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [H(h)] : st([H(h)]),
|
|
673
1079
|
u,
|
|
674
1080
|
"`"
|
|
675
1081
|
]);
|
|
676
|
-
const
|
|
677
|
-
return
|
|
1082
|
+
const v = a.length ? ot : ee, m = u.length ? ot : ee;
|
|
1083
|
+
return H([
|
|
678
1084
|
"`",
|
|
679
|
-
e.noEmbeddedMultiLineIndentation?.includes(
|
|
680
|
-
|
|
1085
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [v, H(h)] : st([v, H(h)]),
|
|
1086
|
+
m,
|
|
681
1087
|
"`"
|
|
682
1088
|
]);
|
|
683
|
-
},
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
"ascx",
|
|
687
|
-
"atom",
|
|
688
|
-
"axml",
|
|
689
|
-
"axaml",
|
|
690
|
-
"bpmn",
|
|
691
|
-
"cpt",
|
|
692
|
-
"csl",
|
|
693
|
-
"csproj",
|
|
694
|
-
"dita",
|
|
695
|
-
"ditamap",
|
|
696
|
-
"dtd",
|
|
697
|
-
"ent",
|
|
698
|
-
"mod",
|
|
699
|
-
"dtml",
|
|
700
|
-
"fsproj",
|
|
701
|
-
"fxml",
|
|
702
|
-
"iml",
|
|
703
|
-
"isml",
|
|
704
|
-
"jmx",
|
|
705
|
-
"launch",
|
|
706
|
-
"menu",
|
|
707
|
-
"nuspec",
|
|
708
|
-
"opml",
|
|
709
|
-
"owl",
|
|
710
|
-
"proj",
|
|
711
|
-
"props",
|
|
712
|
-
"pt",
|
|
713
|
-
"publishsettings",
|
|
714
|
-
"pubxml",
|
|
715
|
-
"rbxlx",
|
|
716
|
-
"rbxmx",
|
|
717
|
-
"rdf",
|
|
718
|
-
"rng",
|
|
719
|
-
"rss",
|
|
720
|
-
"shproj",
|
|
721
|
-
"storyboard",
|
|
722
|
-
"svg",
|
|
723
|
-
"targets",
|
|
724
|
-
"tld",
|
|
725
|
-
"tmx",
|
|
726
|
-
"vbproj",
|
|
727
|
-
"vcxproj",
|
|
728
|
-
"wsdl",
|
|
729
|
-
"wxi",
|
|
730
|
-
"wxl",
|
|
731
|
-
"wxs",
|
|
732
|
-
"xaml",
|
|
733
|
-
"xbl",
|
|
734
|
-
"xib",
|
|
735
|
-
"xlf",
|
|
736
|
-
"xliff",
|
|
737
|
-
"xpdl",
|
|
738
|
-
"xul",
|
|
739
|
-
"xoml"
|
|
740
|
-
], _n = $(Y), xn = {
|
|
741
|
-
[_n]: {
|
|
742
|
-
category: "Global",
|
|
1089
|
+
}, eo = ["xml", "opml", "rss", "svg"], to = S(se), no = {
|
|
1090
|
+
[to]: {
|
|
1091
|
+
category: "Embed",
|
|
743
1092
|
type: "string",
|
|
744
1093
|
array: !0,
|
|
745
|
-
default: [{ value: [...
|
|
1094
|
+
default: [{ value: [...eo] }],
|
|
746
1095
|
description: 'Specify embedded XML language identifiers. This requires "@prettier/plugin-xml".'
|
|
747
1096
|
},
|
|
748
|
-
/**
|
|
1097
|
+
/**
|
|
1098
|
+
* @internal
|
|
1099
|
+
*/
|
|
749
1100
|
__embeddedXmlFragmentRecoverIndex: {
|
|
750
|
-
category: "
|
|
1101
|
+
category: "Embed",
|
|
751
1102
|
type: "int",
|
|
752
1103
|
array: !0,
|
|
753
1104
|
default: [{ value: [] }],
|
|
754
1105
|
description: "This option is read only and used as a workaround to support xml fragments"
|
|
755
1106
|
}
|
|
756
1107
|
};
|
|
757
|
-
function
|
|
1108
|
+
function ro(t) {
|
|
758
1109
|
const n = {
|
|
759
1110
|
loc: {
|
|
760
1111
|
start: {
|
|
@@ -774,7 +1125,7 @@ function In(t) {
|
|
|
774
1125
|
);
|
|
775
1126
|
return Object.assign(r, n), r;
|
|
776
1127
|
}
|
|
777
|
-
function
|
|
1128
|
+
function it(t) {
|
|
778
1129
|
const n = {
|
|
779
1130
|
loc: {
|
|
780
1131
|
start: {
|
|
@@ -794,52 +1145,52 @@ function Te(t) {
|
|
|
794
1145
|
);
|
|
795
1146
|
return Object.assign(r, n), r;
|
|
796
1147
|
}
|
|
797
|
-
const
|
|
1148
|
+
const oo = {
|
|
798
1149
|
async parse(t, n) {
|
|
799
|
-
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors:
|
|
1150
|
+
const { parse: r } = await import("@xml-tools/parser"), { lexErrors: e, parseErrors: o, cst: s } = r(t);
|
|
800
1151
|
if (e.length > 0) {
|
|
801
|
-
const
|
|
802
|
-
throw
|
|
1152
|
+
const l = e[0];
|
|
1153
|
+
throw ro(l);
|
|
803
1154
|
}
|
|
804
|
-
if (
|
|
805
|
-
let
|
|
806
|
-
for (const
|
|
1155
|
+
if (o.length > 0) {
|
|
1156
|
+
let l = !1;
|
|
1157
|
+
for (const d of o) {
|
|
807
1158
|
if (!["MismatchedTokenException", "NotAllInputParsedException"].includes(
|
|
808
|
-
|
|
1159
|
+
d.name
|
|
809
1160
|
))
|
|
810
|
-
throw
|
|
811
|
-
if (
|
|
812
|
-
|
|
1161
|
+
throw it(d);
|
|
1162
|
+
if (d.message === "Expecting token of type --> OPEN <-- but found --> '' <--") {
|
|
1163
|
+
l = !0;
|
|
813
1164
|
continue;
|
|
814
1165
|
}
|
|
815
1166
|
if (/Expecting token of type --> EOF <-- but found --> '[\s\S]+' <--/.test(
|
|
816
|
-
|
|
817
|
-
) || /Redundant input, expecting EOF but found: /.test(
|
|
1167
|
+
d.message
|
|
1168
|
+
) || /Redundant input, expecting EOF but found: /.test(d.message)) {
|
|
818
1169
|
n.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
819
1170
|
0,
|
|
820
1171
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
821
|
-
|
|
1172
|
+
d.token.startOffset
|
|
822
1173
|
);
|
|
823
1174
|
break;
|
|
824
1175
|
}
|
|
825
1176
|
if (/Expecting token of type --> OPEN <-- but found --> '[\s\S]+' <--/.test(
|
|
826
|
-
|
|
1177
|
+
d.message
|
|
827
1178
|
)) {
|
|
828
|
-
if (
|
|
1179
|
+
if (d.token.endOffset === void 0 || Number.isNaN(d.token.endOffset))
|
|
829
1180
|
break;
|
|
830
1181
|
n.__embeddedXmlFragmentRecoverIndex?.splice(
|
|
831
1182
|
0,
|
|
832
1183
|
n.__embeddedXmlFragmentRecoverIndex.length,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
),
|
|
1184
|
+
d.token.startOffset,
|
|
1185
|
+
d.token.endOffset
|
|
1186
|
+
), l = !0;
|
|
836
1187
|
break;
|
|
837
1188
|
}
|
|
838
|
-
throw
|
|
1189
|
+
throw it(d);
|
|
839
1190
|
}
|
|
840
|
-
|
|
1191
|
+
l && St(s);
|
|
841
1192
|
}
|
|
842
|
-
return
|
|
1193
|
+
return s;
|
|
843
1194
|
},
|
|
844
1195
|
astFormat: "xml",
|
|
845
1196
|
locStart(t) {
|
|
@@ -849,97 +1200,145 @@ const $n = {
|
|
|
849
1200
|
return t.location.endOffset ?? NaN;
|
|
850
1201
|
}
|
|
851
1202
|
};
|
|
852
|
-
function
|
|
1203
|
+
function St(t) {
|
|
853
1204
|
const n = t.children;
|
|
854
1205
|
for (const r in n) {
|
|
855
1206
|
const e = n[r] ?? [];
|
|
856
|
-
for (let
|
|
857
|
-
const
|
|
858
|
-
if (
|
|
859
|
-
if (Object.keys(
|
|
860
|
-
e.splice(
|
|
1207
|
+
for (let o = e.length - 1; o >= 0; --o) {
|
|
1208
|
+
const s = e[o];
|
|
1209
|
+
if (so(s)) {
|
|
1210
|
+
if (Object.keys(s.children).length === 0) {
|
|
1211
|
+
e.splice(o, 1), e.length === 0 && delete n[r];
|
|
861
1212
|
continue;
|
|
862
1213
|
}
|
|
863
|
-
|
|
1214
|
+
St(s);
|
|
864
1215
|
}
|
|
865
1216
|
}
|
|
866
1217
|
}
|
|
867
1218
|
}
|
|
868
|
-
function
|
|
1219
|
+
function so(t) {
|
|
869
1220
|
return "name" in t && "children" in t && "location" in t;
|
|
870
1221
|
}
|
|
871
|
-
const
|
|
1222
|
+
const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
872
1223
|
__proto__: null,
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
options:
|
|
876
|
-
parser:
|
|
877
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
"
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
(
|
|
892
|
-
|
|
1224
|
+
embedder: Zr,
|
|
1225
|
+
language: se,
|
|
1226
|
+
options: no,
|
|
1227
|
+
parser: oo
|
|
1228
|
+
}, Symbol.toStringTag, { value: "Module" })), { line: ct, group: J, indent: at, softline: dt } = I, co = async (t, n, r, e, { identifier: o, embeddedOverrideOptions: s }) => {
|
|
1229
|
+
e = {
|
|
1230
|
+
...e,
|
|
1231
|
+
...s
|
|
1232
|
+
};
|
|
1233
|
+
const { node: l } = r, { createPlaceholder: d, placeholderRegex: p } = T(), c = l.quasis.map(
|
|
1234
|
+
(m, g, { length: f }) => g === f - 1 ? m.value.cooked : m.value.cooked + d(g)
|
|
1235
|
+
).join(""), a = c.match(/^\s+/)?.[0] ?? "", u = c.match(/\s+$/)?.[0] ?? "", y = c.slice(
|
|
1236
|
+
a.length,
|
|
1237
|
+
-u.length || void 0
|
|
1238
|
+
), b = x(r, n), E = await t(y, {
|
|
1239
|
+
...e,
|
|
1240
|
+
parser: "yaml"
|
|
1241
|
+
}), i = L(E, p, b);
|
|
1242
|
+
if (e.preserveEmbeddedExteriorWhitespaces?.includes(o))
|
|
1243
|
+
return J([
|
|
1244
|
+
"`",
|
|
1245
|
+
a,
|
|
1246
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [J(i)] : at([J(i)]),
|
|
1247
|
+
u,
|
|
1248
|
+
"`"
|
|
1249
|
+
]);
|
|
1250
|
+
const h = a.length ? ct : dt, v = u.length ? ct : dt;
|
|
1251
|
+
return J([
|
|
1252
|
+
"`",
|
|
1253
|
+
e.noEmbeddedMultiLineIndentation?.includes(o) ? [h, J(i)] : at([h, J(i)]),
|
|
1254
|
+
v,
|
|
1255
|
+
"`"
|
|
1256
|
+
]);
|
|
1257
|
+
}, xt = "embeddedYaml", ao = ["yaml", "yml"], lo = S(xt), uo = {
|
|
1258
|
+
[lo]: {
|
|
1259
|
+
category: "Embed",
|
|
1260
|
+
type: "string",
|
|
1261
|
+
array: !0,
|
|
1262
|
+
default: [{ value: [...ao] }],
|
|
1263
|
+
description: "Specify embedded YAML language identifiers."
|
|
893
1264
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1265
|
+
}, go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1266
|
+
__proto__: null,
|
|
1267
|
+
embedder: co,
|
|
1268
|
+
language: xt,
|
|
1269
|
+
options: uo
|
|
1270
|
+
}, Symbol.toStringTag, { value: "Module" })), Tt = [], Lt = {}, Ot = {}, Mt = {}, po = /* @__PURE__ */ Object.assign({
|
|
1271
|
+
"./css/index.ts": sn,
|
|
1272
|
+
"./es/index.ts": pn,
|
|
1273
|
+
"./glsl/index.ts": bn,
|
|
1274
|
+
"./graphql/index.ts": Dn,
|
|
1275
|
+
"./html/index.ts": On,
|
|
1276
|
+
"./ini/index.ts": Pn,
|
|
1277
|
+
"./json/index.ts": Cn,
|
|
1278
|
+
"./latex/index.ts": Hn,
|
|
1279
|
+
"./markdown/index.ts": Vn,
|
|
1280
|
+
"./noop/index.ts": tr,
|
|
1281
|
+
"./php/index.ts": ir,
|
|
1282
|
+
"./properties/index.ts": ur,
|
|
1283
|
+
"./ruby/index.ts": br,
|
|
1284
|
+
"./sh/index.ts": Sr,
|
|
1285
|
+
"./sql/index.ts": wr,
|
|
1286
|
+
"./toml/index.ts": zr,
|
|
1287
|
+
"./ts/index.ts": Vr,
|
|
1288
|
+
"./xml/index.ts": io,
|
|
1289
|
+
"./yaml/index.ts": go
|
|
1290
|
+
});
|
|
1291
|
+
Object.values(po).forEach(({ language: t, parser: n, embedder: r, options: e }) => {
|
|
1292
|
+
Zt(Tt, t, re), n && (Lt[t] = n), r && (Ot[t] = r), Object.assign(Mt, e);
|
|
1293
|
+
});
|
|
1294
|
+
const mo = "noEmbeddedIdentificationByComment", ho = "noEmbeddedIdentificationByTag", fo = "preserveEmbeddedExteriorWhitespaces", Eo = "noEmbeddedMultiLineIndentation", bo = "embeddedOverrides", zo = {
|
|
1295
|
+
...Mt,
|
|
1296
|
+
[mo]: {
|
|
1297
|
+
category: "Embed",
|
|
899
1298
|
type: "string",
|
|
900
1299
|
array: !0,
|
|
901
1300
|
default: [{ value: [] }],
|
|
902
1301
|
description: 'This option turns off "/* identifier */ `...`" comment-based language identification for the specified identifiers.'
|
|
903
1302
|
},
|
|
904
|
-
[
|
|
905
|
-
category: "
|
|
1303
|
+
[ho]: {
|
|
1304
|
+
category: "Embed",
|
|
906
1305
|
type: "string",
|
|
907
1306
|
array: !0,
|
|
908
1307
|
default: [{ value: [] }],
|
|
909
1308
|
description: 'This option turns off "identifier`...`" tag-based language identification for the specified identifiers.'
|
|
910
1309
|
},
|
|
911
|
-
[
|
|
1310
|
+
[fo]: {
|
|
912
1311
|
category: "Config",
|
|
913
1312
|
type: "string",
|
|
914
1313
|
array: !0,
|
|
915
1314
|
default: [{ value: [] }],
|
|
916
1315
|
description: "This option preserves leading and trailing whitespaces in the formatting results for the specified identifiers."
|
|
917
1316
|
},
|
|
918
|
-
[
|
|
919
|
-
category: "
|
|
1317
|
+
[Eo]: {
|
|
1318
|
+
category: "Embed",
|
|
920
1319
|
type: "string",
|
|
921
1320
|
array: !0,
|
|
922
1321
|
default: [{ value: [] }],
|
|
923
1322
|
description: "This option turns off auto indentation in the formatting results for the specified identifiers when they are formatted to span multi lines."
|
|
924
1323
|
},
|
|
925
|
-
[
|
|
926
|
-
category: "
|
|
1324
|
+
[bo]: {
|
|
1325
|
+
category: "Embed",
|
|
927
1326
|
type: "string",
|
|
928
1327
|
array: !1,
|
|
929
1328
|
default: void 0,
|
|
930
1329
|
description: "This option accepts option overrides for the specified identifiers. It should either be a stringified JSON or an absolute filepath to the option overrides file."
|
|
931
1330
|
}
|
|
932
|
-
},
|
|
1331
|
+
}, Ko = {
|
|
933
1332
|
// parsers from internal
|
|
934
|
-
...
|
|
935
|
-
...
|
|
936
|
-
...
|
|
937
|
-
...
|
|
938
|
-
...
|
|
1333
|
+
...Rt.parsers,
|
|
1334
|
+
...jt.parsers,
|
|
1335
|
+
...Ft.parsers,
|
|
1336
|
+
...Bt.parsers,
|
|
1337
|
+
...wt.parsers,
|
|
939
1338
|
// parsers from this plugin
|
|
940
|
-
...
|
|
1339
|
+
...Lt
|
|
941
1340
|
};
|
|
942
|
-
var
|
|
1341
|
+
var yo = {
|
|
943
1342
|
isEqual: !0,
|
|
944
1343
|
isMatchingKey: !0,
|
|
945
1344
|
isPromise: !0,
|
|
@@ -948,24 +1347,24 @@ var Mn = {
|
|
|
948
1347
|
onCacheChange: !0,
|
|
949
1348
|
onCacheHit: !0,
|
|
950
1349
|
transformKey: !0
|
|
951
|
-
},
|
|
952
|
-
function
|
|
1350
|
+
}, _o = Array.prototype.slice;
|
|
1351
|
+
function Q(t) {
|
|
953
1352
|
var n = t.length;
|
|
954
|
-
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] :
|
|
1353
|
+
return n ? n === 1 ? [t[0]] : n === 2 ? [t[0], t[1]] : n === 3 ? [t[0], t[1], t[2]] : _o.call(t, 0) : [];
|
|
955
1354
|
}
|
|
956
|
-
function
|
|
1355
|
+
function vo(t) {
|
|
957
1356
|
var n = {};
|
|
958
1357
|
for (var r in t)
|
|
959
|
-
|
|
1358
|
+
yo[r] || (n[r] = t[r]);
|
|
960
1359
|
return n;
|
|
961
1360
|
}
|
|
962
|
-
function
|
|
1361
|
+
function $o(t) {
|
|
963
1362
|
return typeof t == "function" && t.isMemoized;
|
|
964
1363
|
}
|
|
965
|
-
function
|
|
1364
|
+
function Do(t, n) {
|
|
966
1365
|
return t === n || t !== t && n !== n;
|
|
967
1366
|
}
|
|
968
|
-
function
|
|
1367
|
+
function lt(t, n) {
|
|
969
1368
|
var r = {};
|
|
970
1369
|
for (var e in t)
|
|
971
1370
|
r[e] = t[e];
|
|
@@ -973,7 +1372,7 @@ function Oe(t, n) {
|
|
|
973
1372
|
r[e] = n[e];
|
|
974
1373
|
return r;
|
|
975
1374
|
}
|
|
976
|
-
var
|
|
1375
|
+
var Io = (
|
|
977
1376
|
/** @class */
|
|
978
1377
|
function() {
|
|
979
1378
|
function t(n) {
|
|
@@ -998,118 +1397,118 @@ var jn = (
|
|
|
998
1397
|
*/
|
|
999
1398
|
get: function() {
|
|
1000
1399
|
return {
|
|
1001
|
-
keys:
|
|
1400
|
+
keys: Q(this.keys),
|
|
1002
1401
|
size: this.size,
|
|
1003
|
-
values:
|
|
1402
|
+
values: Q(this.values)
|
|
1004
1403
|
};
|
|
1005
1404
|
},
|
|
1006
1405
|
enumerable: !1,
|
|
1007
1406
|
configurable: !0
|
|
1008
1407
|
}), t.prototype._getKeyIndexFromMatchingKey = function(n) {
|
|
1009
|
-
var r = this.options, e = r.isMatchingKey,
|
|
1010
|
-
if (!
|
|
1408
|
+
var r = this.options, e = r.isMatchingKey, o = r.maxSize, s = this.keys, l = s.length;
|
|
1409
|
+
if (!l)
|
|
1011
1410
|
return -1;
|
|
1012
|
-
if (e(
|
|
1411
|
+
if (e(s[0], n))
|
|
1013
1412
|
return 0;
|
|
1014
|
-
if (
|
|
1015
|
-
for (var
|
|
1016
|
-
if (e(
|
|
1017
|
-
return
|
|
1413
|
+
if (o > 1) {
|
|
1414
|
+
for (var d = 1; d < l; d++)
|
|
1415
|
+
if (e(s[d], n))
|
|
1416
|
+
return d;
|
|
1018
1417
|
}
|
|
1019
1418
|
return -1;
|
|
1020
1419
|
}, t.prototype._getKeyIndexForMany = function(n) {
|
|
1021
|
-
var r = this.options.isEqual, e = this.keys,
|
|
1022
|
-
if (!
|
|
1420
|
+
var r = this.options.isEqual, e = this.keys, o = e.length;
|
|
1421
|
+
if (!o)
|
|
1023
1422
|
return -1;
|
|
1024
|
-
if (
|
|
1423
|
+
if (o === 1)
|
|
1025
1424
|
return this._getKeyIndexForSingle(n);
|
|
1026
|
-
var
|
|
1027
|
-
if (
|
|
1028
|
-
for (var
|
|
1029
|
-
if (
|
|
1030
|
-
for (
|
|
1425
|
+
var s = n.length, l, d;
|
|
1426
|
+
if (s > 1) {
|
|
1427
|
+
for (var p = 0; p < o; p++)
|
|
1428
|
+
if (l = e[p], l.length === s) {
|
|
1429
|
+
for (d = 0; d < s && r(l[d], n[d]); d++)
|
|
1031
1430
|
;
|
|
1032
|
-
if (
|
|
1033
|
-
return
|
|
1431
|
+
if (d === s)
|
|
1432
|
+
return p;
|
|
1034
1433
|
}
|
|
1035
1434
|
} else
|
|
1036
|
-
for (var
|
|
1037
|
-
if (
|
|
1038
|
-
return
|
|
1435
|
+
for (var p = 0; p < o; p++)
|
|
1436
|
+
if (l = e[p], l.length === s && r(l[0], n[0]))
|
|
1437
|
+
return p;
|
|
1039
1438
|
return -1;
|
|
1040
1439
|
}, t.prototype._getKeyIndexForSingle = function(n) {
|
|
1041
1440
|
var r = this.keys;
|
|
1042
1441
|
if (!r.length)
|
|
1043
1442
|
return -1;
|
|
1044
|
-
var e = r[0],
|
|
1045
|
-
if (n.length !==
|
|
1443
|
+
var e = r[0], o = e.length;
|
|
1444
|
+
if (n.length !== o)
|
|
1046
1445
|
return -1;
|
|
1047
|
-
var
|
|
1048
|
-
if (
|
|
1049
|
-
for (var
|
|
1050
|
-
if (!
|
|
1446
|
+
var s = this.options.isEqual;
|
|
1447
|
+
if (o > 1) {
|
|
1448
|
+
for (var l = 0; l < o; l++)
|
|
1449
|
+
if (!s(e[l], n[l]))
|
|
1051
1450
|
return -1;
|
|
1052
1451
|
return 0;
|
|
1053
1452
|
}
|
|
1054
|
-
return
|
|
1453
|
+
return s(e[0], n[0]) ? 0 : -1;
|
|
1055
1454
|
}, t.prototype.orderByLru = function(n, r, e) {
|
|
1056
|
-
for (var
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
var
|
|
1060
|
-
|
|
1455
|
+
for (var o = this.keys, s = this.values, l = o.length, d = e; d--; )
|
|
1456
|
+
o[d + 1] = o[d], s[d + 1] = s[d];
|
|
1457
|
+
o[0] = n, s[0] = r;
|
|
1458
|
+
var p = this.options.maxSize;
|
|
1459
|
+
l === p && e === l ? (o.pop(), s.pop()) : e >= p && (o.length = s.length = p);
|
|
1061
1460
|
}, t.prototype.updateAsyncCache = function(n) {
|
|
1062
|
-
var r = this, e = this.options,
|
|
1063
|
-
this.values[0] =
|
|
1064
|
-
return r.shouldUpdateOnHit &&
|
|
1065
|
-
}, function(
|
|
1066
|
-
var
|
|
1067
|
-
throw
|
|
1461
|
+
var r = this, e = this.options, o = e.onCacheChange, s = e.onCacheHit, l = this.keys[0], d = this.values[0];
|
|
1462
|
+
this.values[0] = d.then(function(p) {
|
|
1463
|
+
return r.shouldUpdateOnHit && s(r, r.options, n), r.shouldUpdateOnChange && o(r, r.options, n), p;
|
|
1464
|
+
}, function(p) {
|
|
1465
|
+
var c = r.getKeyIndex(l);
|
|
1466
|
+
throw c !== -1 && (r.keys.splice(c, 1), r.values.splice(c, 1)), p;
|
|
1068
1467
|
});
|
|
1069
1468
|
}, t;
|
|
1070
1469
|
}()
|
|
1071
1470
|
);
|
|
1072
|
-
function
|
|
1073
|
-
if (n === void 0 && (n = {}),
|
|
1074
|
-
return
|
|
1471
|
+
function kt(t, n) {
|
|
1472
|
+
if (n === void 0 && (n = {}), $o(t))
|
|
1473
|
+
return kt(t.fn, lt(t.options, n));
|
|
1075
1474
|
if (typeof t != "function")
|
|
1076
1475
|
throw new TypeError("You must pass a function to `memoize`.");
|
|
1077
|
-
var r = n.isEqual, e = r === void 0 ?
|
|
1476
|
+
var r = n.isEqual, e = r === void 0 ? Do : r, o = n.isMatchingKey, s = n.isPromise, l = s === void 0 ? !1 : s, d = n.maxSize, p = d === void 0 ? 1 : d, c = n.onCacheAdd, a = n.onCacheChange, u = n.onCacheHit, y = n.transformKey, b = lt({
|
|
1078
1477
|
isEqual: e,
|
|
1079
|
-
isMatchingKey:
|
|
1080
|
-
isPromise:
|
|
1081
|
-
maxSize:
|
|
1082
|
-
onCacheAdd:
|
|
1083
|
-
onCacheChange:
|
|
1478
|
+
isMatchingKey: o,
|
|
1479
|
+
isPromise: l,
|
|
1480
|
+
maxSize: p,
|
|
1481
|
+
onCacheAdd: c,
|
|
1482
|
+
onCacheChange: a,
|
|
1084
1483
|
onCacheHit: u,
|
|
1085
|
-
transformKey:
|
|
1086
|
-
},
|
|
1087
|
-
var
|
|
1088
|
-
|
|
1089
|
-
var
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1484
|
+
transformKey: y
|
|
1485
|
+
}, vo(n)), E = new Io(b), i = E.keys, h = E.values, v = E.canTransformKey, m = E.shouldCloneArguments, g = E.shouldUpdateOnAdd, f = E.shouldUpdateOnChange, $ = E.shouldUpdateOnHit, _ = function() {
|
|
1486
|
+
var D = m ? Q(arguments) : arguments;
|
|
1487
|
+
v && (D = y(D));
|
|
1488
|
+
var O = i.length ? E.getKeyIndex(D) : -1;
|
|
1489
|
+
if (O !== -1)
|
|
1490
|
+
$ && u(E, b, _), O && (E.orderByLru(i[O], h[O], O), f && a(E, b, _));
|
|
1092
1491
|
else {
|
|
1093
|
-
var
|
|
1094
|
-
|
|
1492
|
+
var At = t.apply(this, arguments), Pt = m ? D : Q(arguments);
|
|
1493
|
+
E.orderByLru(Pt, At, i.length), l && E.updateAsyncCache(_), g && c(E, b, _), f && a(E, b, _);
|
|
1095
1494
|
}
|
|
1096
|
-
return
|
|
1495
|
+
return h[0];
|
|
1097
1496
|
};
|
|
1098
|
-
return
|
|
1497
|
+
return _.cache = E, _.fn = t, _.isMemoized = !0, _.options = b, _;
|
|
1099
1498
|
}
|
|
1100
|
-
async function
|
|
1499
|
+
async function ut(t) {
|
|
1101
1500
|
try {
|
|
1102
|
-
const n = await
|
|
1501
|
+
const n = await Wt(t, { encoding: "utf-8" });
|
|
1103
1502
|
return JSON.parse(n);
|
|
1104
1503
|
} catch {
|
|
1105
1504
|
}
|
|
1106
1505
|
}
|
|
1107
|
-
const
|
|
1506
|
+
const So = /* @__PURE__ */ new URL(
|
|
1108
1507
|
"data:text/javascript," + encodeURIComponent('import{pathToFileURL as r}from"node:url";import{parentPort as t,workerData as a}from"node:worker_threads";const s=async({absolutePath:o})=>{try{const e=await import(r(o).href);t?.postMessage(e.embeddedOverrides??e.default??void 0)}catch{t?.postMessage(void 0)}};s(a);')
|
|
1109
1508
|
);
|
|
1110
|
-
async function
|
|
1509
|
+
async function xo(t) {
|
|
1111
1510
|
return new Promise((n) => {
|
|
1112
|
-
const r = new
|
|
1511
|
+
const r = new Kt(So, {
|
|
1113
1512
|
workerData: {
|
|
1114
1513
|
absolutePath: t
|
|
1115
1514
|
}
|
|
@@ -1121,75 +1520,75 @@ async function Bn(t) {
|
|
|
1121
1520
|
});
|
|
1122
1521
|
});
|
|
1123
1522
|
}
|
|
1124
|
-
async function
|
|
1523
|
+
async function To(t) {
|
|
1125
1524
|
console.error(
|
|
1126
1525
|
"Ts module type embeddedOverrides has not been implemented yet."
|
|
1127
1526
|
);
|
|
1128
1527
|
}
|
|
1129
|
-
const
|
|
1528
|
+
const Lo = kt(
|
|
1130
1529
|
async (t, n) => {
|
|
1131
|
-
if (
|
|
1530
|
+
if (Ct(t))
|
|
1132
1531
|
return t;
|
|
1133
|
-
const r = await
|
|
1532
|
+
const r = await Ht(n);
|
|
1134
1533
|
let e;
|
|
1135
|
-
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e =
|
|
1534
|
+
return typeof r != "string" ? e = process.env.PWD ?? process.cwd() : e = Gt(r), qt(e, t);
|
|
1136
1535
|
}
|
|
1137
|
-
),
|
|
1138
|
-
const r =
|
|
1536
|
+
), Oo = async (t, n) => {
|
|
1537
|
+
const r = Lo(
|
|
1139
1538
|
t,
|
|
1140
1539
|
n
|
|
1141
|
-
), e =
|
|
1540
|
+
), e = zt(t);
|
|
1142
1541
|
if (e === ".json") {
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
return
|
|
1146
|
-
console.error(`Failed to parse the json file: ${
|
|
1542
|
+
const o = await r, s = await ut(o);
|
|
1543
|
+
if (s !== void 0)
|
|
1544
|
+
return s;
|
|
1545
|
+
console.error(`Failed to parse the json file: ${o}`);
|
|
1147
1546
|
return;
|
|
1148
1547
|
} else if (e === ".mjs" || e === ".cjs" || e === ".js") {
|
|
1149
|
-
const
|
|
1150
|
-
if (
|
|
1151
|
-
return
|
|
1152
|
-
console.error(`Failed to parse the js module file: ${
|
|
1548
|
+
const o = await r, s = await xo(o);
|
|
1549
|
+
if (s !== void 0)
|
|
1550
|
+
return s;
|
|
1551
|
+
console.error(`Failed to parse the js module file: ${o}`);
|
|
1153
1552
|
return;
|
|
1154
1553
|
} else if (e === ".mts" || e === ".cts" || e === ".ts") {
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1157
|
-
return
|
|
1158
|
-
console.error(`Failed to parse the ts module file: ${
|
|
1554
|
+
const o = await r, s = await To();
|
|
1555
|
+
if (s !== void 0)
|
|
1556
|
+
return s;
|
|
1557
|
+
console.error(`Failed to parse the ts module file: ${o}`);
|
|
1159
1558
|
return;
|
|
1160
1559
|
} else if (e === "") {
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
return
|
|
1560
|
+
const o = await r, s = await ut(o);
|
|
1561
|
+
if (s !== void 0)
|
|
1562
|
+
return s;
|
|
1164
1563
|
}
|
|
1165
1564
|
try {
|
|
1166
1565
|
return JSON.parse(t);
|
|
1167
1566
|
} catch {
|
|
1168
1567
|
console.error("Failed to parse embeddedOverrides as a json object");
|
|
1169
1568
|
}
|
|
1170
|
-
},
|
|
1569
|
+
}, Mo = async (t, n, r) => {
|
|
1171
1570
|
if (t === void 0)
|
|
1172
1571
|
return;
|
|
1173
|
-
const e = await
|
|
1572
|
+
const e = await Oo(
|
|
1174
1573
|
t,
|
|
1175
1574
|
r
|
|
1176
1575
|
);
|
|
1177
1576
|
if (e !== void 0)
|
|
1178
1577
|
try {
|
|
1179
|
-
for (const { identifiers:
|
|
1180
|
-
if (
|
|
1181
|
-
return
|
|
1578
|
+
for (const { identifiers: o, options: s } of e)
|
|
1579
|
+
if (o.includes(n))
|
|
1580
|
+
return s;
|
|
1182
1581
|
} catch {
|
|
1183
1582
|
console.error("Error parsing embedded override options.");
|
|
1184
1583
|
}
|
|
1185
1584
|
};
|
|
1186
|
-
function
|
|
1585
|
+
function ko({ node: t, parent: n }, r, e) {
|
|
1187
1586
|
if (r.length === 0 || t.type !== "TemplateLiteral")
|
|
1188
1587
|
return;
|
|
1189
|
-
const
|
|
1190
|
-
if (!
|
|
1588
|
+
const o = t.comments ?? n?.comments;
|
|
1589
|
+
if (!o)
|
|
1191
1590
|
return;
|
|
1192
|
-
const
|
|
1591
|
+
const s = o[o.length - 1];
|
|
1193
1592
|
if (!(![
|
|
1194
1593
|
"MultiLine",
|
|
1195
1594
|
// meriyah
|
|
@@ -1197,53 +1596,53 @@ function zn({ node: t, parent: n }, r, e) {
|
|
|
1197
1596
|
// typescript, acorn, espree, flow
|
|
1198
1597
|
"CommentBlock"
|
|
1199
1598
|
// babel, babel-flow, babel-ts
|
|
1200
|
-
].includes(
|
|
1201
|
-
for (const
|
|
1202
|
-
if (` ${
|
|
1203
|
-
return
|
|
1599
|
+
].includes(s.type) || !s.leading)) {
|
|
1600
|
+
for (const l of r)
|
|
1601
|
+
if (` ${l} ` === s.value && !e.includes(l))
|
|
1602
|
+
return l;
|
|
1204
1603
|
}
|
|
1205
1604
|
}
|
|
1206
|
-
function
|
|
1605
|
+
function No({ node: t, parent: n }, r, e) {
|
|
1207
1606
|
if (r.length !== 0 && !(t.type !== "TemplateLiteral" || n?.type !== "TaggedTemplateExpression" || n.tag.type !== "Identifier")) {
|
|
1208
|
-
for (const
|
|
1209
|
-
if (n.tag.name ===
|
|
1210
|
-
return
|
|
1607
|
+
for (const o of r)
|
|
1608
|
+
if (n.tag.name === o && !e.includes(o))
|
|
1609
|
+
return o;
|
|
1211
1610
|
}
|
|
1212
1611
|
}
|
|
1213
|
-
const { estree:
|
|
1612
|
+
const { estree: Nt } = Ut, Ao = function(t, n) {
|
|
1214
1613
|
const { node: r } = t;
|
|
1215
1614
|
if (r.type !== "TemplateLiteral" || r.quasis.some(({ value: { cooked: e } }) => e === null))
|
|
1216
1615
|
return null;
|
|
1217
|
-
for (const e of
|
|
1218
|
-
const
|
|
1219
|
-
if (!
|
|
1616
|
+
for (const e of Tt) {
|
|
1617
|
+
const o = n[S(e)];
|
|
1618
|
+
if (!o)
|
|
1220
1619
|
continue;
|
|
1221
|
-
const
|
|
1620
|
+
const s = ko(
|
|
1222
1621
|
t,
|
|
1223
|
-
|
|
1622
|
+
o,
|
|
1224
1623
|
n.noEmbeddedIdentificationByComment ?? []
|
|
1225
|
-
) ??
|
|
1624
|
+
) ?? No(
|
|
1226
1625
|
t,
|
|
1227
|
-
|
|
1626
|
+
o,
|
|
1228
1627
|
n.noEmbeddedIdentificationByTag ?? []
|
|
1229
1628
|
);
|
|
1230
|
-
if (
|
|
1629
|
+
if (s === void 0)
|
|
1231
1630
|
continue;
|
|
1232
|
-
const
|
|
1233
|
-
if (!
|
|
1631
|
+
const l = Ot[e];
|
|
1632
|
+
if (!l)
|
|
1234
1633
|
return null;
|
|
1235
|
-
const
|
|
1236
|
-
return
|
|
1237
|
-
const
|
|
1634
|
+
const d = t.node;
|
|
1635
|
+
return d.quasis.length === 1 && d.quasis[0].value.raw.trim() === "" ? "``" : async (p, c, a, u) => {
|
|
1636
|
+
const y = await Mo(
|
|
1238
1637
|
u.embeddedOverrides,
|
|
1239
|
-
|
|
1638
|
+
s,
|
|
1240
1639
|
u.filepath
|
|
1241
1640
|
);
|
|
1242
1641
|
try {
|
|
1243
|
-
const b = await
|
|
1244
|
-
identifier:
|
|
1245
|
-
identifiers:
|
|
1246
|
-
embeddedOverrideOptions:
|
|
1642
|
+
const b = await l(p, c, a, u, {
|
|
1643
|
+
identifier: s,
|
|
1644
|
+
identifiers: o,
|
|
1645
|
+
embeddedOverrideOptions: y
|
|
1247
1646
|
});
|
|
1248
1647
|
return I.label(
|
|
1249
1648
|
{ embed: !0, ...b.label },
|
|
@@ -1254,20 +1653,20 @@ const { estree: qe } = et, Hn = function(t, n) {
|
|
|
1254
1653
|
}
|
|
1255
1654
|
};
|
|
1256
1655
|
}
|
|
1257
|
-
return
|
|
1258
|
-
},
|
|
1656
|
+
return Nt.embed?.(t, n) ?? null;
|
|
1657
|
+
}, Ho = {
|
|
1259
1658
|
estree: {
|
|
1260
|
-
...
|
|
1261
|
-
embed:
|
|
1659
|
+
...Nt,
|
|
1660
|
+
embed: Ao
|
|
1262
1661
|
}
|
|
1263
1662
|
};
|
|
1264
1663
|
export {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1664
|
+
Ot as embeddedEmbedders,
|
|
1665
|
+
Tt as embeddedLanguages,
|
|
1666
|
+
Mt as embeddedOptions,
|
|
1667
|
+
Lt as embeddedParsers,
|
|
1668
|
+
S as makeIdentifiersOptionName,
|
|
1669
|
+
zo as options,
|
|
1670
|
+
Ko as parsers,
|
|
1671
|
+
Ho as printers
|
|
1273
1672
|
};
|