@mrclrchtr/supi-lsp 10.0.0 → 11.0.1

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 (38) hide show
  1. package/README.md +88 -2
  2. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
  3. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
  4. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
  6. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
  7. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
  8. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
  9. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
  10. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
  11. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
  12. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
  13. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
  14. package/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
  15. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
  16. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  17. package/node_modules/ignore/README.md +61 -6
  18. package/node_modules/ignore/index.d.ts +55 -20
  19. package/node_modules/ignore/index.js +93 -67
  20. package/node_modules/ignore/legacy.js +109 -85
  21. package/node_modules/ignore/package.json +1 -1
  22. package/package.json +3 -3
  23. package/src/api.ts +1 -0
  24. package/src/client/client-diagnostic-host.ts +3 -0
  25. package/src/client/client-diagnostics.ts +6 -4
  26. package/src/client/client-request-enrollment.ts +66 -22
  27. package/src/client/client-semantic-input-barrier.ts +37 -5
  28. package/src/client/client.ts +136 -43
  29. package/src/manager/manager.ts +261 -22
  30. package/src/provider/refactor-planning.ts +13 -0
  31. package/src/provider/semantic-edit-discovery.ts +151 -0
  32. package/src/provider/semantic-edit-normalizer.ts +97 -129
  33. package/src/provider/semantic-edit-protocol.ts +132 -0
  34. package/src/session/runtime-controller.ts +8 -1
  35. package/src/session/runtime-registry.ts +7 -20
  36. package/src/session/runtime-rename.ts +172 -0
  37. package/src/session/workspace-lsp-runtime.ts +14 -0
  38. package/src/utils.ts +12 -11
@@ -49,12 +49,6 @@ const define = (object, key, value) => {
49
49
 
50
50
  const RETURN_FALSE = () => false
51
51
 
52
- // See fixtures #59
53
- const cleanRangeBackSlash = slashes => {
54
- const {length} = slashes
55
- return slashes.slice(0, length - length % 2)
56
- }
57
-
58
52
  // > The range notation, e.g. [a-zA-Z],
59
53
  // > can be used to match one of the characters in a range.
60
54
  //
@@ -194,14 +188,14 @@ const scanBracket = (pattern, start) => {
194
188
  }
195
189
 
196
190
  if (end > nameStart && pattern[end - 1] === ':') {
197
- const expanded = POSIX_CLASSES[pattern.slice(nameStart, end - 1)]
191
+ const name = pattern.slice(nameStart, end - 1)
198
192
 
199
193
  // An unknown class name makes the whole pattern match nothing
200
- if (expanded === UNDEFINED) {
194
+ if (!Object.prototype.hasOwnProperty.call(POSIX_CLASSES, name)) {
201
195
  return null
202
196
  }
203
197
 
204
- body += expanded
198
+ body += POSIX_CLASSES[name]
205
199
  prev = EMPTY
206
200
  index = end
207
201
  } else {
@@ -245,9 +239,10 @@ const REGEX_RESTORE_PLACEHOLDER = new RegExp(
245
239
  // That is what keeps it apart from a user-escaped literal `\*`: the unescape
246
240
  // steps collapse the escaped one to the exact `\*` a wildcard would leave
247
241
  // behind, so by the time `_make` runs the two are otherwise the same string
248
- // and a literal star gets wrongly rewritten into a wildcard. This marker is a
249
- // private-use character no compiled pattern carries, and it never survives
250
- // into a `RegExp` -- `_make` always turns it back into a real wildcard first.
242
+ // and a literal star gets wrongly rewritten into a wildcard. The marker is a
243
+ // private-use character, and `extractBrackets` keeps one that came out of the
244
+ // pattern apart from it, so the only marker `_make` ever turns back into a
245
+ // real wildcard is the one this chain put there itself.
251
246
  const TRAILING_WILDCARD = '\uE000'
252
247
 
253
248
  // A trailing "/**" is deferred the same way, because `checkRegex` has to tell
@@ -255,6 +250,28 @@ const TRAILING_WILDCARD = '\uE000'
255
250
  // still never matches the folder itself (#21).
256
251
  const TRAILING_DOUBLESTAR = '\uE001'
257
252
 
253
+ // The three characters above mean something to the chain that builds the
254
+ // source rather than to the path, so one that came out of the pattern is
255
+ // held aside like a bracket expression instead of going straight out. Being
256
+ // held is what makes it safe: the restore runs after the step that anchors
257
+ // the source, so the character comes back in the middle of the source and
258
+ // not at its end, which is the one place `_make` and `checkSourceOf` look
259
+ // for a marker. Without it a pattern's own character lands where a pending
260
+ // marker sits, and `_make` turns it into a real trailing wildcard.
261
+ //
262
+ // It is held as a one-member class rather than bare, in both of the branches
263
+ // a reserved character can reach, so that the property can be
264
+ // read off this function alone -- a reserved character never goes out on
265
+ // its own -- rather than depending on where in the chain the restore
266
+ // happens to run. In the expression built here `[x]` matches exactly what
267
+ // `x` matches, none of the three being special to a regular expression or
268
+ // inside a class, so no test can tell the two apart: the class is insurance,
269
+ // and the paragraph above is the reason it is not needed.
270
+ const isReserved = char =>
271
+ char === PLACEHOLDER
272
+ || char === TRAILING_WILDCARD
273
+ || char === TRAILING_DOUBLESTAR
274
+
258
275
  // Replace every bracket expression with a placeholder the replacers below
259
276
  // leave alone, and translate it separately.
260
277
  const extractBrackets = pattern => {
@@ -279,12 +296,19 @@ const extractBrackets = pattern => {
279
296
  // `\1`, `\/` keep their regular-expression meaning, and would turn a
280
297
  // `\?` into `[^\/]`.
281
298
  //
282
- // Four escapes are left for the chain, each with dedicated handling it
283
- // would be wrong to bypass: `\*` (a literal star, told apart from a
284
- // wildcard by `TRAILING_WILDCARD` and the wildcard replacers), `\[`
285
- // (a literal bracket, the one `[` the bracket replacer still expects),
286
- // `\ ` (a quoted trailing space), and `\\` (a literal backslash). A
287
- // lone trailing backslash can reach here after line-ending cleanup.
299
+ // Three escapes are still left for the chain: `\*` (a literal star,
300
+ // told apart from a wildcard by `TRAILING_WILDCARD` and the wildcard
301
+ // replacers), `\[` (a literal bracket, the one `[` the bracket
302
+ // replacer still expects), and `\ ` (a quoted space, which one pass
303
+ // below rewrites in bulk -- holding each one aside instead costs more
304
+ // on a pattern built out of them). A lone trailing backslash can reach
305
+ // here after line-ending cleanup.
306
+ //
307
+ // A quoted backslash is not among them. The chain doubles every
308
+ // backslash, then takes the doubling back out again, and a quoted one
309
+ // standing next to a character the chain also escapes left the two
310
+ // counts sharing a run, so one of the escapes was lost. Held here as
311
+ // the literal it means, it never joins that run.
288
312
  const escaped = pattern[index + 1]
289
313
 
290
314
  if (
@@ -298,22 +322,21 @@ const extractBrackets = pattern => {
298
322
  escaped === '*'
299
323
  || escaped === '['
300
324
  || escaped === SPACE
301
- || escaped === ESCAPE
302
325
  ) {
303
326
  out += pattern.slice(index, index + 2)
304
327
  } else {
305
328
  out += hold(
306
329
  REGEX_LITERAL_SPECIAL.test(escaped)
307
330
  ? ESCAPE + escaped
308
- : escaped
331
+ : isReserved(escaped)
332
+ ? `[${escaped}]`
333
+ : escaped
309
334
  )
310
335
  }
311
336
 
312
337
  index += 2
313
- } else if (char === PLACEHOLDER) {
314
- // Hold a literal placeholder character aside as well, so that pattern
315
- // text can never be mistaken for a placeholder we emitted.
316
- out += hold(`[${PLACEHOLDER}]`)
338
+ } else if (isReserved(char)) {
339
+ out += hold(`[${char}]`)
317
340
  index ++
318
341
  } else if (char === '[') {
319
342
  const scanned = scanBracket(pattern, index)
@@ -559,23 +582,23 @@ const REPLACERS = [
559
582
  // trailing wildcard, held apart from a literal star
560
583
  [
561
584
  // The step above leaves a trailing `*` alone, so a single `\*` is all that
562
- // can be left at the end here. Whether it is a wildcard or a literal
563
- // turns on the backslashes the user put in front of it: the escaper has
564
- // since doubled every one, so what stands here is those `2N` doubled
565
- // backslashes and then the star's own escape. An even number of the
566
- // original `N` leaves the star unescaped -- a wildcard -- and an odd
567
- // number escapes it -- a literal. This runs while the two are still
568
- // distinct, before the unescape steps below collapse the literal onto
569
- // the very `\*` a wildcard leaves behind.
585
+ // can be left at the end here, and what stands in front of it says which
586
+ // kind it is. A wildcard arrives as the escaper wrote it, `\*` with
587
+ // nothing before it; a literal arrives as the user's own escape, which
588
+ // the escaper doubled, and then the star's own -- `\\` and then `\*`.
589
+ // There is no third case: every backslash still reaching the chain is
590
+ // one `\*`, `\[` or `\ ` carries itself, and each is followed by its
591
+ // own character, so a longer run can never form. This runs while the
592
+ // two are still distinct, before the unescape steps below collapse the
593
+ // literal onto the very `\*` a wildcard leaves behind.
570
594
  /(^|[^\\])((?:\\\\)*)\\\*$/,
571
595
 
572
596
  (match, p1, p2) =>
573
- // `p2` holds the doubled user backslashes; half of them is `N`.
574
- (p2.length / 2) % 2 === 0
597
+ p2 === EMPTY
575
598
  // A real wildcard: carry it to `_make` as the marker, so the unescape
576
599
  // steps and the trailing-wildcard rewrite can never mistake it for a
577
600
  // literal `\*` (nor the reverse).
578
- ? p1 + p2 + TRAILING_WILDCARD
601
+ ? p1 + TRAILING_WILDCARD
579
602
  // A literal star: leave it exactly as it stands for the unescape steps.
580
603
  : match,
581
604
  '*'
@@ -602,12 +625,12 @@ const REPLACERS = [
602
625
  // been held aside by `extractBrackets`, so the only `[` left in the
603
626
  // pattern is an escaped, literal one.
604
627
 
605
- // `\` is escaped by step 3
606
- /\\\[([^\]/]*?)(\\*)($|\])/g,
628
+ // A backslash could only stand at the end of the range if it quoted the
629
+ // `]`, and `\]` is held aside long before this.
630
+ /\\\[([^\]/]*?)($|\])/g,
607
631
 
608
- // '\\[bar]' -> '\\\\[bar\\]'
609
- (match, range, endEscape, close) =>
610
- `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`,
632
+ // '\\[bar]' -> '\\\\[bar]'
633
+ (match, range, close) => `\\[${range}${close}`,
611
634
  '['
612
635
  ],
613
636
 
@@ -678,23 +701,10 @@ const replaceTrailingDoublestar = () => '.+(?=$|\\/$)'
678
701
 
679
702
  const WILDCARD = '[^\\/]*'
680
703
 
681
- // Where a run of non-slash wildcards is split by single fixed characters --
682
- // `[^/]*x[^/]*y...` -- the engine has many equivalent ways to lay the
683
- // input across the wildcards, and on input that does not match it works
684
- // through all of them, so the time grows with the number of wildcards
685
- // rather than the length of the path. Every wildcard but the last in such a
686
- // run can be pinned to stop at the character that follows it, which leaves
687
- // one way to lay out the input and no rewinding, without changing which
688
- // paths match: the fixed characters still bound the count, and the last
689
- // wildcard still absorbs the rest.
690
- //
691
- // The source is read one token at a time -- a wildcard, a single-character
692
- // piece (a literal, an escape, a class), or a parenthesised group or anchor
693
- // that ends the run -- so only a genuine wildcard is touched.
694
-
695
- // The fixed pieces between the wildcard at `at` and the next wildcard of the
696
- // run, joined as they appear in the source. A run never holds two wildcards
697
- // in a row, so there is always at least one piece.
704
+ // The fixed piece between the wildcard at `at` and the next wildcard of the
705
+ // run: the tokens that separate them, joined as they appear in the source.
706
+ // A run never holds two wildcards in a row, so there is always at least one
707
+ // token.
698
708
  const separatorAfter = (run, at) => {
699
709
  let separator = EMPTY
700
710
 
@@ -705,6 +715,29 @@ const separatorAfter = (run, at) => {
705
715
  return separator
706
716
  }
707
717
 
718
+ // Where a run of non-slash wildcards is split by fixed pieces --
719
+ // `[^/]*ab[^/]*cd...` -- the engine has many equivalent ways to lay the
720
+ // input across the wildcards, and on input that does not match it works
721
+ // through all of them, so the time grows with the number of wildcards
722
+ // rather than the length of the path. Every wildcard but the last in such a
723
+ // run can be pinned to stop where the piece after it begins, which leaves
724
+ // one way to lay out the input and no rewinding, without changing which
725
+ // paths match: the fixed pieces still bound the count, and the last
726
+ // wildcard still absorbs the rest.
727
+ //
728
+ // A wildcard is pinned to the whole piece, never to the piece's first
729
+ // character. The pin leaves no way back, so a wildcard that stopped at that
730
+ // first character would hand over wherever the character happens to turn
731
+ // up, including the places the rest of the piece cannot follow -- which is
732
+ // how `f*o/*/*` came to miss `foo/b/c`, the first `o` of `foo` not being
733
+ // the one the `o/` after it needs. Every token of a piece matches exactly
734
+ // one character, so the first place the whole piece fits is the leftmost
735
+ // place it can sit, and whatever is left over goes to the wildcards that
736
+ // follow.
737
+ //
738
+ // The source is read one token at a time -- a wildcard, a single-character
739
+ // piece (a literal, an escape, a class), or a parenthesised group or anchor
740
+ // that ends the run -- so only a genuine wildcard is touched.
708
741
  const pinWildcards = source => {
709
742
  if (source.indexOf(WILDCARD) < 0) {
710
743
  return source
@@ -792,16 +825,9 @@ const pinWildcards = source => {
792
825
  return
793
826
  }
794
827
 
795
- // A wildcard that is not the last in the run is pinned to the whole
796
- // fixed piece that separates it from the next wildcard, not just to
797
- // that piece's first character: stopping at the first character alone
798
- // would let the wildcard hand over at a place where the rest of the
799
- // separator cannot follow, and the pin leaves no way back, so
800
- // `f*o/*/*` would miss `foo/b/c` -- the first `o` of `foo` is not the
801
- // one the `o/` after it needs. Every piece matches exactly one
802
- // character, so pinning to the first place the whole separator fits
803
- // is the leftmost place it can sit, and the wildcards that follow
804
- // take up whatever is left.
828
+ // Every wildcard but the last is pinned to the whole piece that
829
+ // follows it, for the reason set out above this function. The last
830
+ // one stays as it is and takes up the rest.
805
831
  out += at === lastWildcard
806
832
  ? WILDCARD
807
833
  : `(?:(?!${separatorAfter(run, at)})[^\\/])*`
@@ -60,12 +60,6 @@ var RETURN_FALSE = function RETURN_FALSE() {
60
60
  return false;
61
61
  };
62
62
 
63
- // See fixtures #59
64
- var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {
65
- var length = slashes.length;
66
- return slashes.slice(0, length - length % 2);
67
- };
68
-
69
63
  // > The range notation, e.g. [a-zA-Z],
70
64
  // > can be used to match one of the characters in a range.
71
65
  //
@@ -187,13 +181,13 @@ var scanBracket = function scanBracket(pattern, start) {
187
181
  return null;
188
182
  }
189
183
  if (end > nameStart && pattern[end - 1] === ':') {
190
- var expanded = POSIX_CLASSES[pattern.slice(nameStart, end - 1)];
184
+ var name = pattern.slice(nameStart, end - 1);
191
185
 
192
186
  // An unknown class name makes the whole pattern match nothing
193
- if (expanded === UNDEFINED) {
187
+ if (!Object.prototype.hasOwnProperty.call(POSIX_CLASSES, name)) {
194
188
  return null;
195
189
  }
196
- body += expanded;
190
+ body += POSIX_CLASSES[name];
197
191
  prev = EMPTY;
198
192
  index = end;
199
193
  } else {
@@ -233,9 +227,10 @@ var REGEX_RESTORE_PLACEHOLDER = new RegExp("".concat(PLACEHOLDER, "(\\d+)").conc
233
227
  // That is what keeps it apart from a user-escaped literal `\*`: the unescape
234
228
  // steps collapse the escaped one to the exact `\*` a wildcard would leave
235
229
  // behind, so by the time `_make` runs the two are otherwise the same string
236
- // and a literal star gets wrongly rewritten into a wildcard. This marker is a
237
- // private-use character no compiled pattern carries, and it never survives
238
- // into a `RegExp` -- `_make` always turns it back into a real wildcard first.
230
+ // and a literal star gets wrongly rewritten into a wildcard. The marker is a
231
+ // private-use character, and `extractBrackets` keeps one that came out of the
232
+ // pattern apart from it, so the only marker `_make` ever turns back into a
233
+ // real wildcard is the one this chain put there itself.
239
234
  var TRAILING_WILDCARD = "\uE000";
240
235
 
241
236
  // A trailing "/**" is deferred the same way, because `checkRegex` has to tell
@@ -243,6 +238,27 @@ var TRAILING_WILDCARD = "\uE000";
243
238
  // still never matches the folder itself (#21).
244
239
  var TRAILING_DOUBLESTAR = "\uE001";
245
240
 
241
+ // The three characters above mean something to the chain that builds the
242
+ // source rather than to the path, so one that came out of the pattern is
243
+ // held aside like a bracket expression instead of going straight out. Being
244
+ // held is what makes it safe: the restore runs after the step that anchors
245
+ // the source, so the character comes back in the middle of the source and
246
+ // not at its end, which is the one place `_make` and `checkSourceOf` look
247
+ // for a marker. Without it a pattern's own character lands where a pending
248
+ // marker sits, and `_make` turns it into a real trailing wildcard.
249
+ //
250
+ // It is held as a one-member class rather than bare, in both of the branches
251
+ // a reserved character can reach, so that the property can be
252
+ // read off this function alone -- a reserved character never goes out on
253
+ // its own -- rather than depending on where in the chain the restore
254
+ // happens to run. In the expression built here `[x]` matches exactly what
255
+ // `x` matches, none of the three being special to a regular expression or
256
+ // inside a class, so no test can tell the two apart: the class is insurance,
257
+ // and the paragraph above is the reason it is not needed.
258
+ var isReserved = function isReserved(_char3) {
259
+ return _char3 === PLACEHOLDER || _char3 === TRAILING_WILDCARD || _char3 === TRAILING_DOUBLESTAR;
260
+ };
261
+
246
262
  // Replace every bracket expression with a placeholder the replacers below
247
263
  // leave alone, and translate it separately.
248
264
  var extractBrackets = function extractBrackets(pattern) {
@@ -254,8 +270,8 @@ var extractBrackets = function extractBrackets(pattern) {
254
270
  var out = EMPTY;
255
271
  var index = 0;
256
272
  while (index < length) {
257
- var _char3 = pattern[index];
258
- if (_char3 === ESCAPE) {
273
+ var _char4 = pattern[index];
274
+ if (_char4 === ESCAPE) {
259
275
  // > Put a backslash ("\") in front of ... a character to make it literal.
260
276
  // (gitignore(5) -> fnmatch(3))
261
277
  // A backslash quotes the next character, whatever it is, so `\d` is a
@@ -265,29 +281,34 @@ var extractBrackets = function extractBrackets(pattern) {
265
281
  // `\1`, `\/` keep their regular-expression meaning, and would turn a
266
282
  // `\?` into `[^\/]`.
267
283
  //
268
- // Four escapes are left for the chain, each with dedicated handling it
269
- // would be wrong to bypass: `\*` (a literal star, told apart from a
270
- // wildcard by `TRAILING_WILDCARD` and the wildcard replacers), `\[`
271
- // (a literal bracket, the one `[` the bracket replacer still expects),
272
- // `\ ` (a quoted trailing space), and `\\` (a literal backslash). A
273
- // lone trailing backslash can reach here after line-ending cleanup.
284
+ // Three escapes are still left for the chain: `\*` (a literal star,
285
+ // told apart from a wildcard by `TRAILING_WILDCARD` and the wildcard
286
+ // replacers), `\[` (a literal bracket, the one `[` the bracket
287
+ // replacer still expects), and `\ ` (a quoted space, which one pass
288
+ // below rewrites in bulk -- holding each one aside instead costs more
289
+ // on a pattern built out of them). A lone trailing backslash can reach
290
+ // here after line-ending cleanup.
291
+ //
292
+ // A quoted backslash is not among them. The chain doubles every
293
+ // backslash, then takes the doubling back out again, and a quoted one
294
+ // standing next to a character the chain also escapes left the two
295
+ // counts sharing a run, so one of the escapes was lost. Held here as
296
+ // the literal it means, it never joins that run.
274
297
  var escaped = pattern[index + 1];
275
298
  if (escaped === UNDEFINED || escaped === SLASH && index + 2 === length) {
276
299
  // Git removes a final directory slash before matching. An escape
277
300
  // without a character after that removal makes the pattern invalid.
278
301
  out += hold(NEVER_MATCH);
279
- } else if (escaped === '*' || escaped === '[' || escaped === SPACE || escaped === ESCAPE) {
302
+ } else if (escaped === '*' || escaped === '[' || escaped === SPACE) {
280
303
  out += pattern.slice(index, index + 2);
281
304
  } else {
282
- out += hold(REGEX_LITERAL_SPECIAL.test(escaped) ? ESCAPE + escaped : escaped);
305
+ out += hold(REGEX_LITERAL_SPECIAL.test(escaped) ? ESCAPE + escaped : isReserved(escaped) ? "[".concat(escaped, "]") : escaped);
283
306
  }
284
307
  index += 2;
285
- } else if (_char3 === PLACEHOLDER) {
286
- // Hold a literal placeholder character aside as well, so that pattern
287
- // text can never be mistaken for a placeholder we emitted.
288
- out += hold("[".concat(PLACEHOLDER, "]"));
308
+ } else if (isReserved(_char4)) {
309
+ out += hold("[".concat(_char4, "]"));
289
310
  index++;
290
- } else if (_char3 === '[') {
311
+ } else if (_char4 === '[') {
291
312
  var scanned = scanBracket(pattern, index);
292
313
  if (scanned === null) {
293
314
  // git gives up on the whole pattern (`WM_ABORT_ALL`), so whatever
@@ -299,7 +320,7 @@ var extractBrackets = function extractBrackets(pattern) {
299
320
  index = scanned.end + 1;
300
321
  }
301
322
  } else {
302
- out += _char3;
323
+ out += _char4;
303
324
  index++;
304
325
  }
305
326
  }
@@ -499,25 +520,23 @@ function (_, p1, p2) {
499
520
  // trailing wildcard, held apart from a literal star
500
521
  [
501
522
  // The step above leaves a trailing `*` alone, so a single `\*` is all that
502
- // can be left at the end here. Whether it is a wildcard or a literal
503
- // turns on the backslashes the user put in front of it: the escaper has
504
- // since doubled every one, so what stands here is those `2N` doubled
505
- // backslashes and then the star's own escape. An even number of the
506
- // original `N` leaves the star unescaped -- a wildcard -- and an odd
507
- // number escapes it -- a literal. This runs while the two are still
508
- // distinct, before the unescape steps below collapse the literal onto
509
- // the very `\*` a wildcard leaves behind.
523
+ // can be left at the end here, and what stands in front of it says which
524
+ // kind it is. A wildcard arrives as the escaper wrote it, `\*` with
525
+ // nothing before it; a literal arrives as the user's own escape, which
526
+ // the escaper doubled, and then the star's own -- `\\` and then `\*`.
527
+ // There is no third case: every backslash still reaching the chain is
528
+ // one `\*`, `\[` or `\ ` carries itself, and each is followed by its
529
+ // own character, so a longer run can never form. This runs while the
530
+ // two are still distinct, before the unescape steps below collapse the
531
+ // literal onto the very `\*` a wildcard leaves behind.
510
532
  /(^|[^\\])((?:\\\\)*)\\\*$/, function (match, p1, p2) {
511
- return (
512
- // `p2` holds the doubled user backslashes; half of them is `N`.
513
- p2.length / 2 % 2 === 0
514
- // A real wildcard: carry it to `_make` as the marker, so the unescape
515
- // steps and the trailing-wildcard rewrite can never mistake it for a
516
- // literal `\*` (nor the reverse).
517
- ? p1 + p2 + TRAILING_WILDCARD
518
- // A literal star: leave it exactly as it stands for the unescape steps.
519
- : match
520
- );
533
+ return p2 === EMPTY
534
+ // A real wildcard: carry it to `_make` as the marker, so the unescape
535
+ // steps and the trailing-wildcard rewrite can never mistake it for a
536
+ // literal `\*` (nor the reverse).
537
+ ? p1 + TRAILING_WILDCARD
538
+ // A literal star: leave it exactly as it stands for the unescape steps.
539
+ : match;
521
540
  }, '*'], [
522
541
  // unescape, revert step 3 except for back slash
523
542
  // For example, if a user escape a '\\*',
@@ -533,11 +552,12 @@ function (_, p1, p2) {
533
552
  // been held aside by `extractBrackets`, so the only `[` left in the
534
553
  // pattern is an escaped, literal one.
535
554
 
536
- // `\` is escaped by step 3
537
- /\\\[([^\]/]*?)(\\*)($|\])/g,
538
- // '\\[bar]' -> '\\\\[bar\\]'
539
- function (match, range, endEscape, close) {
540
- return "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close);
555
+ // A backslash could only stand at the end of the range if it quoted the
556
+ // `]`, and `\]` is held aside long before this.
557
+ /\\\[([^\]/]*?)($|\])/g,
558
+ // '\\[bar]' -> '\\\\[bar]'
559
+ function (match, range, close) {
560
+ return "\\[".concat(range).concat(close);
541
561
  }, '['],
542
562
  // ending
543
563
  [
@@ -596,30 +616,41 @@ var replaceTrailingDoublestar = function replaceTrailingDoublestar() {
596
616
  };
597
617
  var WILDCARD = '[^\\/]*';
598
618
 
599
- // Where a run of non-slash wildcards is split by single fixed characters --
600
- // `[^/]*x[^/]*y...` -- the engine has many equivalent ways to lay the
619
+ // The fixed piece between the wildcard at `at` and the next wildcard of the
620
+ // run: the tokens that separate them, joined as they appear in the source.
621
+ // A run never holds two wildcards in a row, so there is always at least one
622
+ // token.
623
+ var separatorAfter = function separatorAfter(run, at) {
624
+ var separator = EMPTY;
625
+ for (var index = at + 1; index < run.length && !run[index].wildcard; index++) {
626
+ separator += run[index].single;
627
+ }
628
+ return separator;
629
+ };
630
+
631
+ // Where a run of non-slash wildcards is split by fixed pieces --
632
+ // `[^/]*ab[^/]*cd...` -- the engine has many equivalent ways to lay the
601
633
  // input across the wildcards, and on input that does not match it works
602
634
  // through all of them, so the time grows with the number of wildcards
603
635
  // rather than the length of the path. Every wildcard but the last in such a
604
- // run can be pinned to stop at the character that follows it, which leaves
636
+ // run can be pinned to stop where the piece after it begins, which leaves
605
637
  // one way to lay out the input and no rewinding, without changing which
606
- // paths match: the fixed characters still bound the count, and the last
638
+ // paths match: the fixed pieces still bound the count, and the last
607
639
  // wildcard still absorbs the rest.
608
640
  //
641
+ // A wildcard is pinned to the whole piece, never to the piece's first
642
+ // character. The pin leaves no way back, so a wildcard that stopped at that
643
+ // first character would hand over wherever the character happens to turn
644
+ // up, including the places the rest of the piece cannot follow -- which is
645
+ // how `f*o/*/*` came to miss `foo/b/c`, the first `o` of `foo` not being
646
+ // the one the `o/` after it needs. Every token of a piece matches exactly
647
+ // one character, so the first place the whole piece fits is the leftmost
648
+ // place it can sit, and whatever is left over goes to the wildcards that
649
+ // follow.
650
+ //
609
651
  // The source is read one token at a time -- a wildcard, a single-character
610
652
  // piece (a literal, an escape, a class), or a parenthesised group or anchor
611
653
  // that ends the run -- so only a genuine wildcard is touched.
612
-
613
- // The fixed pieces between the wildcard at `at` and the next wildcard of the
614
- // run, joined as they appear in the source. A run never holds two wildcards
615
- // in a row, so there is always at least one piece.
616
- var separatorAfter = function separatorAfter(run, at) {
617
- var separator = EMPTY;
618
- for (var index = at + 1; index < run.length && !run[index].wildcard; index++) {
619
- separator += run[index].single;
620
- }
621
- return separator;
622
- };
623
654
  var pinWildcards = function pinWildcards(source) {
624
655
  if (source.indexOf(WILDCARD) < 0) {
625
656
  return source;
@@ -628,13 +659,13 @@ var pinWildcards = function pinWildcards(source) {
628
659
  var length = source.length;
629
660
  var index = 0;
630
661
  while (index < length) {
631
- var _char4 = source[index];
662
+ var _char5 = source[index];
632
663
  if (source.startsWith(WILDCARD, index)) {
633
664
  tokens.push({
634
665
  wildcard: true
635
666
  });
636
667
  index += WILDCARD.length;
637
- } else if (_char4 === '[') {
668
+ } else if (_char5 === '[') {
638
669
  var end = index + 1;
639
670
  if (source[end] === '^') {
640
671
  end++;
@@ -650,12 +681,12 @@ var pinWildcards = function pinWildcards(source) {
650
681
  single: source.slice(index, end)
651
682
  });
652
683
  index = end;
653
- } else if (_char4 === ESCAPE) {
684
+ } else if (_char5 === ESCAPE) {
654
685
  tokens.push({
655
686
  single: source.slice(index, index + 2)
656
687
  });
657
688
  index += 2;
658
- } else if (_char4 === '(') {
689
+ } else if (_char5 === '(') {
659
690
  var depth = 0;
660
691
  var _end = index;
661
692
  do {
@@ -675,14 +706,14 @@ var pinWildcards = function pinWildcards(source) {
675
706
  boundary: source.slice(index, _end)
676
707
  });
677
708
  index = _end;
678
- } else if (_char4 === '^' || _char4 === '$') {
709
+ } else if (_char5 === '^' || _char5 === '$') {
679
710
  tokens.push({
680
- boundary: _char4
711
+ boundary: _char5
681
712
  });
682
713
  index++;
683
714
  } else {
684
715
  tokens.push({
685
- single: _char4
716
+ single: _char5
686
717
  });
687
718
  index++;
688
719
  }
@@ -702,16 +733,9 @@ var pinWildcards = function pinWildcards(source) {
702
733
  return;
703
734
  }
704
735
 
705
- // A wildcard that is not the last in the run is pinned to the whole
706
- // fixed piece that separates it from the next wildcard, not just to
707
- // that piece's first character: stopping at the first character alone
708
- // would let the wildcard hand over at a place where the rest of the
709
- // separator cannot follow, and the pin leaves no way back, so
710
- // `f*o/*/*` would miss `foo/b/c` -- the first `o` of `foo` is not the
711
- // one the `o/` after it needs. Every piece matches exactly one
712
- // character, so pinning to the first place the whole separator fits
713
- // is the leftmost place it can sit, and the wildcards that follow
714
- // take up whatever is left.
736
+ // Every wildcard but the last is pinned to the whole piece that
737
+ // follows it, for the reason set out above this function. The last
738
+ // one stays as it is and takes up the rest.
715
739
  out += at === lastWildcard ? WILDCARD : "(?:(?!".concat(separatorAfter(run, at), ")[^\\/])*");
716
740
  });
717
741
  run = [];
@@ -890,8 +914,8 @@ var IgnoreRule = /*#__PURE__*/function () {
890
914
  }]);
891
915
  return IgnoreRule;
892
916
  }();
893
- var isLineEnd = function isLineEnd(_char5) {
894
- return _char5 === '\r' || _char5 === '\n';
917
+ var isLineEnd = function isLineEnd(_char6) {
918
+ return _char6 === '\r' || _char6 === '\n';
895
919
  };
896
920
 
897
921
  // Drop a line terminator, which can remain when patterns are passed as an
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ignore",
3
- "version": "7.0.12",
3
+ "version": "7.0.13",
4
4
  "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.",
5
5
  "types": "index.d.ts",
6
6
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-lsp",
3
- "version": "10.0.0",
3
+ "version": "11.0.1",
4
4
  "description": "Language Server Protocol runtime for SuPi code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "vscode-jsonrpc": "^9.0.0",
38
38
  "vscode-languageserver-protocol": "^3.18.0",
39
39
  "vscode-languageserver-types": "^3.18.0",
40
- "@mrclrchtr/supi-code-runtime": "10.0.0",
41
- "@mrclrchtr/supi-core": "10.0.0"
40
+ "@mrclrchtr/supi-core": "11.0.1",
41
+ "@mrclrchtr/supi-code-runtime": "11.0.1"
42
42
  },
43
43
  "bundledDependencies": [
44
44
  "@mrclrchtr/supi-code-runtime",
package/src/api.ts CHANGED
@@ -91,6 +91,7 @@ export type {
91
91
  ProcessCrashRecoveryOutcome,
92
92
  ProcessCrashRecoveryReport,
93
93
  RecoverDiagnosticsResult,
94
+ RoutedMutationDocumentSnapshot,
94
95
  RoutedMutationResponse,
95
96
  SemanticReadinessResult,
96
97
  StartupRetryEntry,