@yaegassy/coc-marksman 0.2.4 → 0.2.6

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.
Files changed (2) hide show
  1. package/lib/index.js +127 -4
  2. package/package.json +9 -9
package/lib/index.js CHANGED
@@ -21,6 +21,10 @@ var __copyProps = (to, from, except, desc) => {
21
21
  return to;
22
22
  };
23
23
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
28
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
29
  mod
26
30
  ));
@@ -165,8 +169,10 @@ var require_which = __commonJS({
165
169
  var getPathInfo = (cmd, opt) => {
166
170
  const colon = opt.colon || COLON;
167
171
  const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
172
+ // windows always checks the cwd first
168
173
  ...isWindows ? [process.cwd()] : [],
169
- ...(opt.path || process.env.PATH || "").split(colon)
174
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
175
+ "").split(colon)
170
176
  ];
171
177
  const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
172
178
  const pathExt = isWindows ? pathExtExe.split(colon) : [""];
@@ -1367,7 +1373,9 @@ var require_url_state_machine = __commonJS({
1367
1373
  this.url.fragment = "";
1368
1374
  this.state = "fragment";
1369
1375
  } else {
1370
- if (this.input.length - this.pointer - 1 === 0 || !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) {
1376
+ if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points
1377
+ !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points
1378
+ !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) {
1371
1379
  this.url.host = this.base.host;
1372
1380
  this.url.path = this.base.path.slice();
1373
1381
  shortenPath(this.url);
@@ -2203,15 +2211,26 @@ Body.prototype = {
2203
2211
  get bodyUsed() {
2204
2212
  return this[INTERNALS].disturbed;
2205
2213
  },
2214
+ /**
2215
+ * Decode response as ArrayBuffer
2216
+ *
2217
+ * @return Promise
2218
+ */
2206
2219
  arrayBuffer() {
2207
2220
  return consumeBody.call(this).then(function(buf) {
2208
2221
  return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
2209
2222
  });
2210
2223
  },
2224
+ /**
2225
+ * Return raw response as Blob
2226
+ *
2227
+ * @return Promise
2228
+ */
2211
2229
  blob() {
2212
2230
  let ct = this.headers && this.headers.get("content-type") || "";
2213
2231
  return consumeBody.call(this).then(function(buf) {
2214
2232
  return Object.assign(
2233
+ // Prevent copying
2215
2234
  new Blob([], {
2216
2235
  type: ct.toLowerCase()
2217
2236
  }),
@@ -2221,6 +2240,11 @@ Body.prototype = {
2221
2240
  );
2222
2241
  });
2223
2242
  },
2243
+ /**
2244
+ * Decode response as json
2245
+ *
2246
+ * @return Promise
2247
+ */
2224
2248
  json() {
2225
2249
  var _this2 = this;
2226
2250
  return consumeBody.call(this).then(function(buffer) {
@@ -2231,14 +2255,30 @@ Body.prototype = {
2231
2255
  }
2232
2256
  });
2233
2257
  },
2258
+ /**
2259
+ * Decode response as text
2260
+ *
2261
+ * @return Promise
2262
+ */
2234
2263
  text() {
2235
2264
  return consumeBody.call(this).then(function(buffer) {
2236
2265
  return buffer.toString();
2237
2266
  });
2238
2267
  },
2268
+ /**
2269
+ * Decode response as buffer (non-spec api)
2270
+ *
2271
+ * @return Promise
2272
+ */
2239
2273
  buffer() {
2240
2274
  return consumeBody.call(this);
2241
2275
  },
2276
+ /**
2277
+ * Decode response as text, while automatically detecting the encoding and
2278
+ * trying to decode to UTF-8 (non-spec api)
2279
+ *
2280
+ * @return Promise
2281
+ */
2242
2282
  textConverted() {
2243
2283
  var _this3 = this;
2244
2284
  return consumeBody.call(this).then(function(buffer) {
@@ -2422,7 +2462,8 @@ function getTotalBytes(instance) {
2422
2462
  } else if (Buffer.isBuffer(body)) {
2423
2463
  return body.length;
2424
2464
  } else if (body && typeof body.getLengthSync === "function") {
2425
- if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || body.hasKnownLength && body.hasKnownLength()) {
2465
+ if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
2466
+ body.hasKnownLength && body.hasKnownLength()) {
2426
2467
  return body.getLengthSync();
2427
2468
  }
2428
2469
  return null;
@@ -2469,6 +2510,12 @@ function find(map, name) {
2469
2510
  }
2470
2511
  var MAP = Symbol("map");
2471
2512
  var Headers = class {
2513
+ /**
2514
+ * Headers class
2515
+ *
2516
+ * @param Object headers Response headers
2517
+ * @return Void
2518
+ */
2472
2519
  constructor() {
2473
2520
  let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
2474
2521
  this[MAP] = /* @__PURE__ */ Object.create(null);
@@ -2513,6 +2560,12 @@ var Headers = class {
2513
2560
  throw new TypeError("Provided initializer must be an object");
2514
2561
  }
2515
2562
  }
2563
+ /**
2564
+ * Return combined header value given name
2565
+ *
2566
+ * @param String name Header name
2567
+ * @return Mixed
2568
+ */
2516
2569
  get(name) {
2517
2570
  name = `${name}`;
2518
2571
  validateName(name);
@@ -2522,6 +2575,13 @@ var Headers = class {
2522
2575
  }
2523
2576
  return this[MAP][key].join(", ");
2524
2577
  }
2578
+ /**
2579
+ * Iterate over all headers
2580
+ *
2581
+ * @param Function callback Executed for each item with parameters (value, name, thisArg)
2582
+ * @param Boolean thisArg `this` context for callback function
2583
+ * @return Void
2584
+ */
2525
2585
  forEach(callback) {
2526
2586
  let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0;
2527
2587
  let pairs = getHeaders(this);
@@ -2534,6 +2594,13 @@ var Headers = class {
2534
2594
  i++;
2535
2595
  }
2536
2596
  }
2597
+ /**
2598
+ * Overwrite header values given name
2599
+ *
2600
+ * @param String name Header name
2601
+ * @param String value Header value
2602
+ * @return Void
2603
+ */
2537
2604
  set(name, value) {
2538
2605
  name = `${name}`;
2539
2606
  value = `${value}`;
@@ -2542,6 +2609,13 @@ var Headers = class {
2542
2609
  const key = find(this[MAP], name);
2543
2610
  this[MAP][key !== void 0 ? key : name] = [value];
2544
2611
  }
2612
+ /**
2613
+ * Append a value onto existing header
2614
+ *
2615
+ * @param String name Header name
2616
+ * @param String value Header value
2617
+ * @return Void
2618
+ */
2545
2619
  append(name, value) {
2546
2620
  name = `${name}`;
2547
2621
  value = `${value}`;
@@ -2554,11 +2628,23 @@ var Headers = class {
2554
2628
  this[MAP][name] = [value];
2555
2629
  }
2556
2630
  }
2631
+ /**
2632
+ * Check for header name existence
2633
+ *
2634
+ * @param String name Header name
2635
+ * @return Boolean
2636
+ */
2557
2637
  has(name) {
2558
2638
  name = `${name}`;
2559
2639
  validateName(name);
2560
2640
  return find(this[MAP], name) !== void 0;
2561
2641
  }
2642
+ /**
2643
+ * Delete all header values given name
2644
+ *
2645
+ * @param String name Header name
2646
+ * @return Void
2647
+ */
2562
2648
  delete(name) {
2563
2649
  name = `${name}`;
2564
2650
  validateName(name);
@@ -2567,15 +2653,37 @@ var Headers = class {
2567
2653
  delete this[MAP][key];
2568
2654
  }
2569
2655
  }
2656
+ /**
2657
+ * Return raw headers (non-spec api)
2658
+ *
2659
+ * @return Object
2660
+ */
2570
2661
  raw() {
2571
2662
  return this[MAP];
2572
2663
  }
2664
+ /**
2665
+ * Get an iterator on keys.
2666
+ *
2667
+ * @return Iterator
2668
+ */
2573
2669
  keys() {
2574
2670
  return createHeadersIterator(this, "key");
2575
2671
  }
2672
+ /**
2673
+ * Get an iterator on values.
2674
+ *
2675
+ * @return Iterator
2676
+ */
2576
2677
  values() {
2577
2678
  return createHeadersIterator(this, "value");
2578
2679
  }
2680
+ /**
2681
+ * Get an iterator on entries.
2682
+ *
2683
+ * This is the default iterator of the Headers object.
2684
+ *
2685
+ * @return Iterator
2686
+ */
2579
2687
  [Symbol.iterator]() {
2580
2688
  return createHeadersIterator(this, "key+value");
2581
2689
  }
@@ -2707,6 +2815,9 @@ var Response = class {
2707
2815
  get status() {
2708
2816
  return this[INTERNALS$1].status;
2709
2817
  }
2818
+ /**
2819
+ * Convenience property representing if the request ended normally
2820
+ */
2710
2821
  get ok() {
2711
2822
  return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
2712
2823
  }
@@ -2719,6 +2830,11 @@ var Response = class {
2719
2830
  get headers() {
2720
2831
  return this[INTERNALS$1].headers;
2721
2832
  }
2833
+ /**
2834
+ * Clone this response
2835
+ *
2836
+ * @return Response
2837
+ */
2722
2838
  clone() {
2723
2839
  return new Response(clone(this), {
2724
2840
  url: this.url,
@@ -2828,6 +2944,11 @@ var Request = class {
2828
2944
  get signal() {
2829
2945
  return this[INTERNALS$2].signal;
2830
2946
  }
2947
+ /**
2948
+ * Clone this request
2949
+ *
2950
+ * @return Request
2951
+ */
2831
2952
  clone() {
2832
2953
  return new Request(this);
2833
2954
  }
@@ -3099,7 +3220,7 @@ var import_stream2 = __toESM(require("stream"));
3099
3220
  var import_util = require("util");
3100
3221
 
3101
3222
  // package.json
3102
- var marksmanBinVersion = "2022-12-23";
3223
+ var marksmanBinVersion = "2023-01-29";
3103
3224
 
3104
3225
  // src/constant.ts
3105
3226
  var MARKSMAN_BIN_VERSION = marksmanBinVersion;
@@ -3122,6 +3243,7 @@ var ExperimentalFeatures = class {
3122
3243
  experimental.statusNotification = true;
3123
3244
  capabilities.experimental = experimental;
3124
3245
  }
3246
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3125
3247
  initialize(_capabilities, _documentSelector) {
3126
3248
  }
3127
3249
  dispose() {
@@ -3275,6 +3397,7 @@ async function downloadServerFromGH(context) {
3275
3397
  cancellable: false,
3276
3398
  title: `Downloading marksman ${compatibleServerRelease} from GH`
3277
3399
  },
3400
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3278
3401
  async (progress, _cancellationToken) => {
3279
3402
  let lastPercent = 0;
3280
3403
  await downloadRelease(targetDir, (percent) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yaegassy/coc-marksman",
3
- "version": "0.2.4",
4
- "marksmanBinVersion": "2022-12-23",
3
+ "version": "0.2.6",
4
+ "marksmanBinVersion": "2023-01-29",
5
5
  "description": "Marksman (Markdown LSP server) extension for coc.nvim",
6
6
  "author": "yaegassy <yosstools@gmail.com>",
7
7
  "license": "MIT",
@@ -44,17 +44,17 @@
44
44
  "semi": true
45
45
  },
46
46
  "devDependencies": {
47
- "@types/node": "^18.11.17",
47
+ "@types/node": "^18.11.18",
48
48
  "@types/node-fetch": "^2.5.8",
49
49
  "@types/which": "^2.0.1",
50
- "@typescript-eslint/eslint-plugin": "^5.47.0",
51
- "@typescript-eslint/parser": "^5.47.0",
50
+ "@typescript-eslint/eslint-plugin": "^5.49.0",
51
+ "@typescript-eslint/parser": "^5.49.0",
52
52
  "coc.nvim": "^0.0.82",
53
- "esbuild": "^0.16.10",
54
- "eslint": "^8.30.0",
55
- "eslint-config-prettier": "^8.5.0",
53
+ "esbuild": "^0.16.17",
54
+ "eslint": "^8.33.0",
55
+ "eslint-config-prettier": "^8.6.0",
56
56
  "eslint-plugin-prettier": "^4.2.1",
57
- "prettier": "^2.8.1",
57
+ "prettier": "^2.8.3",
58
58
  "rimraf": "^3.0.2",
59
59
  "typescript": "^4.9.4"
60
60
  },