@unocss/language-server 66.6.8 → 66.7.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.
@@ -1,9 +1,8 @@
1
- import { n as withBase, r as withQuery } from "./dist-DJp734Em.mjs";
2
- import { c as ye, n as Mn, t as Mi } from "./node-Cd2HRubI.mjs";
1
+ import { c as ye, n as Mn, t as Mi } from "./node-4QtI8xnG.mjs";
3
2
  import http from "node:http";
4
3
  import https from "node:https";
5
4
  //#region ../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs
6
- const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r = !o && globalThis.fetch || Mi;
5
+ const o = !!globalThis.process?.env?.FORCE_NODE_FETCH, r$1 = !o && globalThis.fetch || Mi;
7
6
  !o && globalThis.Blob;
8
7
  !o && globalThis.File;
9
8
  !o && globalThis.FormData;
@@ -54,6 +53,180 @@ function destr(value, options = {}) {
54
53
  return value;
55
54
  }
56
55
  }
56
+ String.fromCharCode;
57
+ const HASH_RE = /#/g;
58
+ const AMPERSAND_RE = /&/g;
59
+ const SLASH_RE = /\//g;
60
+ const EQUAL_RE = /=/g;
61
+ const PLUS_RE = /\+/g;
62
+ const ENC_CARET_RE = /%5e/gi;
63
+ const ENC_BACKTICK_RE = /%60/gi;
64
+ const ENC_PIPE_RE = /%7c/gi;
65
+ const ENC_SPACE_RE = /%20/gi;
66
+ function encode(text) {
67
+ return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
68
+ }
69
+ function encodeQueryValue(input) {
70
+ return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
71
+ }
72
+ function encodeQueryKey(text) {
73
+ return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
74
+ }
75
+ function decode(text = "") {
76
+ try {
77
+ return decodeURIComponent("" + text);
78
+ } catch {
79
+ return "" + text;
80
+ }
81
+ }
82
+ function decodeQueryKey(text) {
83
+ return decode(text.replace(PLUS_RE, " "));
84
+ }
85
+ function decodeQueryValue(text) {
86
+ return decode(text.replace(PLUS_RE, " "));
87
+ }
88
+ function parseQuery(parametersString = "") {
89
+ const object = /* @__PURE__ */ Object.create(null);
90
+ if (parametersString[0] === "?") parametersString = parametersString.slice(1);
91
+ for (const parameter of parametersString.split("&")) {
92
+ const s = parameter.match(/([^=]+)=?(.*)/) || [];
93
+ if (s.length < 2) continue;
94
+ const key = decodeQueryKey(s[1]);
95
+ if (key === "__proto__" || key === "constructor") continue;
96
+ const value = decodeQueryValue(s[2] || "");
97
+ if (object[key] === void 0) object[key] = value;
98
+ else if (Array.isArray(object[key])) object[key].push(value);
99
+ else object[key] = [object[key], value];
100
+ }
101
+ return object;
102
+ }
103
+ function encodeQueryItem(key, value) {
104
+ if (typeof value === "number" || typeof value === "boolean") value = String(value);
105
+ if (!value) return encodeQueryKey(key);
106
+ if (Array.isArray(value)) return value.map((_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`).join("&");
107
+ return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
108
+ }
109
+ function stringifyQuery(query) {
110
+ return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
111
+ }
112
+ const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
113
+ const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
114
+ const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
115
+ const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
116
+ const JOIN_LEADING_SLASH_RE = /^\.?\//;
117
+ function hasProtocol(inputString, opts = {}) {
118
+ if (typeof opts === "boolean") opts = { acceptRelative: opts };
119
+ if (opts.strict) return PROTOCOL_STRICT_REGEX.test(inputString);
120
+ return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
121
+ }
122
+ function hasTrailingSlash(input = "", respectQueryAndFragment) {
123
+ if (!respectQueryAndFragment) return input.endsWith("/");
124
+ return TRAILING_SLASH_RE.test(input);
125
+ }
126
+ function withoutTrailingSlash(input = "", respectQueryAndFragment) {
127
+ if (!respectQueryAndFragment) return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
128
+ if (!hasTrailingSlash(input, true)) return input || "/";
129
+ let path = input;
130
+ let fragment = "";
131
+ const fragmentIndex = input.indexOf("#");
132
+ if (fragmentIndex !== -1) {
133
+ path = input.slice(0, fragmentIndex);
134
+ fragment = input.slice(fragmentIndex);
135
+ }
136
+ const [s0, ...s] = path.split("?");
137
+ return ((s0.endsWith("/") ? s0.slice(0, -1) : s0) || "/") + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
138
+ }
139
+ function withTrailingSlash(input = "", respectQueryAndFragment) {
140
+ if (!respectQueryAndFragment) return input.endsWith("/") ? input : input + "/";
141
+ if (hasTrailingSlash(input, true)) return input || "/";
142
+ let path = input;
143
+ let fragment = "";
144
+ const fragmentIndex = input.indexOf("#");
145
+ if (fragmentIndex !== -1) {
146
+ path = input.slice(0, fragmentIndex);
147
+ fragment = input.slice(fragmentIndex);
148
+ if (!path) return fragment;
149
+ }
150
+ const [s0, ...s] = path.split("?");
151
+ return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
152
+ }
153
+ function withBase(input, base) {
154
+ if (isEmptyURL(base) || hasProtocol(input)) return input;
155
+ const _base = withoutTrailingSlash(base);
156
+ if (input.startsWith(_base)) {
157
+ const nextChar = input[_base.length];
158
+ if (!nextChar || nextChar === "/" || nextChar === "?") return input;
159
+ }
160
+ return joinURL(_base, input);
161
+ }
162
+ function withQuery(input, query) {
163
+ const parsed = parseURL(input);
164
+ parsed.search = stringifyQuery({
165
+ ...parseQuery(parsed.search),
166
+ ...query
167
+ });
168
+ return stringifyParsedURL(parsed);
169
+ }
170
+ function isEmptyURL(url) {
171
+ return !url || url === "/";
172
+ }
173
+ function isNonEmptyURL(url) {
174
+ return url && url !== "/";
175
+ }
176
+ function joinURL(base, ...input) {
177
+ let url = base || "";
178
+ for (const segment of input.filter((url2) => isNonEmptyURL(url2))) if (url) {
179
+ const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
180
+ url = withTrailingSlash(url) + _segment;
181
+ } else url = segment;
182
+ return url;
183
+ }
184
+ const protocolRelative = Symbol.for("ufo:protocolRelative");
185
+ function parseURL(input = "", defaultProto) {
186
+ const _specialProtoMatch = input.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);
187
+ if (_specialProtoMatch) {
188
+ const [, _proto, _pathname = ""] = _specialProtoMatch;
189
+ return {
190
+ protocol: _proto.toLowerCase(),
191
+ pathname: _pathname,
192
+ href: _proto + _pathname,
193
+ auth: "",
194
+ host: "",
195
+ search: "",
196
+ hash: ""
197
+ };
198
+ }
199
+ if (!hasProtocol(input, { acceptRelative: true })) return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
200
+ const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
201
+ let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
202
+ if (protocol === "file:") path = path.replace(/\/(?=[A-Za-z]:)/, "");
203
+ const { pathname, search, hash } = parsePath(path);
204
+ return {
205
+ protocol: protocol.toLowerCase(),
206
+ auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
207
+ host,
208
+ pathname,
209
+ search,
210
+ hash,
211
+ [protocolRelative]: !protocol
212
+ };
213
+ }
214
+ function parsePath(input = "") {
215
+ const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
216
+ return {
217
+ pathname,
218
+ search,
219
+ hash
220
+ };
221
+ }
222
+ function stringifyParsedURL(parsed) {
223
+ const pathname = parsed.pathname || "";
224
+ const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
225
+ const hash = parsed.hash || "";
226
+ const auth = parsed.auth ? parsed.auth + "@" : "";
227
+ const host = parsed.host || "";
228
+ return (parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "") + auth + host + pathname + search + hash;
229
+ }
57
230
  //#endregion
58
231
  //#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs
59
232
  var FetchError = class extends Error {
@@ -277,7 +450,7 @@ function createFetch(globalOptions = {}) {
277
450
  //#endregion
278
451
  //#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs
279
452
  function createNodeFetch() {
280
- if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return r;
453
+ if (!JSON.parse(process.env.FETCH_KEEP_ALIVE || "false")) return r$1;
281
454
  const agentOptions = { keepAlive: true };
282
455
  const httpAgent = new http.Agent(agentOptions);
283
456
  const httpsAgent = new https.Agent(agentOptions);
@@ -285,7 +458,7 @@ function createNodeFetch() {
285
458
  return parsedURL.protocol === "http:" ? httpAgent : httpsAgent;
286
459
  } };
287
460
  return function nodeFetchWithKeepAlive(input, init) {
288
- return r(input, {
461
+ return r$1(input, {
289
462
  ...nodeFetchOptions,
290
463
  ...init
291
464
  });
@@ -1,10 +1,10 @@
1
1
  const require_server = require("./server.cjs");
2
2
  let node_process = require("node:process");
3
- node_process = require_server.__toESM(node_process);
3
+ node_process = require_server.__toESM(node_process, 1);
4
4
  require("node:util");
5
5
  let node_tty = require("node:tty");
6
6
  let node_readline = require("node:readline");
7
- node_readline = require_server.__toESM(node_readline);
7
+ node_readline = require_server.__toESM(node_readline, 1);
8
8
  //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs
9
9
  function getDefaultExportFromCjs(x) {
10
10
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -596,10 +596,12 @@ let wD = class extends x {
596
596
  return this.options[this.cursor].value;
597
597
  }
598
598
  toggleAll() {
599
- this.value = this.value.length === this.options.length ? [] : this.options.map((F) => F.value);
599
+ const u = this.value.length === this.options.length;
600
+ this.value = u ? [] : this.options.map((F) => F.value);
600
601
  }
601
602
  toggleValue() {
602
- this.value = this.value.includes(this._value) ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
603
+ const u = this.value.includes(this._value);
604
+ this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
603
605
  }
604
606
  };
605
607
  var SD = Object.defineProperty, $D = (t, u, F) => u in t ? SD(t, u, {