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