@mrclrchtr/supi-code-intelligence 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 (138) hide show
  1. package/README.md +77 -21
  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/@mrclrchtr/supi-lsp/README.md +88 -2
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
  29. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
  30. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
  32. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  33. package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
  34. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
  35. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +3 -0
  36. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +6 -4
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-request-enrollment.ts +66 -22
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +37 -5
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +136 -43
  40. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +261 -22
  41. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +13 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-discovery.ts +151 -0
  43. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-normalizer.ts +97 -129
  44. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-protocol.ts +132 -0
  45. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +8 -1
  46. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +7 -20
  47. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +172 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +14 -0
  49. package/node_modules/@mrclrchtr/supi-lsp/src/utils.ts +12 -11
  50. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +63 -17
  51. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
  52. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
  53. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
  54. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
  55. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
  56. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
  57. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
  58. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
  59. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
  60. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
  61. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
  62. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
  63. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
  64. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
  65. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  66. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
  67. package/node_modules/@mrclrchtr/supi-tree-sitter/src/language.ts +16 -10
  68. package/node_modules/@mrclrchtr/supi-tree-sitter/src/operation-support.ts +13 -6
  69. package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +19 -1
  70. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-controller.ts +18 -4
  71. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/session.ts +10 -3
  72. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +17 -2
  73. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-process.ts +22 -5
  74. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-protocol.ts +36 -1
  75. package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +73 -0
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-node.ts +4 -0
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +15 -9
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +24 -15
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +8 -1
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/imports.ts +233 -7
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/node-at.ts +7 -3
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-expansion.ts +78 -0
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-jvm.ts +25 -4
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-nested.ts +390 -0
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline.ts +49 -28
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +16 -0
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/process-host.mjs +61 -24
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +44 -10
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/service.ts +13 -9
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/worker-main.ts +15 -2
  91. package/node_modules/ignore/README.md +61 -6
  92. package/node_modules/ignore/index.d.ts +55 -20
  93. package/node_modules/ignore/index.js +93 -67
  94. package/node_modules/ignore/legacy.js +109 -85
  95. package/node_modules/ignore/package.json +1 -1
  96. package/package.json +5 -5
  97. package/src/analysis/refactor/apply.ts +35 -14
  98. package/src/analysis/relations/callees.ts +9 -2
  99. package/src/analysis/relations/implementations.ts +7 -2
  100. package/src/analysis/search/pattern-analysis.ts +90 -12
  101. package/src/analysis/search/pattern.ts +1 -0
  102. package/src/analysis/target/anchored-structural.ts +1 -0
  103. package/src/analysis/target/discovery.ts +29 -0
  104. package/src/analysis/target/file.ts +19 -9
  105. package/src/analysis/target/types.ts +5 -0
  106. package/src/config.ts +46 -7
  107. package/src/session/graph/collect.ts +2 -2
  108. package/src/session/graph-types.ts +6 -0
  109. package/src/session/inspect/collect.ts +35 -20
  110. package/src/session/inspect-types.ts +9 -2
  111. package/src/session/orientation/collect.ts +90 -18
  112. package/src/session/orientation/context-sections.ts +22 -1
  113. package/src/session/orientation/gather.ts +46 -6
  114. package/src/session/orientation-types.ts +7 -1
  115. package/src/session/refactor-plans.ts +17 -0
  116. package/src/session/refactor-workflow.ts +13 -6
  117. package/src/session/target-store.ts +5 -0
  118. package/src/session/target-workflow.ts +3 -0
  119. package/src/substrate/workspace-provider-host.ts +22 -2
  120. package/src/tool/code_find/markdown.ts +17 -4
  121. package/src/tool/code_find/result.ts +17 -3
  122. package/src/tool/code_graph/details.ts +2 -0
  123. package/src/tool/code_graph/display.ts +1 -0
  124. package/src/tool/code_graph/format.ts +1 -0
  125. package/src/tool/code_graph/result.ts +32 -6
  126. package/src/tool/code_inspect/markdown.ts +15 -1
  127. package/src/tool/code_inspect/result.ts +11 -0
  128. package/src/tool/code_orientation/result.ts +4 -2
  129. package/src/tool/code_resolve/markdown.ts +34 -14
  130. package/src/tool/code_resolve/result.ts +7 -3
  131. package/src/tool/result/types.ts +20 -2
  132. package/src/ui/tui/display.ts +2 -1
  133. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/LICENSE-MIT +0 -21
  134. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/README.md +0 -501
  135. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.d.ts +0 -81
  136. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.js +0 -1566
  137. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/legacy.js +0 -1346
  138. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/package.json +0 -93
@@ -0,0 +1,403 @@
1
+ 'use strict';
2
+
3
+ const utils = require('./utils');
4
+ const {
5
+ CHAR_ASTERISK, /* * */
6
+ CHAR_AT, /* @ */
7
+ CHAR_BACKWARD_SLASH, /* \ */
8
+ CHAR_COMMA, /* , */
9
+ CHAR_DOT, /* . */
10
+ CHAR_EXCLAMATION_MARK, /* ! */
11
+ CHAR_FORWARD_SLASH, /* / */
12
+ CHAR_LEFT_CURLY_BRACE, /* { */
13
+ CHAR_LEFT_PARENTHESES, /* ( */
14
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
15
+ CHAR_PLUS, /* + */
16
+ CHAR_QUESTION_MARK, /* ? */
17
+ CHAR_RIGHT_CURLY_BRACE, /* } */
18
+ CHAR_RIGHT_PARENTHESES, /* ) */
19
+ CHAR_RIGHT_SQUARE_BRACKET /* ] */
20
+ } = require('./constants');
21
+
22
+ const isPathSeparator = code => {
23
+ return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
24
+ };
25
+
26
+ const depth = token => {
27
+ if (token.isPrefix !== true) {
28
+ token.depth = token.isGlobstar ? Infinity : 1;
29
+ }
30
+ };
31
+
32
+ /**
33
+ * Quickly scans a glob pattern and returns an object with a handful of
34
+ * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
35
+ * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
36
+ * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
37
+ *
38
+ * ```js
39
+ * const pm = require('picomatch');
40
+ * console.log(pm.scan('foo/bar/*.js'));
41
+ * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
42
+ * ```
43
+ * @param {String} `str`
44
+ * @param {Object} `options`
45
+ * @return {Object} Returns an object with tokens and regex source string.
46
+ * @api public
47
+ */
48
+
49
+ const scan = (input, options) => {
50
+ const opts = options || {};
51
+
52
+ const length = input.length - 1;
53
+ const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
54
+ const slashes = [];
55
+ const tokens = [];
56
+ const parts = [];
57
+
58
+ let str = input;
59
+ let index = -1;
60
+ let start = 0;
61
+ let lastIndex = 0;
62
+ let isBrace = false;
63
+ let isBracket = false;
64
+ let isGlob = false;
65
+ let isExtglob = false;
66
+ let isGlobstar = false;
67
+ let braceEscaped = false;
68
+ let backslashes = false;
69
+ let negated = false;
70
+ let negatedExtglob = false;
71
+ let finished = false;
72
+ let braces = 0;
73
+ let prev;
74
+ let code;
75
+ let token = { value: '', depth: 0, isGlob: false };
76
+
77
+ const eos = () => index >= length;
78
+ const peek = () => str.charCodeAt(index + 1);
79
+ const advance = () => {
80
+ prev = code;
81
+ return str.charCodeAt(++index);
82
+ };
83
+
84
+ while (index < length) {
85
+ code = advance();
86
+ let next;
87
+
88
+ if (code === CHAR_BACKWARD_SLASH) {
89
+ backslashes = token.backslashes = true;
90
+ code = advance();
91
+
92
+ if (code === CHAR_LEFT_CURLY_BRACE) {
93
+ braceEscaped = true;
94
+ }
95
+ continue;
96
+ }
97
+
98
+ if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
99
+ braces++;
100
+
101
+ while (eos() !== true && (code = advance())) {
102
+ if (code === CHAR_BACKWARD_SLASH) {
103
+ backslashes = token.backslashes = true;
104
+ advance();
105
+ continue;
106
+ }
107
+
108
+ if (code === CHAR_LEFT_CURLY_BRACE) {
109
+ braces++;
110
+ continue;
111
+ }
112
+
113
+ if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
114
+ isBrace = token.isBrace = true;
115
+ isGlob = token.isGlob = true;
116
+ finished = true;
117
+
118
+ if (scanToEnd === true) {
119
+ continue;
120
+ }
121
+
122
+ break;
123
+ }
124
+
125
+ if (braceEscaped !== true && code === CHAR_COMMA) {
126
+ isBrace = token.isBrace = true;
127
+ isGlob = token.isGlob = true;
128
+ finished = true;
129
+
130
+ if (scanToEnd === true) {
131
+ continue;
132
+ }
133
+
134
+ break;
135
+ }
136
+
137
+ if (code === CHAR_RIGHT_CURLY_BRACE) {
138
+ braces--;
139
+
140
+ if (braces === 0) {
141
+ braceEscaped = false;
142
+ isBrace = token.isBrace = true;
143
+ finished = true;
144
+ break;
145
+ }
146
+ }
147
+ }
148
+
149
+ if (scanToEnd === true) {
150
+ continue;
151
+ }
152
+
153
+ break;
154
+ }
155
+
156
+ if (code === CHAR_FORWARD_SLASH) {
157
+ slashes.push(index);
158
+ tokens.push(token);
159
+ token = { value: '', depth: 0, isGlob: false };
160
+
161
+ if (finished === true) continue;
162
+ if (prev === CHAR_DOT && index === (start + 1)) {
163
+ start += 2;
164
+ continue;
165
+ }
166
+
167
+ lastIndex = index + 1;
168
+ continue;
169
+ }
170
+
171
+ if (opts.noext !== true) {
172
+ const isExtglobChar = code === CHAR_PLUS
173
+ || code === CHAR_AT
174
+ || code === CHAR_ASTERISK
175
+ || code === CHAR_QUESTION_MARK
176
+ || code === CHAR_EXCLAMATION_MARK;
177
+
178
+ if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
179
+ isGlob = token.isGlob = true;
180
+ isExtglob = token.isExtglob = true;
181
+ finished = true;
182
+ if (code === CHAR_EXCLAMATION_MARK && index === start) {
183
+ negatedExtglob = true;
184
+ }
185
+
186
+ if (scanToEnd === true) {
187
+ let parens = 0;
188
+
189
+ while (eos() !== true && (code = advance())) {
190
+ if (code === CHAR_BACKWARD_SLASH) {
191
+ backslashes = token.backslashes = true;
192
+ advance();
193
+ continue;
194
+ }
195
+
196
+ if (code === CHAR_LEFT_PARENTHESES) {
197
+ parens++;
198
+ continue;
199
+ }
200
+
201
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
202
+ finished = true;
203
+ break;
204
+ }
205
+ }
206
+ continue;
207
+ }
208
+ break;
209
+ }
210
+ }
211
+
212
+ if (code === CHAR_ASTERISK) {
213
+ if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
214
+ isGlob = token.isGlob = true;
215
+ finished = true;
216
+
217
+ if (scanToEnd === true) {
218
+ continue;
219
+ }
220
+ break;
221
+ }
222
+
223
+ if (code === CHAR_QUESTION_MARK) {
224
+ isGlob = token.isGlob = true;
225
+ finished = true;
226
+
227
+ if (scanToEnd === true) {
228
+ continue;
229
+ }
230
+ break;
231
+ }
232
+
233
+ if (code === CHAR_LEFT_SQUARE_BRACKET) {
234
+ while (eos() !== true && (next = advance())) {
235
+ if (next === CHAR_BACKWARD_SLASH) {
236
+ backslashes = token.backslashes = true;
237
+ advance();
238
+ continue;
239
+ }
240
+
241
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
242
+ isBracket = token.isBracket = true;
243
+ isGlob = token.isGlob = true;
244
+ finished = true;
245
+ break;
246
+ }
247
+ }
248
+
249
+ if (scanToEnd === true) {
250
+ continue;
251
+ }
252
+
253
+ break;
254
+ }
255
+
256
+ if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
257
+ negated = token.negated = true;
258
+ start++;
259
+ continue;
260
+ }
261
+
262
+ if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
263
+ isGlob = token.isGlob = true;
264
+
265
+ if (scanToEnd === true) {
266
+ let parens = 1;
267
+
268
+ while (eos() !== true && (code = advance())) {
269
+ if (code === CHAR_BACKWARD_SLASH) {
270
+ backslashes = token.backslashes = true;
271
+ advance();
272
+ continue;
273
+ }
274
+
275
+ if (code === CHAR_LEFT_PARENTHESES) {
276
+ parens++;
277
+ continue;
278
+ }
279
+
280
+ if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
281
+ finished = true;
282
+ break;
283
+ }
284
+ }
285
+ continue;
286
+ }
287
+ break;
288
+ }
289
+
290
+ if (isGlob === true) {
291
+ finished = true;
292
+
293
+ if (scanToEnd === true) {
294
+ continue;
295
+ }
296
+
297
+ break;
298
+ }
299
+ }
300
+
301
+ if (opts.noext === true) {
302
+ isExtglob = false;
303
+ isGlob = false;
304
+ }
305
+
306
+ let base = str;
307
+ let prefix = '';
308
+ let glob = '';
309
+
310
+ if (start > 0) {
311
+ prefix = str.slice(0, start);
312
+ str = str.slice(start);
313
+ lastIndex -= start;
314
+ }
315
+
316
+ if (base && isGlob === true && lastIndex > 0) {
317
+ base = str.slice(0, lastIndex);
318
+ glob = str.slice(lastIndex);
319
+ } else if (isGlob === true) {
320
+ base = '';
321
+ glob = str;
322
+ } else {
323
+ base = str;
324
+ }
325
+
326
+ if (base && base !== '' && base !== '/' && base !== str) {
327
+ if (isPathSeparator(base.charCodeAt(base.length - 1))) {
328
+ base = base.slice(0, -1);
329
+ }
330
+ }
331
+
332
+ if (opts.unescape === true) {
333
+ if (glob) glob = utils.removeBackslashes(glob);
334
+
335
+ if (base && backslashes === true) {
336
+ base = utils.removeBackslashes(base);
337
+ }
338
+ }
339
+
340
+ const state = {
341
+ prefix,
342
+ input,
343
+ start,
344
+ base,
345
+ glob,
346
+ isBrace,
347
+ isBracket,
348
+ isGlob,
349
+ isExtglob,
350
+ isGlobstar,
351
+ negated,
352
+ negatedExtglob
353
+ };
354
+
355
+ if (opts.tokens === true) {
356
+ state.maxDepth = 0;
357
+ if (!isPathSeparator(code)) {
358
+ tokens.push(token);
359
+ }
360
+ state.tokens = tokens;
361
+ }
362
+
363
+ if (opts.parts === true || opts.tokens === true) {
364
+ let prevIndex;
365
+
366
+ for (let idx = 0; idx < slashes.length; idx++) {
367
+ const n = prevIndex !== undefined ? prevIndex + 1 : start;
368
+ const i = slashes[idx];
369
+ const value = input.slice(n, i);
370
+ if (opts.tokens) {
371
+ if (idx === 0 && start !== 0) {
372
+ tokens[idx].isPrefix = true;
373
+ tokens[idx].value = prefix;
374
+ } else {
375
+ tokens[idx].value = value;
376
+ }
377
+ depth(tokens[idx]);
378
+ state.maxDepth += tokens[idx].depth;
379
+ }
380
+ if (i >= start) {
381
+ parts.push(value);
382
+ prevIndex = i;
383
+ }
384
+ }
385
+
386
+ const n = prevIndex !== undefined ? prevIndex + 1 : start;
387
+ const value = input.slice(n);
388
+ parts.push(value);
389
+
390
+ if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
391
+ tokens[tokens.length - 1].value = value;
392
+ depth(tokens[tokens.length - 1]);
393
+ state.maxDepth += tokens[tokens.length - 1].depth;
394
+ }
395
+
396
+ state.slashes = slashes;
397
+ state.parts = parts;
398
+ }
399
+
400
+ return state;
401
+ };
402
+
403
+ module.exports = scan;
@@ -0,0 +1,72 @@
1
+ /*global navigator*/
2
+ 'use strict';
3
+
4
+ const {
5
+ REGEX_BACKSLASH,
6
+ REGEX_REMOVE_BACKSLASH,
7
+ REGEX_SPECIAL_CHARS,
8
+ REGEX_SPECIAL_CHARS_GLOBAL
9
+ } = require('./constants');
10
+
11
+ exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
12
+ exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
13
+ exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
14
+ exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
15
+ exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
16
+
17
+ exports.isWindows = () => {
18
+ if (typeof navigator !== 'undefined' && navigator.platform) {
19
+ const platform = navigator.platform.toLowerCase();
20
+ return platform === 'win32' || platform === 'windows';
21
+ }
22
+
23
+ if (typeof process !== 'undefined' && process.platform) {
24
+ return process.platform === 'win32';
25
+ }
26
+
27
+ return false;
28
+ };
29
+
30
+ exports.removeBackslashes = str => {
31
+ return str.replace(REGEX_REMOVE_BACKSLASH, match => {
32
+ return match === '\\' ? '' : match;
33
+ });
34
+ };
35
+
36
+ exports.escapeLast = (input, char, lastIdx) => {
37
+ const idx = input.lastIndexOf(char, lastIdx);
38
+ if (idx === -1) return input;
39
+ if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
40
+ return `${input.slice(0, idx)}\\${input.slice(idx)}`;
41
+ };
42
+
43
+ exports.removePrefix = (input, state = {}) => {
44
+ let output = input;
45
+ if (output.startsWith('./')) {
46
+ output = output.slice(2);
47
+ state.prefix = './';
48
+ }
49
+ return output;
50
+ };
51
+
52
+ exports.wrapOutput = (input, state = {}, options = {}) => {
53
+ const prepend = options.contains ? '' : '^';
54
+ const append = options.contains ? '' : '$';
55
+
56
+ let output = `${prepend}(?:${input})${append}`;
57
+ if (state.negated === true) {
58
+ output = `(?:^(?!${output}).*$)`;
59
+ }
60
+ return output;
61
+ };
62
+
63
+ exports.basename = (path, { windows } = {}) => {
64
+ const segs = path.split(windows ? /[\\/]/ : '/');
65
+ const last = segs[segs.length - 1];
66
+
67
+ if (last === '') {
68
+ return segs[segs.length - 2];
69
+ }
70
+
71
+ return last;
72
+ };
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "picomatch",
3
+ "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
4
+ "version": "4.0.7",
5
+ "homepage": "https://github.com/micromatch/picomatch",
6
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7
+ "funding": "https://github.com/sponsors/jonschlinkert",
8
+ "repository": "micromatch/picomatch",
9
+ "bugs": {
10
+ "url": "https://github.com/micromatch/picomatch/issues"
11
+ },
12
+ "license": "MIT",
13
+ "files": [
14
+ "index.js",
15
+ "posix.js",
16
+ "lib"
17
+ ],
18
+ "sideEffects": false,
19
+ "main": "index.js",
20
+ "engines": {
21
+ "node": ">=12"
22
+ },
23
+ "scripts": {
24
+ "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
25
+ "mocha": "mocha --reporter dot",
26
+ "test": "npm run lint && npm run mocha",
27
+ "test:ci": "npm run test:cover",
28
+ "test:cover": "nyc npm run mocha"
29
+ },
30
+ "devDependencies": {
31
+ "eslint": "^8.57.0",
32
+ "fill-range": "^7.0.1",
33
+ "gulp-format-md": "^2.0.0",
34
+ "mocha": "^10.4.0",
35
+ "nyc": "^15.1.0"
36
+ },
37
+ "keywords": [
38
+ "glob",
39
+ "match",
40
+ "picomatch"
41
+ ],
42
+ "nyc": {
43
+ "reporter": [
44
+ "html",
45
+ "lcov",
46
+ "text-summary",
47
+ "cobertura"
48
+ ]
49
+ },
50
+ "verb": {
51
+ "toc": {
52
+ "render": true,
53
+ "method": "preWrite",
54
+ "maxdepth": 3
55
+ },
56
+ "layout": "empty",
57
+ "tasks": [
58
+ "readme"
59
+ ],
60
+ "plugins": [
61
+ "gulp-format-md"
62
+ ],
63
+ "lint": {
64
+ "reflinks": true
65
+ },
66
+ "related": {
67
+ "list": [
68
+ "braces",
69
+ "micromatch"
70
+ ]
71
+ },
72
+ "reflinks": [
73
+ "braces",
74
+ "expand-brackets",
75
+ "extglob",
76
+ "fill-range",
77
+ "micromatch",
78
+ "minimatch",
79
+ "nanomatch",
80
+ "picomatch"
81
+ ]
82
+ }
83
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('./lib/picomatch');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "10.0.0",
3
+ "version": "11.0.1",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,9 @@
28
28
  "src/**/*.ts",
29
29
  "!__tests__"
30
30
  ],
31
+ "dependencies": {
32
+ "picomatch": "4.0.7"
33
+ },
31
34
  "main": "src/api.ts",
32
35
  "exports": {
33
36
  "./api": "./src/api.ts",
@@ -14,6 +14,17 @@ export type {
14
14
  StructuralProvider,
15
15
  StructuralResult,
16
16
  } from "./capability/types.ts";
17
+ export type {
18
+ CFamilyExtension,
19
+ CFamilyFileAssociationResolver,
20
+ CFamilyFileAssociationRule,
21
+ CFamilyLanguage,
22
+ } from "./file-associations.ts";
23
+ export {
24
+ C_FAMILY_EXTENSIONS,
25
+ createCFamilyFileAssociationResolver,
26
+ defaultCFamilyLanguage,
27
+ } from "./file-associations.ts";
17
28
  export type { CodeQueryPartialMetadata, CodeQueryResult } from "./query-result.ts";
18
29
  // Shared query-result constructors and contract
19
30
  export {