@vibecheck-ai/mcp 24.0.0 → 24.0.2
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/dist/index.js +684 -596
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -515,12 +515,12 @@ var require_to_regex_range = __commonJS({
|
|
|
515
515
|
}
|
|
516
516
|
return `(?:${result})`;
|
|
517
517
|
}
|
|
518
|
-
let
|
|
518
|
+
let isPadded2 = hasPadding(min2) || hasPadding(max2);
|
|
519
519
|
let state = { min: min2, max: max2, a, b };
|
|
520
520
|
let positives = [];
|
|
521
521
|
let negatives = [];
|
|
522
|
-
if (
|
|
523
|
-
state.isPadded =
|
|
522
|
+
if (isPadded2) {
|
|
523
|
+
state.isPadded = isPadded2;
|
|
524
524
|
state.maxLen = String(state.max).length;
|
|
525
525
|
}
|
|
526
526
|
if (a < 0) {
|
|
@@ -811,21 +811,21 @@ var require_fill_range = __commonJS({
|
|
|
811
811
|
}
|
|
812
812
|
let parts2 = { negatives: [], positives: [] };
|
|
813
813
|
let push = (num) => parts2[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
814
|
-
let
|
|
814
|
+
let range2 = [];
|
|
815
815
|
let index2 = 0;
|
|
816
816
|
while (descending ? a >= b : a <= b) {
|
|
817
817
|
if (options.toRegex === true && step > 1) {
|
|
818
818
|
push(a);
|
|
819
819
|
} else {
|
|
820
|
-
|
|
820
|
+
range2.push(pad(format(a, index2), maxLen, toNumber));
|
|
821
821
|
}
|
|
822
822
|
a = descending ? a - step : a + step;
|
|
823
823
|
index2++;
|
|
824
824
|
}
|
|
825
825
|
if (options.toRegex === true) {
|
|
826
|
-
return step > 1 ? toSequence(parts2, options, maxLen) : toRegex(
|
|
826
|
+
return step > 1 ? toSequence(parts2, options, maxLen) : toRegex(range2, null, { wrap: false, ...options });
|
|
827
827
|
}
|
|
828
|
-
return
|
|
828
|
+
return range2;
|
|
829
829
|
};
|
|
830
830
|
var fillLetters = (start2, end, step = 1, options = {}) => {
|
|
831
831
|
if (!isNumber(start2) && start2.length > 1 || !isNumber(end) && end.length > 1) {
|
|
@@ -840,17 +840,17 @@ var require_fill_range = __commonJS({
|
|
|
840
840
|
if (options.toRegex && step === 1) {
|
|
841
841
|
return toRange(min2, max2, false, options);
|
|
842
842
|
}
|
|
843
|
-
let
|
|
843
|
+
let range2 = [];
|
|
844
844
|
let index2 = 0;
|
|
845
845
|
while (descending ? a >= b : a <= b) {
|
|
846
|
-
|
|
846
|
+
range2.push(format(a, index2));
|
|
847
847
|
a = descending ? a - step : a + step;
|
|
848
848
|
index2++;
|
|
849
849
|
}
|
|
850
850
|
if (options.toRegex === true) {
|
|
851
|
-
return toRegex(
|
|
851
|
+
return toRegex(range2, null, { wrap: false, options });
|
|
852
852
|
}
|
|
853
|
-
return
|
|
853
|
+
return range2;
|
|
854
854
|
};
|
|
855
855
|
var fill = (start2, end, step, options = {}) => {
|
|
856
856
|
if (end == null && isValidValue(start2)) {
|
|
@@ -915,9 +915,9 @@ var require_compile = __commonJS({
|
|
|
915
915
|
}
|
|
916
916
|
if (node.nodes && node.ranges > 0) {
|
|
917
917
|
const args2 = utils.reduce(node.nodes);
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
return args2.length > 1 &&
|
|
918
|
+
const range2 = fill(...args2, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
919
|
+
if (range2.length !== 0) {
|
|
920
|
+
return args2.length > 1 && range2.length > 1 ? `(${range2})` : range2;
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
923
|
if (node.nodes) {
|
|
@@ -985,11 +985,11 @@ var require_expand = __commonJS({
|
|
|
985
985
|
if (utils.exceedsLimit(...args2, options.step, rangeLimit)) {
|
|
986
986
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
987
987
|
}
|
|
988
|
-
let
|
|
989
|
-
if (
|
|
990
|
-
|
|
988
|
+
let range2 = fill(...args2, options);
|
|
989
|
+
if (range2.length === 0) {
|
|
990
|
+
range2 = stringify(node, options);
|
|
991
991
|
}
|
|
992
|
-
q.push(append(q.pop(),
|
|
992
|
+
q.push(append(q.pop(), range2));
|
|
993
993
|
node.nodes = [];
|
|
994
994
|
return;
|
|
995
995
|
}
|
|
@@ -2418,17 +2418,17 @@ var require_parse2 = __commonJS({
|
|
|
2418
2418
|
let output = ")";
|
|
2419
2419
|
if (brace.dots === true) {
|
|
2420
2420
|
const arr = tokens.slice();
|
|
2421
|
-
const
|
|
2421
|
+
const range2 = [];
|
|
2422
2422
|
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
2423
2423
|
tokens.pop();
|
|
2424
2424
|
if (arr[i2].type === "brace") {
|
|
2425
2425
|
break;
|
|
2426
2426
|
}
|
|
2427
2427
|
if (arr[i2].type !== "dots") {
|
|
2428
|
-
|
|
2428
|
+
range2.unshift(arr[i2].value);
|
|
2429
2429
|
}
|
|
2430
2430
|
}
|
|
2431
|
-
output = expandRange(
|
|
2431
|
+
output = expandRange(range2, opts);
|
|
2432
2432
|
state.backtrack = true;
|
|
2433
2433
|
}
|
|
2434
2434
|
if (brace.comma !== true && brace.dots !== true) {
|
|
@@ -12744,9 +12744,9 @@ ${lanes.join("\n")}
|
|
|
12744
12744
|
static tryParse(text) {
|
|
12745
12745
|
const sets = parseRange(text);
|
|
12746
12746
|
if (sets) {
|
|
12747
|
-
const
|
|
12748
|
-
|
|
12749
|
-
return
|
|
12747
|
+
const range2 = new _VersionRange("");
|
|
12748
|
+
range2._alternatives = sets;
|
|
12749
|
+
return range2;
|
|
12750
12750
|
}
|
|
12751
12751
|
return void 0;
|
|
12752
12752
|
}
|
|
@@ -12769,15 +12769,15 @@ ${lanes.join("\n")}
|
|
|
12769
12769
|
var rangeRegExp = /^([~^<>=]|<=|>=)?\s*([a-z0-9-+.*]+)$/i;
|
|
12770
12770
|
function parseRange(text) {
|
|
12771
12771
|
const alternatives = [];
|
|
12772
|
-
for (let
|
|
12773
|
-
if (!
|
|
12772
|
+
for (let range2 of text.trim().split(logicalOrRegExp)) {
|
|
12773
|
+
if (!range2) continue;
|
|
12774
12774
|
const comparators = [];
|
|
12775
|
-
|
|
12776
|
-
const match2 = hyphenRegExp.exec(
|
|
12775
|
+
range2 = range2.trim();
|
|
12776
|
+
const match2 = hyphenRegExp.exec(range2);
|
|
12777
12777
|
if (match2) {
|
|
12778
12778
|
if (!parseHyphen(match2[1], match2[2], comparators)) return void 0;
|
|
12779
12779
|
} else {
|
|
12780
|
-
for (const simple of
|
|
12780
|
+
for (const simple of range2.split(whitespaceRegExp)) {
|
|
12781
12781
|
const match22 = rangeRegExp.exec(simple.trim());
|
|
12782
12782
|
if (!match22 || !parseComparator(match22[1], match22[2], comparators)) return void 0;
|
|
12783
12783
|
}
|
|
@@ -22946,17 +22946,17 @@ ${lanes.join("\n")}
|
|
|
22946
22946
|
function textSpanContainsPosition(span, position) {
|
|
22947
22947
|
return position >= span.start && position < textSpanEnd(span);
|
|
22948
22948
|
}
|
|
22949
|
-
function textRangeContainsPositionInclusive(
|
|
22950
|
-
return position >=
|
|
22949
|
+
function textRangeContainsPositionInclusive(range2, position) {
|
|
22950
|
+
return position >= range2.pos && position <= range2.end;
|
|
22951
22951
|
}
|
|
22952
22952
|
function textSpanContainsTextSpan(span, other) {
|
|
22953
22953
|
return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
|
|
22954
22954
|
}
|
|
22955
|
-
function textSpanContainsTextRange(span,
|
|
22956
|
-
return
|
|
22955
|
+
function textSpanContainsTextRange(span, range2) {
|
|
22956
|
+
return range2.pos >= span.start && range2.end <= textSpanEnd(span);
|
|
22957
22957
|
}
|
|
22958
|
-
function textRangeContainsTextSpan(
|
|
22959
|
-
return span.start >=
|
|
22958
|
+
function textRangeContainsTextSpan(range2, span) {
|
|
22959
|
+
return span.start >= range2.pos && textSpanEnd(span) <= range2.end;
|
|
22960
22960
|
}
|
|
22961
22961
|
function textSpanOverlapsWith(span, other) {
|
|
22962
22962
|
return textSpanOverlap(span, other) !== void 0;
|
|
@@ -22979,8 +22979,8 @@ ${lanes.join("\n")}
|
|
|
22979
22979
|
function textSpanIntersectsWithPosition(span, position) {
|
|
22980
22980
|
return position <= textSpanEnd(span) && position >= span.start;
|
|
22981
22981
|
}
|
|
22982
|
-
function textRangeIntersectsWithTextSpan(
|
|
22983
|
-
return textSpanIntersectsWith(span,
|
|
22982
|
+
function textRangeIntersectsWithTextSpan(range2, span) {
|
|
22983
|
+
return textSpanIntersectsWith(span, range2.pos, range2.end - range2.pos);
|
|
22984
22984
|
}
|
|
22985
22985
|
function textSpanIntersection(span1, span2) {
|
|
22986
22986
|
const start2 = Math.max(span1.start, span2.start);
|
|
@@ -23019,11 +23019,11 @@ ${lanes.join("\n")}
|
|
|
23019
23019
|
function createTextSpanFromBounds(start2, end) {
|
|
23020
23020
|
return createTextSpan(start2, end - start2);
|
|
23021
23021
|
}
|
|
23022
|
-
function textChangeRangeNewSpan(
|
|
23023
|
-
return createTextSpan(
|
|
23022
|
+
function textChangeRangeNewSpan(range2) {
|
|
23023
|
+
return createTextSpan(range2.span.start, range2.newLength);
|
|
23024
23024
|
}
|
|
23025
|
-
function textChangeRangeIsUnchanged(
|
|
23026
|
-
return textSpanIsEmpty(
|
|
23025
|
+
function textChangeRangeIsUnchanged(range2) {
|
|
23026
|
+
return textSpanIsEmpty(range2.span) && range2.newLength === 0;
|
|
23027
23027
|
}
|
|
23028
23028
|
function createTextChangeRange(span, newLength) {
|
|
23029
23029
|
if (newLength < 0) {
|
|
@@ -24456,8 +24456,8 @@ ${lanes.join("\n")}
|
|
|
24456
24456
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
24457
24457
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 319;
|
|
24458
24458
|
}
|
|
24459
|
-
function hasInternalAnnotation(
|
|
24460
|
-
const comment = sourceFile.text.substring(
|
|
24459
|
+
function hasInternalAnnotation(range2, sourceFile) {
|
|
24460
|
+
const comment = sourceFile.text.substring(range2.pos, range2.end);
|
|
24461
24461
|
return comment.includes("@internal");
|
|
24462
24462
|
}
|
|
24463
24463
|
function isInternalDeclaration(node, sourceFile) {
|
|
@@ -24491,8 +24491,8 @@ ${lanes.join("\n")}
|
|
|
24491
24491
|
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
24492
24492
|
}
|
|
24493
24493
|
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
24494
|
-
return !!forEach(leadingCommentRanges, (
|
|
24495
|
-
return hasInternalAnnotation(
|
|
24494
|
+
return !!forEach(leadingCommentRanges, (range2) => {
|
|
24495
|
+
return hasInternalAnnotation(range2, sourceFile);
|
|
24496
24496
|
});
|
|
24497
24497
|
}
|
|
24498
24498
|
var resolvingEmptyArray = [];
|
|
@@ -24959,8 +24959,8 @@ ${lanes.join("\n")}
|
|
|
24959
24959
|
function getTextOfNode(node, includeTrivia = false) {
|
|
24960
24960
|
return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia);
|
|
24961
24961
|
}
|
|
24962
|
-
function getPos(
|
|
24963
|
-
return
|
|
24962
|
+
function getPos(range2) {
|
|
24963
|
+
return range2.pos;
|
|
24964
24964
|
}
|
|
24965
24965
|
function indexOfNode(nodeArray, node) {
|
|
24966
24966
|
return binarySearch(nodeArray, node, getPos, compareValues);
|
|
@@ -25892,11 +25892,11 @@ ${lanes.join("\n")}
|
|
|
25892
25892
|
next: diagnostic.next
|
|
25893
25893
|
} : diagnostic.messageText;
|
|
25894
25894
|
}
|
|
25895
|
-
function createDiagnosticForRange(sourceFile,
|
|
25895
|
+
function createDiagnosticForRange(sourceFile, range2, message) {
|
|
25896
25896
|
return {
|
|
25897
25897
|
file: sourceFile,
|
|
25898
|
-
start:
|
|
25899
|
-
length:
|
|
25898
|
+
start: range2.pos,
|
|
25899
|
+
length: range2.end - range2.pos,
|
|
25900
25900
|
code: message.code,
|
|
25901
25901
|
category: message.category,
|
|
25902
25902
|
messageText: message.message
|
|
@@ -28025,8 +28025,8 @@ ${lanes.join("\n")}
|
|
|
28025
28025
|
const kind = node.kind;
|
|
28026
28026
|
return kind === 177 || kind === 219 || kind === 263 || kind === 220 || kind === 175 || kind === 178 || kind === 179 || kind === 268 || kind === 308;
|
|
28027
28027
|
}
|
|
28028
|
-
function nodeIsSynthesized(
|
|
28029
|
-
return positionIsSynthesized(
|
|
28028
|
+
function nodeIsSynthesized(range2) {
|
|
28029
|
+
return positionIsSynthesized(range2.pos) || positionIsSynthesized(range2.end);
|
|
28030
28030
|
}
|
|
28031
28031
|
var Associativity = /* @__PURE__ */ ((Associativity2) => {
|
|
28032
28032
|
Associativity2[Associativity2["Left"] = 0] = "Left";
|
|
@@ -29519,11 +29519,11 @@ ${lanes.join("\n")}
|
|
|
29519
29519
|
Debug.assert(end >= pos || end === -1);
|
|
29520
29520
|
return { pos, end };
|
|
29521
29521
|
}
|
|
29522
|
-
function moveRangeEnd(
|
|
29523
|
-
return createRange(
|
|
29522
|
+
function moveRangeEnd(range2, end) {
|
|
29523
|
+
return createRange(range2.pos, end);
|
|
29524
29524
|
}
|
|
29525
|
-
function moveRangePos(
|
|
29526
|
-
return createRange(pos,
|
|
29525
|
+
function moveRangePos(range2, pos) {
|
|
29526
|
+
return createRange(pos, range2.end);
|
|
29527
29527
|
}
|
|
29528
29528
|
function moveRangePastDecorators(node) {
|
|
29529
29529
|
const lastDecorator = canHaveModifiers(node) ? findLast(node.modifiers, isDecorator) : void 0;
|
|
@@ -29539,8 +29539,8 @@ ${lanes.join("\n")}
|
|
|
29539
29539
|
function createTokenRange(pos, token) {
|
|
29540
29540
|
return createRange(pos, pos + tokenToString(token).length);
|
|
29541
29541
|
}
|
|
29542
|
-
function rangeIsOnSingleLine(
|
|
29543
|
-
return rangeStartIsOnSameLineAsRangeEnd(
|
|
29542
|
+
function rangeIsOnSingleLine(range2, sourceFile) {
|
|
29543
|
+
return rangeStartIsOnSameLineAsRangeEnd(range2, range2, sourceFile);
|
|
29544
29544
|
}
|
|
29545
29545
|
function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) {
|
|
29546
29546
|
return positionsAreOnSameLine(
|
|
@@ -29591,10 +29591,10 @@ ${lanes.join("\n")}
|
|
|
29591
29591
|
function positionsAreOnSameLine(pos1, pos2, sourceFile) {
|
|
29592
29592
|
return getLinesBetweenPositions(sourceFile, pos1, pos2) === 0;
|
|
29593
29593
|
}
|
|
29594
|
-
function getStartPositionOfRange(
|
|
29595
|
-
return positionIsSynthesized(
|
|
29594
|
+
function getStartPositionOfRange(range2, sourceFile, includeComments) {
|
|
29595
|
+
return positionIsSynthesized(range2.pos) ? -1 : skipTrivia(
|
|
29596
29596
|
sourceFile.text,
|
|
29597
|
-
|
|
29597
|
+
range2.pos,
|
|
29598
29598
|
/*stopAfterLineBreak*/
|
|
29599
29599
|
false,
|
|
29600
29600
|
includeComments
|
|
@@ -29624,8 +29624,8 @@ ${lanes.join("\n")}
|
|
|
29624
29624
|
function rangeContainsRange(r1, r2) {
|
|
29625
29625
|
return startEndContainsRange(r1.pos, r1.end, r2);
|
|
29626
29626
|
}
|
|
29627
|
-
function startEndContainsRange(start2, end,
|
|
29628
|
-
return start2 <=
|
|
29627
|
+
function startEndContainsRange(start2, end, range2) {
|
|
29628
|
+
return start2 <= range2.pos && end >= range2.end;
|
|
29629
29629
|
}
|
|
29630
29630
|
function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) {
|
|
29631
29631
|
while (pos-- > stopPos) {
|
|
@@ -31476,19 +31476,19 @@ ${lanes.join("\n")}
|
|
|
31476
31476
|
}
|
|
31477
31477
|
return true;
|
|
31478
31478
|
}
|
|
31479
|
-
function setTextRangePos(
|
|
31480
|
-
|
|
31481
|
-
return
|
|
31479
|
+
function setTextRangePos(range2, pos) {
|
|
31480
|
+
range2.pos = pos;
|
|
31481
|
+
return range2;
|
|
31482
31482
|
}
|
|
31483
|
-
function setTextRangeEnd(
|
|
31484
|
-
|
|
31485
|
-
return
|
|
31483
|
+
function setTextRangeEnd(range2, end) {
|
|
31484
|
+
range2.end = end;
|
|
31485
|
+
return range2;
|
|
31486
31486
|
}
|
|
31487
|
-
function setTextRangePosEnd(
|
|
31488
|
-
return setTextRangeEnd(setTextRangePos(
|
|
31487
|
+
function setTextRangePosEnd(range2, pos, end) {
|
|
31488
|
+
return setTextRangeEnd(setTextRangePos(range2, pos), end);
|
|
31489
31489
|
}
|
|
31490
|
-
function setTextRangePosWidth(
|
|
31491
|
-
return setTextRangePosEnd(
|
|
31490
|
+
function setTextRangePosWidth(range2, pos, width) {
|
|
31491
|
+
return setTextRangePosEnd(range2, pos, pos + width);
|
|
31492
31492
|
}
|
|
31493
31493
|
function setNodeFlags(node, newFlags) {
|
|
31494
31494
|
if (node) {
|
|
@@ -38743,18 +38743,18 @@ ${lanes.join("\n")}
|
|
|
38743
38743
|
var _a2;
|
|
38744
38744
|
return ((_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) ?? node;
|
|
38745
38745
|
}
|
|
38746
|
-
function setSourceMapRange(node,
|
|
38747
|
-
getOrCreateEmitNode(node).sourceMapRange =
|
|
38746
|
+
function setSourceMapRange(node, range2) {
|
|
38747
|
+
getOrCreateEmitNode(node).sourceMapRange = range2;
|
|
38748
38748
|
return node;
|
|
38749
38749
|
}
|
|
38750
38750
|
function getTokenSourceMapRange(node, token) {
|
|
38751
38751
|
var _a2, _b;
|
|
38752
38752
|
return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.tokenSourceMapRanges) == null ? void 0 : _b[token];
|
|
38753
38753
|
}
|
|
38754
|
-
function setTokenSourceMapRange(node, token,
|
|
38754
|
+
function setTokenSourceMapRange(node, token, range2) {
|
|
38755
38755
|
const emitNode = getOrCreateEmitNode(node);
|
|
38756
38756
|
const tokenSourceMapRanges = emitNode.tokenSourceMapRanges ?? (emitNode.tokenSourceMapRanges = []);
|
|
38757
|
-
tokenSourceMapRanges[token] =
|
|
38757
|
+
tokenSourceMapRanges[token] = range2;
|
|
38758
38758
|
return node;
|
|
38759
38759
|
}
|
|
38760
38760
|
function getStartsOnNewLine(node) {
|
|
@@ -38769,8 +38769,8 @@ ${lanes.join("\n")}
|
|
|
38769
38769
|
var _a2;
|
|
38770
38770
|
return ((_a2 = node.emitNode) == null ? void 0 : _a2.commentRange) ?? node;
|
|
38771
38771
|
}
|
|
38772
|
-
function setCommentRange(node,
|
|
38773
|
-
getOrCreateEmitNode(node).commentRange =
|
|
38772
|
+
function setCommentRange(node, range2) {
|
|
38773
|
+
getOrCreateEmitNode(node).commentRange = range2;
|
|
38774
38774
|
return node;
|
|
38775
38775
|
}
|
|
38776
38776
|
function getSyntheticLeadingComments(node) {
|
|
@@ -41817,8 +41817,8 @@ ${lanes.join("\n")}
|
|
|
41817
41817
|
}
|
|
41818
41818
|
return false;
|
|
41819
41819
|
}
|
|
41820
|
-
function setTextRange(
|
|
41821
|
-
return location ? setTextRangePosEnd(
|
|
41820
|
+
function setTextRange(range2, location) {
|
|
41821
|
+
return location ? setTextRangePosEnd(range2, location.pos, location.end) : range2;
|
|
41822
41822
|
}
|
|
41823
41823
|
function canHaveModifiers(node) {
|
|
41824
41824
|
const kind = node.kind;
|
|
@@ -43642,8 +43642,8 @@ ${lanes.join("\n")}
|
|
|
43642
43642
|
function parseErrorAt(start2, end, message, ...args2) {
|
|
43643
43643
|
return parseErrorAtPosition(start2, end - start2, message, ...args2);
|
|
43644
43644
|
}
|
|
43645
|
-
function parseErrorAtRange(
|
|
43646
|
-
parseErrorAt(
|
|
43645
|
+
function parseErrorAtRange(range2, message, ...args2) {
|
|
43646
|
+
parseErrorAt(range2.pos, range2.end, message, ...args2);
|
|
43647
43647
|
}
|
|
43648
43648
|
function scanError(message, length2, arg0) {
|
|
43649
43649
|
parseErrorAtPosition(scanner2.getTokenEnd(), length2, message, arg0);
|
|
@@ -50988,18 +50988,18 @@ ${lanes.join("\n")}
|
|
|
50988
50988
|
let commentDirectives;
|
|
50989
50989
|
let addedNewlyScannedDirectives = false;
|
|
50990
50990
|
for (const directive of oldDirectives) {
|
|
50991
|
-
const { range, type } = directive;
|
|
50992
|
-
if (
|
|
50991
|
+
const { range: range2, type } = directive;
|
|
50992
|
+
if (range2.end < changeStart) {
|
|
50993
50993
|
commentDirectives = append(commentDirectives, directive);
|
|
50994
|
-
} else if (
|
|
50994
|
+
} else if (range2.pos > changeRangeOldEnd) {
|
|
50995
50995
|
addNewlyScannedDirectives();
|
|
50996
50996
|
const updatedDirective = {
|
|
50997
|
-
range: { pos:
|
|
50997
|
+
range: { pos: range2.pos + delta, end: range2.end + delta },
|
|
50998
50998
|
type
|
|
50999
50999
|
};
|
|
51000
51000
|
commentDirectives = append(commentDirectives, updatedDirective);
|
|
51001
51001
|
if (aggressiveChecks) {
|
|
51002
|
-
Debug.assert(oldText.substring(
|
|
51002
|
+
Debug.assert(oldText.substring(range2.pos, range2.end) === newText.substring(updatedDirective.range.pos, updatedDirective.range.end));
|
|
51003
51003
|
}
|
|
51004
51004
|
}
|
|
51005
51005
|
}
|
|
@@ -51331,9 +51331,9 @@ ${lanes.join("\n")}
|
|
|
51331
51331
|
}
|
|
51332
51332
|
function processCommentPragmas(context, sourceText) {
|
|
51333
51333
|
const pragmas = [];
|
|
51334
|
-
for (const
|
|
51335
|
-
const comment = sourceText.substring(
|
|
51336
|
-
extractPragmas(pragmas,
|
|
51334
|
+
for (const range2 of getLeadingCommentRanges(sourceText, 0) || emptyArray) {
|
|
51335
|
+
const comment = sourceText.substring(range2.pos, range2.end);
|
|
51336
|
+
extractPragmas(pragmas, range2, comment);
|
|
51337
51337
|
}
|
|
51338
51338
|
context.pragmas = /* @__PURE__ */ new Map();
|
|
51339
51339
|
for (const pragma of pragmas) {
|
|
@@ -51435,8 +51435,8 @@ ${lanes.join("\n")}
|
|
|
51435
51435
|
}
|
|
51436
51436
|
var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/m;
|
|
51437
51437
|
var singleLinePragmaRegEx = /^\/\/\/?\s*@([^\s:]+)((?:[^\S\r\n]|:).*)?$/m;
|
|
51438
|
-
function extractPragmas(pragmas,
|
|
51439
|
-
const tripleSlash =
|
|
51438
|
+
function extractPragmas(pragmas, range2, text) {
|
|
51439
|
+
const tripleSlash = range2.kind === 2 && tripleSlashXMLCommentStartRegEx.exec(text);
|
|
51440
51440
|
if (tripleSlash) {
|
|
51441
51441
|
const name2 = tripleSlash[1].toLowerCase();
|
|
51442
51442
|
const pragma = commentPragmas[name2];
|
|
@@ -51453,7 +51453,7 @@ ${lanes.join("\n")}
|
|
|
51453
51453
|
} else if (matchResult) {
|
|
51454
51454
|
const value = matchResult[2] || matchResult[3];
|
|
51455
51455
|
if (arg.captureSpan) {
|
|
51456
|
-
const startPos =
|
|
51456
|
+
const startPos = range2.pos + matchResult.index + matchResult[1].length + 1;
|
|
51457
51457
|
argument[arg.name] = {
|
|
51458
51458
|
value,
|
|
51459
51459
|
pos: startPos,
|
|
@@ -51464,25 +51464,25 @@ ${lanes.join("\n")}
|
|
|
51464
51464
|
}
|
|
51465
51465
|
}
|
|
51466
51466
|
}
|
|
51467
|
-
pragmas.push({ name: name2, args: { arguments: argument, range } });
|
|
51467
|
+
pragmas.push({ name: name2, args: { arguments: argument, range: range2 } });
|
|
51468
51468
|
} else {
|
|
51469
|
-
pragmas.push({ name: name2, args: { arguments: {}, range } });
|
|
51469
|
+
pragmas.push({ name: name2, args: { arguments: {}, range: range2 } });
|
|
51470
51470
|
}
|
|
51471
51471
|
return;
|
|
51472
51472
|
}
|
|
51473
|
-
const singleLine =
|
|
51473
|
+
const singleLine = range2.kind === 2 && singleLinePragmaRegEx.exec(text);
|
|
51474
51474
|
if (singleLine) {
|
|
51475
|
-
return addPragmaForMatch(pragmas,
|
|
51475
|
+
return addPragmaForMatch(pragmas, range2, 2, singleLine);
|
|
51476
51476
|
}
|
|
51477
|
-
if (
|
|
51477
|
+
if (range2.kind === 3) {
|
|
51478
51478
|
const multiLinePragmaRegEx = /@(\S+)(\s+(?:\S.*)?)?$/gm;
|
|
51479
51479
|
let multiLineMatch;
|
|
51480
51480
|
while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {
|
|
51481
|
-
addPragmaForMatch(pragmas,
|
|
51481
|
+
addPragmaForMatch(pragmas, range2, 4, multiLineMatch);
|
|
51482
51482
|
}
|
|
51483
51483
|
}
|
|
51484
51484
|
}
|
|
51485
|
-
function addPragmaForMatch(pragmas,
|
|
51485
|
+
function addPragmaForMatch(pragmas, range2, kind, match2) {
|
|
51486
51486
|
if (!match2) return;
|
|
51487
51487
|
const name2 = match2[1].toLowerCase();
|
|
51488
51488
|
const pragma = commentPragmas[name2];
|
|
@@ -51492,7 +51492,7 @@ ${lanes.join("\n")}
|
|
|
51492
51492
|
const args2 = match2[2];
|
|
51493
51493
|
const argument = getNamedPragmaArguments(pragma, args2);
|
|
51494
51494
|
if (argument === "fail") return;
|
|
51495
|
-
pragmas.push({ name: name2, args: { arguments: argument, range } });
|
|
51495
|
+
pragmas.push({ name: name2, args: { arguments: argument, range: range2 } });
|
|
51496
51496
|
return;
|
|
51497
51497
|
}
|
|
51498
51498
|
function getNamedPragmaArguments(pragma, text) {
|
|
@@ -57358,9 +57358,9 @@ ${lanes.join("\n")}
|
|
|
57358
57358
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
57359
57359
|
if (!conditions.includes("types")) return false;
|
|
57360
57360
|
if (!startsWith(key, "types@")) return false;
|
|
57361
|
-
const
|
|
57362
|
-
if (!
|
|
57363
|
-
return
|
|
57361
|
+
const range2 = VersionRange.tryParse(key.substring("types@".length));
|
|
57362
|
+
if (!range2) return false;
|
|
57363
|
+
return range2.test(version3);
|
|
57364
57364
|
}
|
|
57365
57365
|
function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) {
|
|
57366
57366
|
return loadModuleFromNearestNodeModulesDirectoryWorker(
|
|
@@ -59793,8 +59793,8 @@ ${lanes.join("\n")}
|
|
|
59793
59793
|
function errorOrSuggestionOnRange(isError, startNode2, endNode2, message) {
|
|
59794
59794
|
addErrorOrSuggestionDiagnostic(isError, { pos: getTokenPosOfNode(startNode2, file), end: endNode2.end }, message);
|
|
59795
59795
|
}
|
|
59796
|
-
function addErrorOrSuggestionDiagnostic(isError,
|
|
59797
|
-
const diag2 = createFileDiagnostic(file,
|
|
59796
|
+
function addErrorOrSuggestionDiagnostic(isError, range2, message) {
|
|
59797
|
+
const diag2 = createFileDiagnostic(file, range2.pos, range2.end - range2.pos, message);
|
|
59798
59798
|
if (isError) {
|
|
59799
59799
|
file.bindDiagnostics.push(diag2);
|
|
59800
59800
|
} else {
|
|
@@ -67155,8 +67155,8 @@ ${lanes.join("\n")}
|
|
|
67155
67155
|
);
|
|
67156
67156
|
}
|
|
67157
67157
|
},
|
|
67158
|
-
markNodeReuse(context,
|
|
67159
|
-
return setTextRange2(context,
|
|
67158
|
+
markNodeReuse(context, range2, location) {
|
|
67159
|
+
return setTextRange2(context, range2, location);
|
|
67160
67160
|
},
|
|
67161
67161
|
trackExistingEntityName(context, node) {
|
|
67162
67162
|
return trackExistingEntityName(node, context);
|
|
@@ -67376,25 +67376,25 @@ ${lanes.join("\n")}
|
|
|
67376
67376
|
const mappedType = instantiateType(type, context.mapper);
|
|
67377
67377
|
return noMappedTypes && mappedType !== type ? void 0 : mappedType;
|
|
67378
67378
|
}
|
|
67379
|
-
function setTextRange2(context,
|
|
67380
|
-
if (!nodeIsSynthesized(
|
|
67381
|
-
|
|
67379
|
+
function setTextRange2(context, range2, location) {
|
|
67380
|
+
if (!nodeIsSynthesized(range2) || !(range2.flags & 16) || !context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(getOriginalNode(range2))) {
|
|
67381
|
+
range2 = factory.cloneNode(range2);
|
|
67382
67382
|
}
|
|
67383
|
-
if (
|
|
67383
|
+
if (range2 === location) return range2;
|
|
67384
67384
|
if (!location) {
|
|
67385
|
-
return
|
|
67385
|
+
return range2;
|
|
67386
67386
|
}
|
|
67387
|
-
let original =
|
|
67387
|
+
let original = range2.original;
|
|
67388
67388
|
while (original && original !== location) {
|
|
67389
67389
|
original = original.original;
|
|
67390
67390
|
}
|
|
67391
67391
|
if (!original) {
|
|
67392
|
-
setOriginalNode(
|
|
67392
|
+
setOriginalNode(range2, location);
|
|
67393
67393
|
}
|
|
67394
67394
|
if (context.enclosingFile && context.enclosingFile === getSourceFileOfNode(getOriginalNode(location))) {
|
|
67395
|
-
return setTextRange(
|
|
67395
|
+
return setTextRange(range2, location);
|
|
67396
67396
|
}
|
|
67397
|
-
return
|
|
67397
|
+
return range2;
|
|
67398
67398
|
}
|
|
67399
67399
|
function symbolToNode(symbol, context, meaning) {
|
|
67400
67400
|
if (context.internalFlags & 1) {
|
|
@@ -68808,7 +68808,7 @@ ${lanes.join("\n")}
|
|
|
68808
68808
|
propertyTypeNode
|
|
68809
68809
|
);
|
|
68810
68810
|
typeElements.push(preserveCommentsOn(propertySignature, propertySymbol.valueDeclaration));
|
|
68811
|
-
function preserveCommentsOn(node,
|
|
68811
|
+
function preserveCommentsOn(node, range2) {
|
|
68812
68812
|
var _a22;
|
|
68813
68813
|
const jsdocPropertyTag = (_a22 = propertySymbol.declarations) == null ? void 0 : _a22.find(
|
|
68814
68814
|
(d) => d.kind === 349
|
|
@@ -68819,15 +68819,15 @@ ${lanes.join("\n")}
|
|
|
68819
68819
|
if (commentText) {
|
|
68820
68820
|
setSyntheticLeadingComments(node, [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
68821
68821
|
}
|
|
68822
|
-
} else if (
|
|
68823
|
-
setCommentRange2(context, node,
|
|
68822
|
+
} else if (range2) {
|
|
68823
|
+
setCommentRange2(context, node, range2);
|
|
68824
68824
|
}
|
|
68825
68825
|
return node;
|
|
68826
68826
|
}
|
|
68827
68827
|
}
|
|
68828
|
-
function setCommentRange2(context, node,
|
|
68829
|
-
if (context.enclosingFile && context.enclosingFile === getSourceFileOfNode(
|
|
68830
|
-
return setCommentRange(node,
|
|
68828
|
+
function setCommentRange2(context, node, range2) {
|
|
68829
|
+
if (context.enclosingFile && context.enclosingFile === getSourceFileOfNode(range2)) {
|
|
68830
|
+
return setCommentRange(node, range2);
|
|
68831
68831
|
}
|
|
68832
68832
|
return node;
|
|
68833
68833
|
}
|
|
@@ -101681,10 +101681,10 @@ ${lanes.join("\n")}
|
|
|
101681
101681
|
if (parent2.kind !== 196 && parent2.typeParameters.every(isTypeParameterUnused)) {
|
|
101682
101682
|
if (tryAddToSet(seenParentsWithEveryUnused, parent2)) {
|
|
101683
101683
|
const sourceFile = getSourceFileOfNode(parent2);
|
|
101684
|
-
const
|
|
101684
|
+
const range2 = isJSDocTemplateTag(parent2) ? rangeOfNode(parent2) : rangeOfTypeParameters(sourceFile, parent2.typeParameters);
|
|
101685
101685
|
const only = parent2.typeParameters.length === 1;
|
|
101686
101686
|
const messageAndArg = only ? [Diagnostics._0_is_declared_but_its_value_is_never_read, name2] : [Diagnostics.All_type_parameters_are_unused];
|
|
101687
|
-
addDiagnostic(typeParameter, 1, createFileDiagnostic(sourceFile,
|
|
101687
|
+
addDiagnostic(typeParameter, 1, createFileDiagnostic(sourceFile, range2.pos, range2.end - range2.pos, ...messageAndArg));
|
|
101688
101688
|
}
|
|
101689
101689
|
} else {
|
|
101690
101690
|
addDiagnostic(typeParameter, 1, createDiagnosticForNode(typeParameter, Diagnostics._0_is_declared_but_its_value_is_never_read, name2));
|
|
@@ -109202,10 +109202,10 @@ ${lanes.join("\n")}
|
|
|
109202
109202
|
}
|
|
109203
109203
|
function checkGrammarConstructorTypeParameters(node) {
|
|
109204
109204
|
const jsdocTypeParameters = isInJSFile(node) ? getJSDocTypeParameterDeclarations(node) : void 0;
|
|
109205
|
-
const
|
|
109206
|
-
if (
|
|
109207
|
-
const pos =
|
|
109208
|
-
return grammarErrorAtPos(node, pos,
|
|
109205
|
+
const range2 = node.typeParameters || jsdocTypeParameters && firstOrUndefined(jsdocTypeParameters);
|
|
109206
|
+
if (range2) {
|
|
109207
|
+
const pos = range2.pos === range2.end ? range2.pos : skipTrivia(getSourceFileOfNode(node).text, range2.pos);
|
|
109208
|
+
return grammarErrorAtPos(node, pos, range2.end - pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
|
|
109209
109209
|
}
|
|
109210
109210
|
}
|
|
109211
109211
|
function checkGrammarConstructorTypeAnnotation(node) {
|
|
@@ -142394,8 +142394,8 @@ ${lanes.join("\n")}
|
|
|
142394
142394
|
pos
|
|
142395
142395
|
);
|
|
142396
142396
|
}
|
|
142397
|
-
function emitDetachedCommentsAndUpdateCommentsInfo(
|
|
142398
|
-
const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment,
|
|
142397
|
+
function emitDetachedCommentsAndUpdateCommentsInfo(range2) {
|
|
142398
|
+
const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range2, newLine, commentsDisabled);
|
|
142399
142399
|
if (currentDetachedCommentInfo) {
|
|
142400
142400
|
if (detachedCommentsInfo) {
|
|
142401
142401
|
detachedCommentsInfo.push(currentDetachedCommentInfo);
|
|
@@ -142475,14 +142475,14 @@ ${lanes.join("\n")}
|
|
|
142475
142475
|
}
|
|
142476
142476
|
const emitNode = node && node.emitNode;
|
|
142477
142477
|
const emitFlags = emitNode && emitNode.flags || 0;
|
|
142478
|
-
const
|
|
142479
|
-
const source =
|
|
142480
|
-
tokenPos = skipSourceTrivia(source,
|
|
142478
|
+
const range2 = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];
|
|
142479
|
+
const source = range2 && range2.source || sourceMapSource;
|
|
142480
|
+
tokenPos = skipSourceTrivia(source, range2 ? range2.pos : tokenPos);
|
|
142481
142481
|
if ((emitFlags & 256) === 0 && tokenPos >= 0) {
|
|
142482
142482
|
emitSourcePos(source, tokenPos);
|
|
142483
142483
|
}
|
|
142484
142484
|
tokenPos = emitCallback(token, writer2, tokenPos);
|
|
142485
|
-
if (
|
|
142485
|
+
if (range2) tokenPos = range2.end;
|
|
142486
142486
|
if ((emitFlags & 512) === 0 && tokenPos >= 0) {
|
|
142487
142487
|
emitSourcePos(source, tokenPos);
|
|
142488
142488
|
}
|
|
@@ -154806,8 +154806,8 @@ ${lanes.join("\n")}
|
|
|
154806
154806
|
return tryReuseExistingTypeNode(context, existing);
|
|
154807
154807
|
}
|
|
154808
154808
|
};
|
|
154809
|
-
function reuseNode(context, node,
|
|
154810
|
-
return node === void 0 ? void 0 : resolver.markNodeReuse(context, node.flags & 16 ? node : factory.cloneNode(node),
|
|
154809
|
+
function reuseNode(context, node, range2 = node) {
|
|
154810
|
+
return node === void 0 ? void 0 : resolver.markNodeReuse(context, node.flags & 16 ? node : factory.cloneNode(node), range2 ?? node);
|
|
154811
154811
|
}
|
|
154812
154812
|
function tryReuseExistingTypeNode(context, existing) {
|
|
154813
154813
|
const { finalizeBoundary, startRecoveryScope, hadError, markError } = resolver.createRecoveryBoundary(context);
|
|
@@ -157087,8 +157087,8 @@ ${lanes.join("\n")}
|
|
|
157087
157087
|
function rangeContainsPositionExclusive(r, pos) {
|
|
157088
157088
|
return r.pos < pos && pos < r.end;
|
|
157089
157089
|
}
|
|
157090
|
-
function rangeContainsStartEnd(
|
|
157091
|
-
return
|
|
157090
|
+
function rangeContainsStartEnd(range2, start2, end) {
|
|
157091
|
+
return range2.pos <= start2 && range2.end >= end;
|
|
157092
157092
|
}
|
|
157093
157093
|
function rangeOverlapsWithStartEnd(r1, start2, end) {
|
|
157094
157094
|
return startEndOverlapsWithStartEnd(r1.pos, r1.end, start2, end);
|
|
@@ -158021,13 +158021,13 @@ ${lanes.join("\n")}
|
|
|
158021
158021
|
);
|
|
158022
158022
|
}
|
|
158023
158023
|
function isInReferenceCommentWorker(sourceFile, position, shouldBeReference) {
|
|
158024
|
-
const
|
|
158024
|
+
const range2 = isInComment(
|
|
158025
158025
|
sourceFile,
|
|
158026
158026
|
position,
|
|
158027
158027
|
/*tokenAtPosition*/
|
|
158028
158028
|
void 0
|
|
158029
158029
|
);
|
|
158030
|
-
return !!
|
|
158030
|
+
return !!range2 && shouldBeReference === tripleSlashDirectivePrefixRegex.test(sourceFile.text.substring(range2.pos, range2.end));
|
|
158031
158031
|
}
|
|
158032
158032
|
function getReplacementSpanForContextToken(contextToken, position) {
|
|
158033
158033
|
if (!contextToken) return void 0;
|
|
@@ -158053,8 +158053,8 @@ ${lanes.join("\n")}
|
|
|
158053
158053
|
function createTextRangeFromNode(node, sourceFile) {
|
|
158054
158054
|
return createRange(node.getStart(sourceFile), node.end);
|
|
158055
158055
|
}
|
|
158056
|
-
function createTextSpanFromRange(
|
|
158057
|
-
return createTextSpanFromBounds(
|
|
158056
|
+
function createTextSpanFromRange(range2) {
|
|
158057
|
+
return createTextSpanFromBounds(range2.pos, range2.end);
|
|
158058
158058
|
}
|
|
158059
158059
|
function createTextRangeFromSpan(span) {
|
|
158060
158060
|
return createRange(span.start, span.start + span.length);
|
|
@@ -164628,9 +164628,9 @@ interface Symbol {
|
|
|
164628
164628
|
function getRangeToExtract(context, considerEmptySpans = true) {
|
|
164629
164629
|
const { file, startPosition } = context;
|
|
164630
164630
|
const isJS = isSourceFileJS(file);
|
|
164631
|
-
const
|
|
164632
|
-
const isCursorRequest =
|
|
164633
|
-
const firstType = getFirstTypeAt(file, startPosition,
|
|
164631
|
+
const range2 = createTextRangeFromSpan(getRefactorContextSpan(context));
|
|
164632
|
+
const isCursorRequest = range2.pos === range2.end && considerEmptySpans;
|
|
164633
|
+
const firstType = getFirstTypeAt(file, startPosition, range2, isCursorRequest);
|
|
164634
164634
|
if (!firstType || !isTypeNode(firstType)) return { info: { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }, affectedTextRange: void 0 };
|
|
164635
164635
|
const checker = context.program.getTypeChecker();
|
|
164636
164636
|
const enclosingNode = getEnclosingNode(firstType, isJS);
|
|
@@ -164638,11 +164638,11 @@ interface Symbol {
|
|
|
164638
164638
|
const expandedFirstType = getExpandedSelectionNode(firstType, enclosingNode);
|
|
164639
164639
|
if (!isTypeNode(expandedFirstType)) return { info: { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }, affectedTextRange: void 0 };
|
|
164640
164640
|
const typeList = [];
|
|
164641
|
-
if ((isUnionTypeNode(expandedFirstType.parent) || isIntersectionTypeNode(expandedFirstType.parent)) &&
|
|
164641
|
+
if ((isUnionTypeNode(expandedFirstType.parent) || isIntersectionTypeNode(expandedFirstType.parent)) && range2.end > firstType.end) {
|
|
164642
164642
|
addRange(
|
|
164643
164643
|
typeList,
|
|
164644
164644
|
expandedFirstType.parent.types.filter((type) => {
|
|
164645
|
-
return nodeOverlapsWithStartEnd(type, file,
|
|
164645
|
+
return nodeOverlapsWithStartEnd(type, file, range2.pos, range2.end);
|
|
164646
164646
|
})
|
|
164647
164647
|
);
|
|
164648
164648
|
}
|
|
@@ -164652,15 +164652,15 @@ interface Symbol {
|
|
|
164652
164652
|
const typeElements = flattenTypeLiteralNodeReference(checker, selection);
|
|
164653
164653
|
return { info: { isJS, selection, enclosingNode, typeParameters, typeElements }, affectedTextRange };
|
|
164654
164654
|
}
|
|
164655
|
-
function getFirstTypeAt(file, startPosition,
|
|
164655
|
+
function getFirstTypeAt(file, startPosition, range2, isCursorRequest) {
|
|
164656
164656
|
const currentNodes = [
|
|
164657
164657
|
() => getTokenAtPosition(file, startPosition),
|
|
164658
164658
|
() => getTouchingToken(file, startPosition, () => true)
|
|
164659
164659
|
];
|
|
164660
164660
|
for (const f of currentNodes) {
|
|
164661
164661
|
const current = f();
|
|
164662
|
-
const overlappingRange = nodeOverlapsWithStartEnd(current, file,
|
|
164663
|
-
const firstType = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(
|
|
164662
|
+
const overlappingRange = nodeOverlapsWithStartEnd(current, file, range2.pos, range2.end);
|
|
164663
|
+
const firstType = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range2, node.parent, file) && (isCursorRequest || overlappingRange));
|
|
164664
164664
|
if (firstType) {
|
|
164665
164665
|
return firstType;
|
|
164666
164666
|
}
|
|
@@ -165428,17 +165428,17 @@ interface Symbol {
|
|
|
165428
165428
|
}
|
|
165429
165429
|
function getRangeToMove(context) {
|
|
165430
165430
|
const { file } = context;
|
|
165431
|
-
const
|
|
165431
|
+
const range2 = createTextRangeFromSpan(getRefactorContextSpan(context));
|
|
165432
165432
|
const { statements } = file;
|
|
165433
|
-
let startNodeIndex = findIndex(statements, (s) => s.end >
|
|
165433
|
+
let startNodeIndex = findIndex(statements, (s) => s.end > range2.pos);
|
|
165434
165434
|
if (startNodeIndex === -1) return void 0;
|
|
165435
165435
|
const startStatement = statements[startNodeIndex];
|
|
165436
165436
|
const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
|
|
165437
165437
|
if (overloadRangeToMove) {
|
|
165438
165438
|
startNodeIndex = overloadRangeToMove.start;
|
|
165439
165439
|
}
|
|
165440
|
-
let endNodeIndex = findIndex(statements, (s) => s.end >=
|
|
165441
|
-
if (endNodeIndex !== -1 &&
|
|
165440
|
+
let endNodeIndex = findIndex(statements, (s) => s.end >= range2.end, startNodeIndex);
|
|
165441
|
+
if (endNodeIndex !== -1 && range2.end <= statements[endNodeIndex].getStart()) {
|
|
165442
165442
|
endNodeIndex--;
|
|
165443
165443
|
}
|
|
165444
165444
|
const endingOverloadRangeToMove = getOverloadRangeToMove(file, statements[endNodeIndex]);
|
|
@@ -168048,9 +168048,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168048
168048
|
function isScope(node) {
|
|
168049
168049
|
return isArrowFunction(node) ? isFunctionBody(node.body) : isFunctionLikeDeclaration(node) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node);
|
|
168050
168050
|
}
|
|
168051
|
-
function collectEnclosingScopes(
|
|
168052
|
-
let current = isReadonlyArray(
|
|
168053
|
-
if (
|
|
168051
|
+
function collectEnclosingScopes(range2) {
|
|
168052
|
+
let current = isReadonlyArray(range2.range) ? first(range2.range) : range2.range;
|
|
168053
|
+
if (range2.facts & 8 && !(range2.facts & 16)) {
|
|
168054
168054
|
const containingClass = getContainingClass(current);
|
|
168055
168055
|
if (containingClass) {
|
|
168056
168056
|
const containingFunction = findAncestor(current, isFunctionLikeDeclaration);
|
|
@@ -168164,7 +168164,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168164
168164
|
function getDescriptionForModuleLikeDeclaration(scope) {
|
|
168165
168165
|
return scope.kind === 269 ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 : 1;
|
|
168166
168166
|
}
|
|
168167
|
-
function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations,
|
|
168167
|
+
function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range2, context) {
|
|
168168
168168
|
const checker = context.program.getTypeChecker();
|
|
168169
168169
|
const scriptTarget = getEmitScriptTarget(context.program.getCompilerOptions());
|
|
168170
168170
|
const importAdder = ts_codefix_exports.createImportAdder(context.file, context.program, context.preferences, context.host);
|
|
@@ -168227,22 +168227,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168227
168227
|
/* AllowUnresolvedNames */
|
|
168228
168228
|
);
|
|
168229
168229
|
}
|
|
168230
|
-
const { body: body2, returnValueProperty } = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(
|
|
168230
|
+
const { body: body2, returnValueProperty } = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range2.facts & 1));
|
|
168231
168231
|
suppressLeadingAndTrailingTrivia(body2);
|
|
168232
168232
|
let newFunction;
|
|
168233
|
-
const callThis = !!(
|
|
168233
|
+
const callThis = !!(range2.facts & 16);
|
|
168234
168234
|
if (isClassLike(scope)) {
|
|
168235
168235
|
const modifiers = isJS ? [] : [factory.createModifier(
|
|
168236
168236
|
123
|
|
168237
168237
|
/* PrivateKeyword */
|
|
168238
168238
|
)];
|
|
168239
|
-
if (
|
|
168239
|
+
if (range2.facts & 32) {
|
|
168240
168240
|
modifiers.push(factory.createModifier(
|
|
168241
168241
|
126
|
|
168242
168242
|
/* StaticKeyword */
|
|
168243
168243
|
));
|
|
168244
168244
|
}
|
|
168245
|
-
if (
|
|
168245
|
+
if (range2.facts & 4) {
|
|
168246
168246
|
modifiers.push(factory.createModifier(
|
|
168247
168247
|
134
|
|
168248
168248
|
/* AsyncKeyword */
|
|
@@ -168250,7 +168250,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168250
168250
|
}
|
|
168251
168251
|
newFunction = factory.createMethodDeclaration(
|
|
168252
168252
|
modifiers.length ? modifiers : void 0,
|
|
168253
|
-
|
|
168253
|
+
range2.facts & 2 ? factory.createToken(
|
|
168254
168254
|
42
|
|
168255
168255
|
/* AsteriskToken */
|
|
168256
168256
|
) : void 0,
|
|
@@ -168275,7 +168275,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168275
168275
|
/*questionToken*/
|
|
168276
168276
|
void 0,
|
|
168277
168277
|
checker.typeToTypeNode(
|
|
168278
|
-
checker.getTypeAtLocation(
|
|
168278
|
+
checker.getTypeAtLocation(range2.thisNode),
|
|
168279
168279
|
scope,
|
|
168280
168280
|
1,
|
|
168281
168281
|
8
|
|
@@ -168287,11 +168287,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168287
168287
|
);
|
|
168288
168288
|
}
|
|
168289
168289
|
newFunction = factory.createFunctionDeclaration(
|
|
168290
|
-
|
|
168290
|
+
range2.facts & 4 ? [factory.createToken(
|
|
168291
168291
|
134
|
|
168292
168292
|
/* AsyncKeyword */
|
|
168293
168293
|
)] : void 0,
|
|
168294
|
-
|
|
168294
|
+
range2.facts & 2 ? factory.createToken(
|
|
168295
168295
|
42
|
|
168296
168296
|
/* AsteriskToken */
|
|
168297
168297
|
) : void 0,
|
|
@@ -168303,7 +168303,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168303
168303
|
);
|
|
168304
168304
|
}
|
|
168305
168305
|
const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context);
|
|
168306
|
-
const minInsertionPos = (isReadonlyArray(
|
|
168306
|
+
const minInsertionPos = (isReadonlyArray(range2.range) ? last(range2.range) : range2.range).end;
|
|
168307
168307
|
const nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope);
|
|
168308
168308
|
if (nodeToInsertBefore) {
|
|
168309
168309
|
changeTracker.insertNodeBefore(
|
|
@@ -168318,7 +168318,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168318
168318
|
}
|
|
168319
168319
|
importAdder.writeFixes(changeTracker);
|
|
168320
168320
|
const newNodes = [];
|
|
168321
|
-
const called = getCalledExpression(scope,
|
|
168321
|
+
const called = getCalledExpression(scope, range2, functionNameText);
|
|
168322
168322
|
if (callThis) {
|
|
168323
168323
|
callArguments.unshift(factory.createIdentifier("this"));
|
|
168324
168324
|
}
|
|
@@ -168331,13 +168331,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168331
168331
|
// Note that no attempt is made to take advantage of type argument inference
|
|
168332
168332
|
callArguments
|
|
168333
168333
|
);
|
|
168334
|
-
if (
|
|
168334
|
+
if (range2.facts & 2) {
|
|
168335
168335
|
call = factory.createYieldExpression(factory.createToken(
|
|
168336
168336
|
42
|
|
168337
168337
|
/* AsteriskToken */
|
|
168338
168338
|
), call);
|
|
168339
168339
|
}
|
|
168340
|
-
if (
|
|
168340
|
+
if (range2.facts & 4) {
|
|
168341
168341
|
call = factory.createAwaitExpression(call);
|
|
168342
168342
|
}
|
|
168343
168343
|
if (isInJSXContent(node)) {
|
|
@@ -168349,7 +168349,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168349
168349
|
}
|
|
168350
168350
|
if (exposedVariableDeclarations.length && !writes) {
|
|
168351
168351
|
Debug.assert(!returnValueProperty, "Expected no returnValueProperty");
|
|
168352
|
-
Debug.assert(!(
|
|
168352
|
+
Debug.assert(!(range2.facts & 1), "Expected RangeFacts.HasReturn flag to be unset");
|
|
168353
168353
|
if (exposedVariableDeclarations.length === 1) {
|
|
168354
168354
|
const variableDeclaration = exposedVariableDeclarations[0];
|
|
168355
168355
|
newNodes.push(factory.createVariableStatement(
|
|
@@ -168472,7 +168472,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168472
168472
|
if (assignments.length === 1) {
|
|
168473
168473
|
Debug.assert(!returnValueProperty, "Shouldn't have returnValueProperty here");
|
|
168474
168474
|
newNodes.push(factory.createExpressionStatement(factory.createAssignment(assignments[0].name, call)));
|
|
168475
|
-
if (
|
|
168475
|
+
if (range2.facts & 1) {
|
|
168476
168476
|
newNodes.push(factory.createReturnStatement());
|
|
168477
168477
|
}
|
|
168478
168478
|
} else {
|
|
@@ -168482,21 +168482,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168482
168482
|
}
|
|
168483
168483
|
}
|
|
168484
168484
|
} else {
|
|
168485
|
-
if (
|
|
168485
|
+
if (range2.facts & 1) {
|
|
168486
168486
|
newNodes.push(factory.createReturnStatement(call));
|
|
168487
|
-
} else if (isReadonlyArray(
|
|
168487
|
+
} else if (isReadonlyArray(range2.range)) {
|
|
168488
168488
|
newNodes.push(factory.createExpressionStatement(call));
|
|
168489
168489
|
} else {
|
|
168490
168490
|
newNodes.push(call);
|
|
168491
168491
|
}
|
|
168492
168492
|
}
|
|
168493
|
-
if (isReadonlyArray(
|
|
168494
|
-
changeTracker.replaceNodeRangeWithNodes(context.file, first(
|
|
168493
|
+
if (isReadonlyArray(range2.range)) {
|
|
168494
|
+
changeTracker.replaceNodeRangeWithNodes(context.file, first(range2.range), last(range2.range), newNodes);
|
|
168495
168495
|
} else {
|
|
168496
|
-
changeTracker.replaceNodeWithNodes(context.file,
|
|
168496
|
+
changeTracker.replaceNodeWithNodes(context.file, range2.range, newNodes);
|
|
168497
168497
|
}
|
|
168498
168498
|
const edits = changeTracker.getChanges();
|
|
168499
|
-
const renameRange = isReadonlyArray(
|
|
168499
|
+
const renameRange = isReadonlyArray(range2.range) ? first(range2.range) : range2.range;
|
|
168500
168500
|
const renameFilename = renameRange.getSourceFile().fileName;
|
|
168501
168501
|
const renameLocation = getRenameLocation(
|
|
168502
168502
|
edits,
|
|
@@ -168766,10 +168766,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
168766
168766
|
type2.symbol ? type2.symbol.getName() : ""
|
|
168767
168767
|
) || compareValues(type1.id, type2.id);
|
|
168768
168768
|
}
|
|
168769
|
-
function getCalledExpression(scope,
|
|
168769
|
+
function getCalledExpression(scope, range2, functionNameText) {
|
|
168770
168770
|
const functionReference = factory.createIdentifier(functionNameText);
|
|
168771
168771
|
if (isClassLike(scope)) {
|
|
168772
|
-
const lhs =
|
|
168772
|
+
const lhs = range2.facts & 32 ? factory.createIdentifier(scope.name.text) : factory.createThis();
|
|
168773
168773
|
return factory.createPropertyAccessExpression(lhs, functionReference);
|
|
168774
168774
|
} else {
|
|
168775
168775
|
return functionReference;
|
|
@@ -170972,7 +170972,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
170972
170972
|
}
|
|
170973
170973
|
function getNodesForRanges(file, ranges) {
|
|
170974
170974
|
const nodes = [];
|
|
170975
|
-
const spans = normalizeSpans(ranges.map((
|
|
170975
|
+
const spans = normalizeSpans(ranges.map((range2) => createTextSpanFromRange(range2)));
|
|
170976
170976
|
for (const span of spans) {
|
|
170977
170977
|
const nodesForSpan = getNodesForSpan(file, span);
|
|
170978
170978
|
if (!nodesForSpan) {
|
|
@@ -171760,8 +171760,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
171760
171760
|
}
|
|
171761
171761
|
function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) {
|
|
171762
171762
|
const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
|
|
171763
|
-
const
|
|
171764
|
-
return
|
|
171763
|
+
const range2 = ts_formatting_exports.getRangeOfEnclosingComment(sourceFile, position);
|
|
171764
|
+
return range2 && (!onlyMultiLine || range2.kind === 3) ? createTextSpanFromRange(range2) : void 0;
|
|
171765
171765
|
}
|
|
171766
171766
|
function getTodoComments(fileName, descriptors) {
|
|
171767
171767
|
synchronizeHostData();
|
|
@@ -172905,13 +172905,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
172905
172905
|
const target = isTaggedTemplateExpression(node) ? node.tag : isJsxOpeningLikeElement(node) ? node.tagName : isAccessExpression(node) ? node : isClassStaticBlockDeclaration(node) ? node : node.expression;
|
|
172906
172906
|
const declaration = resolveCallHierarchyDeclaration(program, target);
|
|
172907
172907
|
if (declaration) {
|
|
172908
|
-
const
|
|
172908
|
+
const range2 = createTextRangeFromNode(target, node.getSourceFile());
|
|
172909
172909
|
if (isArray(declaration)) {
|
|
172910
172910
|
for (const decl of declaration) {
|
|
172911
|
-
callSites.push({ declaration: decl, range });
|
|
172911
|
+
callSites.push({ declaration: decl, range: range2 });
|
|
172912
172912
|
}
|
|
172913
172913
|
} else {
|
|
172914
|
-
callSites.push({ declaration, range });
|
|
172914
|
+
callSites.push({ declaration, range: range2 });
|
|
172915
172915
|
}
|
|
172916
172916
|
}
|
|
172917
172917
|
}
|
|
@@ -186320,23 +186320,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
186320
186320
|
let modifiers = 0;
|
|
186321
186321
|
let decorators;
|
|
186322
186322
|
let contextMod;
|
|
186323
|
-
const
|
|
186323
|
+
const range2 = { pos: position, end: position };
|
|
186324
186324
|
if (isPropertyDeclaration(contextToken.parent) && (contextMod = isModifierLike2(contextToken))) {
|
|
186325
186325
|
if (contextToken.parent.modifiers) {
|
|
186326
186326
|
modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303;
|
|
186327
186327
|
decorators = contextToken.parent.modifiers.filter(isDecorator) || [];
|
|
186328
|
-
|
|
186328
|
+
range2.pos = Math.min(...contextToken.parent.modifiers.map((n) => n.getStart(sourceFile)));
|
|
186329
186329
|
}
|
|
186330
186330
|
const contextModifierFlag = modifierToFlag(contextMod);
|
|
186331
186331
|
if (!(modifiers & contextModifierFlag)) {
|
|
186332
186332
|
modifiers |= contextModifierFlag;
|
|
186333
|
-
|
|
186333
|
+
range2.pos = Math.min(range2.pos, contextToken.getStart(sourceFile));
|
|
186334
186334
|
}
|
|
186335
186335
|
if (contextToken.parent.name !== contextToken) {
|
|
186336
|
-
|
|
186336
|
+
range2.end = contextToken.parent.name.getStart(sourceFile);
|
|
186337
186337
|
}
|
|
186338
186338
|
}
|
|
186339
|
-
return { modifiers, decorators, range:
|
|
186339
|
+
return { modifiers, decorators, range: range2.pos < range2.end ? range2 : void 0 };
|
|
186340
186340
|
}
|
|
186341
186341
|
function isModifierLike2(node) {
|
|
186342
186342
|
if (isModifier(node)) {
|
|
@@ -190216,11 +190216,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190216
190216
|
const compilerOptions = program.getCompilerOptions();
|
|
190217
190217
|
const token = getTokenAtPosition(sourceFile, position);
|
|
190218
190218
|
const commentRanges = getLeadingCommentRanges(sourceFile.text, token.pos);
|
|
190219
|
-
const
|
|
190220
|
-
if (!
|
|
190219
|
+
const range2 = commentRanges && find(commentRanges, (commentRange) => position >= commentRange.pos && position <= commentRange.end);
|
|
190220
|
+
if (!range2) {
|
|
190221
190221
|
return void 0;
|
|
190222
190222
|
}
|
|
190223
|
-
const text = sourceFile.text.slice(
|
|
190223
|
+
const text = sourceFile.text.slice(range2.pos, position);
|
|
190224
190224
|
const match2 = tripleSlashDirectiveFragmentRegex.exec(text);
|
|
190225
190225
|
if (!match2) {
|
|
190226
190226
|
return void 0;
|
|
@@ -190238,7 +190238,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190238
190238
|
true,
|
|
190239
190239
|
sourceFile.path
|
|
190240
190240
|
) : kind === "types" ? getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions, 1, sourceFile)) : Debug.fail();
|
|
190241
|
-
return addReplacementSpans(toComplete,
|
|
190241
|
+
return addReplacementSpans(toComplete, range2.pos + prefix.length, arrayFrom(names.values()));
|
|
190242
190242
|
}
|
|
190243
190243
|
function getCompletionEntriesFromTypings(program, host, moduleSpecifierResolutionHost, scriptPath, fragmentDirectory, extensionOptions, result = createNameAndKindSet()) {
|
|
190244
190244
|
const options = program.getCompilerOptions();
|
|
@@ -191626,11 +191626,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
191626
191626
|
}
|
|
191627
191627
|
return nodeEntry(reference.literal);
|
|
191628
191628
|
} else if (reference.kind === "implicit") {
|
|
191629
|
-
const
|
|
191629
|
+
const range2 = reference.literal.text !== externalHelpersModuleNameText && forEachChildRecursively(
|
|
191630
191630
|
reference.referencingFile,
|
|
191631
191631
|
(n) => !(n.transformFlags & 2) ? "skip" : isJsxElement(n) || isJsxSelfClosingElement(n) || isJsxFragment(n) ? n : void 0
|
|
191632
191632
|
) || reference.referencingFile.statements[0] || reference.referencingFile;
|
|
191633
|
-
return nodeEntry(
|
|
191633
|
+
return nodeEntry(range2);
|
|
191634
191634
|
} else {
|
|
191635
191635
|
return {
|
|
191636
191636
|
kind: 0,
|
|
@@ -193686,7 +193686,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
193686
193686
|
return false;
|
|
193687
193687
|
}
|
|
193688
193688
|
const regex = leadingParameterNameCommentRegexFactory(name2);
|
|
193689
|
-
return some(ranges, (
|
|
193689
|
+
return some(ranges, (range2) => regex.test(sourceFileText.substring(range2.pos, range2.end)));
|
|
193690
193690
|
}
|
|
193691
193691
|
function isHintableLiteral(node) {
|
|
193692
193692
|
switch (node.kind) {
|
|
@@ -195515,14 +195515,14 @@ ${content}
|
|
|
195515
195515
|
function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) {
|
|
195516
195516
|
const resolvedLocale = getOrganizeImportsLocale(preferences);
|
|
195517
195517
|
const caseFirst = preferences.organizeImportsCaseFirst ?? false;
|
|
195518
|
-
const
|
|
195518
|
+
const numeric2 = preferences.organizeImportsNumericCollation ?? false;
|
|
195519
195519
|
const accents = preferences.organizeImportsAccentCollation ?? true;
|
|
195520
195520
|
const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case";
|
|
195521
195521
|
const collator = new Intl.Collator(resolvedLocale, {
|
|
195522
195522
|
usage: "sort",
|
|
195523
195523
|
caseFirst: caseFirst || "false",
|
|
195524
195524
|
sensitivity,
|
|
195525
|
-
numeric
|
|
195525
|
+
numeric: numeric2
|
|
195526
195526
|
});
|
|
195527
195527
|
return collator.compare;
|
|
195528
195528
|
}
|
|
@@ -198117,8 +198117,8 @@ ${content}
|
|
|
198117
198117
|
});
|
|
198118
198118
|
}
|
|
198119
198119
|
}
|
|
198120
|
-
deleteRange(sourceFile,
|
|
198121
|
-
this.changes.push({ kind: 0, sourceFile, range });
|
|
198120
|
+
deleteRange(sourceFile, range2) {
|
|
198121
|
+
this.changes.push({ kind: 0, sourceFile, range: range2 });
|
|
198122
198122
|
}
|
|
198123
198123
|
delete(sourceFile, node) {
|
|
198124
198124
|
this.deletedNodes.push({ sourceFile, node });
|
|
@@ -198165,8 +198165,8 @@ ${content}
|
|
|
198165
198165
|
const endPosition = afterEndNode === void 0 ? sourceFile.text.length : getAdjustedStartPosition(sourceFile, afterEndNode, options);
|
|
198166
198166
|
this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });
|
|
198167
198167
|
}
|
|
198168
|
-
replaceRange(sourceFile,
|
|
198169
|
-
this.changes.push({ kind: 1, sourceFile, range, options, node: newNode });
|
|
198168
|
+
replaceRange(sourceFile, range2, newNode, options = {}) {
|
|
198169
|
+
this.changes.push({ kind: 1, sourceFile, range: range2, options, node: newNode });
|
|
198170
198170
|
}
|
|
198171
198171
|
replaceNode(sourceFile, oldNode, newNode, options = useNonAdjustedPositions) {
|
|
198172
198172
|
this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options);
|
|
@@ -198174,8 +198174,8 @@ ${content}
|
|
|
198174
198174
|
replaceNodeRange(sourceFile, startNode2, endNode2, newNode, options = useNonAdjustedPositions) {
|
|
198175
198175
|
this.replaceRange(sourceFile, getAdjustedRange(sourceFile, startNode2, endNode2, options), newNode, options);
|
|
198176
198176
|
}
|
|
198177
|
-
replaceRangeWithNodes(sourceFile,
|
|
198178
|
-
this.changes.push({ kind: 2, sourceFile, range, options, nodes: newNodes });
|
|
198177
|
+
replaceRangeWithNodes(sourceFile, range2, newNodes, options = {}) {
|
|
198178
|
+
this.changes.push({ kind: 2, sourceFile, range: range2, options, nodes: newNodes });
|
|
198179
198179
|
}
|
|
198180
198180
|
replaceNodeWithNodes(sourceFile, oldNode, newNodes, options = useNonAdjustedPositions) {
|
|
198181
198181
|
this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options);
|
|
@@ -198308,8 +198308,8 @@ ${content}
|
|
|
198308
198308
|
filterJSDocTags(sourceFile, parent2, predicate) {
|
|
198309
198309
|
this.replaceJSDocComment(sourceFile, parent2, filter2(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate));
|
|
198310
198310
|
}
|
|
198311
|
-
replaceRangeWithText(sourceFile,
|
|
198312
|
-
this.changes.push({ kind: 3, sourceFile, range, text });
|
|
198311
|
+
replaceRangeWithText(sourceFile, range2, text) {
|
|
198312
|
+
this.changes.push({ kind: 3, sourceFile, range: range2, text });
|
|
198313
198313
|
}
|
|
198314
198314
|
insertText(sourceFile, pos, text) {
|
|
198315
198315
|
this.replaceRangeWithText(sourceFile, createRange(pos), text);
|
|
@@ -199115,28 +199115,28 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
199115
199115
|
if (!ranges) return position;
|
|
199116
199116
|
let lastComment;
|
|
199117
199117
|
let firstNodeLine;
|
|
199118
|
-
for (const
|
|
199119
|
-
if (
|
|
199120
|
-
if (isPinnedComment(text,
|
|
199121
|
-
lastComment = { range, pinnedOrTripleSlash: true };
|
|
199118
|
+
for (const range2 of ranges) {
|
|
199119
|
+
if (range2.kind === 3) {
|
|
199120
|
+
if (isPinnedComment(text, range2.pos)) {
|
|
199121
|
+
lastComment = { range: range2, pinnedOrTripleSlash: true };
|
|
199122
199122
|
continue;
|
|
199123
199123
|
}
|
|
199124
|
-
} else if (isRecognizedTripleSlashComment(text,
|
|
199125
|
-
lastComment = { range, pinnedOrTripleSlash: true };
|
|
199124
|
+
} else if (isRecognizedTripleSlashComment(text, range2.pos, range2.end)) {
|
|
199125
|
+
lastComment = { range: range2, pinnedOrTripleSlash: true };
|
|
199126
199126
|
continue;
|
|
199127
199127
|
}
|
|
199128
199128
|
if (lastComment) {
|
|
199129
199129
|
if (lastComment.pinnedOrTripleSlash) break;
|
|
199130
|
-
const commentLine = sourceFile.getLineAndCharacterOfPosition(
|
|
199130
|
+
const commentLine = sourceFile.getLineAndCharacterOfPosition(range2.pos).line;
|
|
199131
199131
|
const lastCommentEndLine = sourceFile.getLineAndCharacterOfPosition(lastComment.range.end).line;
|
|
199132
199132
|
if (commentLine >= lastCommentEndLine + 2) break;
|
|
199133
199133
|
}
|
|
199134
199134
|
if (sourceFile.statements.length) {
|
|
199135
199135
|
if (firstNodeLine === void 0) firstNodeLine = sourceFile.getLineAndCharacterOfPosition(sourceFile.statements[0].getStart()).line;
|
|
199136
|
-
const commentEndLine = sourceFile.getLineAndCharacterOfPosition(
|
|
199136
|
+
const commentEndLine = sourceFile.getLineAndCharacterOfPosition(range2.end).line;
|
|
199137
199137
|
if (firstNodeLine < commentEndLine + 2) break;
|
|
199138
199138
|
}
|
|
199139
|
-
lastComment = { range, pinnedOrTripleSlash: false };
|
|
199139
|
+
lastComment = { range: range2, pinnedOrTripleSlash: false };
|
|
199140
199140
|
}
|
|
199141
199141
|
if (lastComment) {
|
|
199142
199142
|
position = lastComment.range.end;
|
|
@@ -201761,10 +201761,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
201761
201761
|
}
|
|
201762
201762
|
return false;
|
|
201763
201763
|
}
|
|
201764
|
-
function findEnclosingNode(
|
|
201764
|
+
function findEnclosingNode(range2, sourceFile) {
|
|
201765
201765
|
return find2(sourceFile);
|
|
201766
201766
|
function find2(n) {
|
|
201767
|
-
const candidate = forEachChild(n, (c) => startEndContainsRange(c.getStart(sourceFile), c.end,
|
|
201767
|
+
const candidate = forEachChild(n, (c) => startEndContainsRange(c.getStart(sourceFile), c.end, range2) && c);
|
|
201768
201768
|
if (candidate) {
|
|
201769
201769
|
const result = find2(candidate);
|
|
201770
201770
|
if (result) {
|
|
@@ -201834,9 +201834,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
201834
201834
|
return 0;
|
|
201835
201835
|
}
|
|
201836
201836
|
function formatNodeGivenIndentation(node, sourceFileLike, languageVariant, initialIndentation, delta, formatContext) {
|
|
201837
|
-
const
|
|
201838
|
-
return getFormattingScanner(sourceFileLike.text, languageVariant,
|
|
201839
|
-
|
|
201837
|
+
const range2 = { pos: node.pos, end: node.end };
|
|
201838
|
+
return getFormattingScanner(sourceFileLike.text, languageVariant, range2.pos, range2.end, (scanner2) => formatSpanWorker(
|
|
201839
|
+
range2,
|
|
201840
201840
|
node,
|
|
201841
201841
|
initialIndentation,
|
|
201842
201842
|
delta,
|
|
@@ -201952,8 +201952,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
201952
201952
|
}
|
|
201953
201953
|
}
|
|
201954
201954
|
return edits;
|
|
201955
|
-
function tryComputeIndentationForListItem(startPos, endPos, parentStartLine,
|
|
201956
|
-
if (rangeOverlapsWithStartEnd(
|
|
201955
|
+
function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range2, inheritedIndentation) {
|
|
201956
|
+
if (rangeOverlapsWithStartEnd(range2, startPos, endPos) || rangeContainsStartEnd(range2, startPos, endPos)) {
|
|
201957
201957
|
if (inheritedIndentation !== -1) {
|
|
201958
201958
|
return inheritedIndentation;
|
|
201959
201959
|
}
|
|
@@ -202342,19 +202342,19 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
202342
202342
|
}
|
|
202343
202343
|
}
|
|
202344
202344
|
}
|
|
202345
|
-
function processRange(
|
|
202346
|
-
const rangeHasError = rangeContainsError(
|
|
202345
|
+
function processRange(range2, rangeStart, parent2, contextNode, dynamicIndentation) {
|
|
202346
|
+
const rangeHasError = rangeContainsError(range2);
|
|
202347
202347
|
let lineAction = 0;
|
|
202348
202348
|
if (!rangeHasError) {
|
|
202349
202349
|
if (!previousRange) {
|
|
202350
202350
|
const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos);
|
|
202351
202351
|
trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line);
|
|
202352
202352
|
} else {
|
|
202353
|
-
lineAction = processPair(
|
|
202353
|
+
lineAction = processPair(range2, rangeStart.line, parent2, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation);
|
|
202354
202354
|
}
|
|
202355
202355
|
}
|
|
202356
|
-
previousRange =
|
|
202357
|
-
previousRangeTriviaEnd =
|
|
202356
|
+
previousRange = range2;
|
|
202357
|
+
previousRangeTriviaEnd = range2.end;
|
|
202358
202358
|
previousParent = parent2;
|
|
202359
202359
|
previousRangeStartLine = rangeStart.line;
|
|
202360
202360
|
return lineAction;
|
|
@@ -202475,11 +202475,11 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
202475
202475
|
}
|
|
202476
202476
|
}
|
|
202477
202477
|
}
|
|
202478
|
-
function trimTrailingWhitespacesForLines(line1, line2,
|
|
202478
|
+
function trimTrailingWhitespacesForLines(line1, line2, range2) {
|
|
202479
202479
|
for (let line = line1; line < line2; line++) {
|
|
202480
202480
|
const lineStartPosition = getStartPositionOfLine(line, sourceFile);
|
|
202481
202481
|
const lineEndPosition = getEndLinePosition(line, sourceFile);
|
|
202482
|
-
if (
|
|
202482
|
+
if (range2 && (isComment(range2.kind) || isStringOrRegularExpressionOrTemplateLiteral(range2.kind)) && range2.pos <= lineEndPosition && range2.end > lineEndPosition) {
|
|
202483
202483
|
continue;
|
|
202484
202484
|
}
|
|
202485
202485
|
const whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition);
|
|
@@ -202584,7 +202584,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
202584
202584
|
const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end);
|
|
202585
202585
|
const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile);
|
|
202586
202586
|
const commentRanges = concatenate(trailingRangesOfPreviousToken, leadingCommentRangesOfNextToken);
|
|
202587
|
-
return commentRanges && find(commentRanges, (
|
|
202587
|
+
return commentRanges && find(commentRanges, (range2) => rangeContainsPositionExclusive(range2, position) || // The end marker of a single-line comment does not include the newline character.
|
|
202588
202588
|
// With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position):
|
|
202589
202589
|
//
|
|
202590
202590
|
// // asdf ^\n
|
|
@@ -202597,7 +202597,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
202597
202597
|
//
|
|
202598
202598
|
// Internally, we represent the end of the comment at the newline and closing '/', respectively.
|
|
202599
202599
|
//
|
|
202600
|
-
position ===
|
|
202600
|
+
position === range2.end && (range2.kind === 2 || position === sourceFile.getFullWidth()));
|
|
202601
202601
|
}
|
|
202602
202602
|
function getOpenTokenForList(node, list) {
|
|
202603
202603
|
switch (node.kind) {
|
|
@@ -203220,10 +203220,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203220
203220
|
) && !(isNextChild && child && isControlFlowEndingStatement(child.kind, parent2));
|
|
203221
203221
|
}
|
|
203222
203222
|
SmartIndenter2.shouldIndentChildNode = shouldIndentChildNode;
|
|
203223
|
-
function rangeIsOnOneLine(sourceFile,
|
|
203224
|
-
const rangeStart = skipTrivia(sourceFile.text,
|
|
203223
|
+
function rangeIsOnOneLine(sourceFile, range2) {
|
|
203224
|
+
const rangeStart = skipTrivia(sourceFile.text, range2.pos);
|
|
203225
203225
|
const startLine = sourceFile.getLineAndCharacterOfPosition(rangeStart).line;
|
|
203226
|
-
const endLine = sourceFile.getLineAndCharacterOfPosition(
|
|
203226
|
+
const endLine = sourceFile.getLineAndCharacterOfPosition(range2.end).line;
|
|
203227
203227
|
return startLine === endLine;
|
|
203228
203228
|
}
|
|
203229
203229
|
})(SmartIndenter || (SmartIndenter = {}));
|
|
@@ -203233,16 +203233,16 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203233
203233
|
});
|
|
203234
203234
|
function preparePasteEdits(sourceFile, copiedFromRange, checker) {
|
|
203235
203235
|
let shouldProvidePasteEdits = false;
|
|
203236
|
-
copiedFromRange.forEach((
|
|
203236
|
+
copiedFromRange.forEach((range2) => {
|
|
203237
203237
|
const enclosingNode = findAncestor(
|
|
203238
|
-
getTokenAtPosition(sourceFile,
|
|
203239
|
-
(ancestorNode) => rangeContainsRange(ancestorNode,
|
|
203238
|
+
getTokenAtPosition(sourceFile, range2.pos),
|
|
203239
|
+
(ancestorNode) => rangeContainsRange(ancestorNode, range2)
|
|
203240
203240
|
);
|
|
203241
203241
|
if (!enclosingNode) return;
|
|
203242
203242
|
forEachChild(enclosingNode, function checkNameResolution(node) {
|
|
203243
203243
|
var _a2;
|
|
203244
203244
|
if (shouldProvidePasteEdits) return;
|
|
203245
|
-
if (isIdentifier(node) && rangeContainsPosition(
|
|
203245
|
+
if (isIdentifier(node) && rangeContainsPosition(range2, node.getStart(sourceFile))) {
|
|
203246
203246
|
const resolvedSymbol = checker.resolveName(
|
|
203247
203247
|
node.text,
|
|
203248
203248
|
node,
|
|
@@ -203322,15 +203322,15 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203322
203322
|
const textToBePasted = actualPastedText ?? pastedText[i2];
|
|
203323
203323
|
const startPos = location.pos + offset;
|
|
203324
203324
|
const endPos = startPos + textToBePasted.length;
|
|
203325
|
-
const
|
|
203325
|
+
const range2 = { pos: startPos, end: endPos };
|
|
203326
203326
|
offset += textToBePasted.length - oldTextLength;
|
|
203327
203327
|
const enclosingNode = findAncestor(
|
|
203328
|
-
getTokenAtPosition(context.sourceFile,
|
|
203329
|
-
(ancestorNode) => rangeContainsRange(ancestorNode,
|
|
203328
|
+
getTokenAtPosition(context.sourceFile, range2.pos),
|
|
203329
|
+
(ancestorNode) => rangeContainsRange(ancestorNode, range2)
|
|
203330
203330
|
);
|
|
203331
203331
|
if (!enclosingNode) return;
|
|
203332
203332
|
forEachChild(enclosingNode, function importUnresolvedIdentifiers(node) {
|
|
203333
|
-
const isImportCandidate = isIdentifier(node) && rangeContainsPosition(
|
|
203333
|
+
const isImportCandidate = isIdentifier(node) && rangeContainsPosition(range2, node.getStart(updatedFile)) && !(updatedProgram == null ? void 0 : updatedProgram.getTypeChecker().resolveName(
|
|
203334
203334
|
node.text,
|
|
203335
203335
|
node,
|
|
203336
203336
|
-1,
|
|
@@ -203362,9 +203362,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
203362
203362
|
);
|
|
203363
203363
|
});
|
|
203364
203364
|
}
|
|
203365
|
-
function getUsageInfoRangeForPasteEdits({ file: sourceFile, range }) {
|
|
203366
|
-
const pos =
|
|
203367
|
-
const end =
|
|
203365
|
+
function getUsageInfoRangeForPasteEdits({ file: sourceFile, range: range2 }) {
|
|
203366
|
+
const pos = range2[0].pos;
|
|
203367
|
+
const end = range2[range2.length - 1].end;
|
|
203368
203368
|
const startToken = getTokenAtPosition(sourceFile, pos);
|
|
203369
203369
|
const endToken = findTokenOnLeftOfPosition(sourceFile, pos) ?? getTokenAtPosition(sourceFile, end);
|
|
203370
203370
|
return {
|
|
@@ -215579,7 +215579,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
215579
215579
|
return next.immediate("regionSemanticCheck", () => {
|
|
215580
215580
|
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(fileName);
|
|
215581
215581
|
if (scriptInfo) {
|
|
215582
|
-
this.regionSemanticCheck(fileName, project, ranges.map((
|
|
215582
|
+
this.regionSemanticCheck(fileName, project, ranges.map((range2) => this.getRange({ file: fileName, ...range2 }, scriptInfo)));
|
|
215583
215583
|
}
|
|
215584
215584
|
if (this.changeSeq !== seq) {
|
|
215585
215585
|
return;
|
|
@@ -218587,215 +218587,6 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
218587
218587
|
}
|
|
218588
218588
|
});
|
|
218589
218589
|
|
|
218590
|
-
// ../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
|
|
218591
|
-
var require_balanced_match = __commonJS({
|
|
218592
|
-
"../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports2, module2) {
|
|
218593
|
-
"use strict";
|
|
218594
|
-
module2.exports = balanced;
|
|
218595
|
-
function balanced(a, b, str) {
|
|
218596
|
-
if (a instanceof RegExp) a = maybeMatch(a, str);
|
|
218597
|
-
if (b instanceof RegExp) b = maybeMatch(b, str);
|
|
218598
|
-
var r = range(a, b, str);
|
|
218599
|
-
return r && {
|
|
218600
|
-
start: r[0],
|
|
218601
|
-
end: r[1],
|
|
218602
|
-
pre: str.slice(0, r[0]),
|
|
218603
|
-
body: str.slice(r[0] + a.length, r[1]),
|
|
218604
|
-
post: str.slice(r[1] + b.length)
|
|
218605
|
-
};
|
|
218606
|
-
}
|
|
218607
|
-
function maybeMatch(reg, str) {
|
|
218608
|
-
var m = str.match(reg);
|
|
218609
|
-
return m ? m[0] : null;
|
|
218610
|
-
}
|
|
218611
|
-
balanced.range = range;
|
|
218612
|
-
function range(a, b, str) {
|
|
218613
|
-
var begs, beg, left, right, result;
|
|
218614
|
-
var ai = str.indexOf(a);
|
|
218615
|
-
var bi = str.indexOf(b, ai + 1);
|
|
218616
|
-
var i2 = ai;
|
|
218617
|
-
if (ai >= 0 && bi > 0) {
|
|
218618
|
-
if (a === b) {
|
|
218619
|
-
return [ai, bi];
|
|
218620
|
-
}
|
|
218621
|
-
begs = [];
|
|
218622
|
-
left = str.length;
|
|
218623
|
-
while (i2 >= 0 && !result) {
|
|
218624
|
-
if (i2 == ai) {
|
|
218625
|
-
begs.push(i2);
|
|
218626
|
-
ai = str.indexOf(a, i2 + 1);
|
|
218627
|
-
} else if (begs.length == 1) {
|
|
218628
|
-
result = [begs.pop(), bi];
|
|
218629
|
-
} else {
|
|
218630
|
-
beg = begs.pop();
|
|
218631
|
-
if (beg < left) {
|
|
218632
|
-
left = beg;
|
|
218633
|
-
right = bi;
|
|
218634
|
-
}
|
|
218635
|
-
bi = str.indexOf(b, i2 + 1);
|
|
218636
|
-
}
|
|
218637
|
-
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
218638
|
-
}
|
|
218639
|
-
if (begs.length) {
|
|
218640
|
-
result = [left, right];
|
|
218641
|
-
}
|
|
218642
|
-
}
|
|
218643
|
-
return result;
|
|
218644
|
-
}
|
|
218645
|
-
}
|
|
218646
|
-
});
|
|
218647
|
-
|
|
218648
|
-
// ../../node_modules/.pnpm/brace-expansion@2.0.2/node_modules/brace-expansion/index.js
|
|
218649
|
-
var require_brace_expansion = __commonJS({
|
|
218650
|
-
"../../node_modules/.pnpm/brace-expansion@2.0.2/node_modules/brace-expansion/index.js"(exports2, module2) {
|
|
218651
|
-
"use strict";
|
|
218652
|
-
var balanced = require_balanced_match();
|
|
218653
|
-
module2.exports = expandTop;
|
|
218654
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
218655
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
218656
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
218657
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
218658
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
218659
|
-
function numeric(str) {
|
|
218660
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
218661
|
-
}
|
|
218662
|
-
function escapeBraces(str) {
|
|
218663
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
218664
|
-
}
|
|
218665
|
-
function unescapeBraces(str) {
|
|
218666
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
218667
|
-
}
|
|
218668
|
-
function parseCommaParts(str) {
|
|
218669
|
-
if (!str)
|
|
218670
|
-
return [""];
|
|
218671
|
-
var parts2 = [];
|
|
218672
|
-
var m = balanced("{", "}", str);
|
|
218673
|
-
if (!m)
|
|
218674
|
-
return str.split(",");
|
|
218675
|
-
var pre = m.pre;
|
|
218676
|
-
var body2 = m.body;
|
|
218677
|
-
var post2 = m.post;
|
|
218678
|
-
var p = pre.split(",");
|
|
218679
|
-
p[p.length - 1] += "{" + body2 + "}";
|
|
218680
|
-
var postParts = parseCommaParts(post2);
|
|
218681
|
-
if (post2.length) {
|
|
218682
|
-
p[p.length - 1] += postParts.shift();
|
|
218683
|
-
p.push.apply(p, postParts);
|
|
218684
|
-
}
|
|
218685
|
-
parts2.push.apply(parts2, p);
|
|
218686
|
-
return parts2;
|
|
218687
|
-
}
|
|
218688
|
-
function expandTop(str) {
|
|
218689
|
-
if (!str)
|
|
218690
|
-
return [];
|
|
218691
|
-
if (str.substr(0, 2) === "{}") {
|
|
218692
|
-
str = "\\{\\}" + str.substr(2);
|
|
218693
|
-
}
|
|
218694
|
-
return expand2(escapeBraces(str), true).map(unescapeBraces);
|
|
218695
|
-
}
|
|
218696
|
-
function embrace(str) {
|
|
218697
|
-
return "{" + str + "}";
|
|
218698
|
-
}
|
|
218699
|
-
function isPadded(el) {
|
|
218700
|
-
return /^-?0\d/.test(el);
|
|
218701
|
-
}
|
|
218702
|
-
function lte(i2, y) {
|
|
218703
|
-
return i2 <= y;
|
|
218704
|
-
}
|
|
218705
|
-
function gte(i2, y) {
|
|
218706
|
-
return i2 >= y;
|
|
218707
|
-
}
|
|
218708
|
-
function expand2(str, isTop) {
|
|
218709
|
-
var expansions = [];
|
|
218710
|
-
var m = balanced("{", "}", str);
|
|
218711
|
-
if (!m) return [str];
|
|
218712
|
-
var pre = m.pre;
|
|
218713
|
-
var post2 = m.post.length ? expand2(m.post, false) : [""];
|
|
218714
|
-
if (/\$$/.test(m.pre)) {
|
|
218715
|
-
for (var k = 0; k < post2.length; k++) {
|
|
218716
|
-
var expansion = pre + "{" + m.body + "}" + post2[k];
|
|
218717
|
-
expansions.push(expansion);
|
|
218718
|
-
}
|
|
218719
|
-
} else {
|
|
218720
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
218721
|
-
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
218722
|
-
var isSequence = isNumericSequence || isAlphaSequence;
|
|
218723
|
-
var isOptions = m.body.indexOf(",") >= 0;
|
|
218724
|
-
if (!isSequence && !isOptions) {
|
|
218725
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
218726
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
218727
|
-
return expand2(str);
|
|
218728
|
-
}
|
|
218729
|
-
return [str];
|
|
218730
|
-
}
|
|
218731
|
-
var n;
|
|
218732
|
-
if (isSequence) {
|
|
218733
|
-
n = m.body.split(/\.\./);
|
|
218734
|
-
} else {
|
|
218735
|
-
n = parseCommaParts(m.body);
|
|
218736
|
-
if (n.length === 1) {
|
|
218737
|
-
n = expand2(n[0], false).map(embrace);
|
|
218738
|
-
if (n.length === 1) {
|
|
218739
|
-
return post2.map(function(p) {
|
|
218740
|
-
return m.pre + n[0] + p;
|
|
218741
|
-
});
|
|
218742
|
-
}
|
|
218743
|
-
}
|
|
218744
|
-
}
|
|
218745
|
-
var N;
|
|
218746
|
-
if (isSequence) {
|
|
218747
|
-
var x = numeric(n[0]);
|
|
218748
|
-
var y = numeric(n[1]);
|
|
218749
|
-
var width = Math.max(n[0].length, n[1].length);
|
|
218750
|
-
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
218751
|
-
var test = lte;
|
|
218752
|
-
var reverse = y < x;
|
|
218753
|
-
if (reverse) {
|
|
218754
|
-
incr *= -1;
|
|
218755
|
-
test = gte;
|
|
218756
|
-
}
|
|
218757
|
-
var pad = n.some(isPadded);
|
|
218758
|
-
N = [];
|
|
218759
|
-
for (var i2 = x; test(i2, y); i2 += incr) {
|
|
218760
|
-
var c;
|
|
218761
|
-
if (isAlphaSequence) {
|
|
218762
|
-
c = String.fromCharCode(i2);
|
|
218763
|
-
if (c === "\\")
|
|
218764
|
-
c = "";
|
|
218765
|
-
} else {
|
|
218766
|
-
c = String(i2);
|
|
218767
|
-
if (pad) {
|
|
218768
|
-
var need = width - c.length;
|
|
218769
|
-
if (need > 0) {
|
|
218770
|
-
var z = new Array(need + 1).join("0");
|
|
218771
|
-
if (i2 < 0)
|
|
218772
|
-
c = "-" + z + c.slice(1);
|
|
218773
|
-
else
|
|
218774
|
-
c = z + c;
|
|
218775
|
-
}
|
|
218776
|
-
}
|
|
218777
|
-
}
|
|
218778
|
-
N.push(c);
|
|
218779
|
-
}
|
|
218780
|
-
} else {
|
|
218781
|
-
N = [];
|
|
218782
|
-
for (var j = 0; j < n.length; j++) {
|
|
218783
|
-
N.push.apply(N, expand2(n[j], false));
|
|
218784
|
-
}
|
|
218785
|
-
}
|
|
218786
|
-
for (var j = 0; j < N.length; j++) {
|
|
218787
|
-
for (var k = 0; k < post2.length; k++) {
|
|
218788
|
-
var expansion = pre + N[j] + post2[k];
|
|
218789
|
-
if (!isTop || isSequence || expansion)
|
|
218790
|
-
expansions.push(expansion);
|
|
218791
|
-
}
|
|
218792
|
-
}
|
|
218793
|
-
}
|
|
218794
|
-
return expansions;
|
|
218795
|
-
}
|
|
218796
|
-
}
|
|
218797
|
-
});
|
|
218798
|
-
|
|
218799
218590
|
// ../context-evolution/dist/index.js
|
|
218800
218591
|
var dist_exports = {};
|
|
218801
218592
|
__export(dist_exports, {
|
|
@@ -222984,13 +222775,13 @@ ${indentData}`);
|
|
|
222984
222775
|
}
|
|
222985
222776
|
}
|
|
222986
222777
|
function xrange(n, exception) {
|
|
222987
|
-
let
|
|
222778
|
+
let range2 = [];
|
|
222988
222779
|
for (let i2 = 0; i2 < n; i2++) {
|
|
222989
222780
|
if (i2 !== exception) {
|
|
222990
|
-
|
|
222781
|
+
range2.push(i2);
|
|
222991
222782
|
}
|
|
222992
222783
|
}
|
|
222993
|
-
return
|
|
222784
|
+
return range2;
|
|
222994
222785
|
}
|
|
222995
222786
|
function dependenciesOneRow(error, matrix2, index2, thresholdValue = 1e-9, thresholdError = 1e-9) {
|
|
222996
222787
|
if (error > thresholdError) {
|
|
@@ -224018,7 +223809,7 @@ var require_ignore = __commonJS({
|
|
|
224018
223809
|
};
|
|
224019
223810
|
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
|
|
224020
223811
|
var RETURN_FALSE = () => false;
|
|
224021
|
-
var sanitizeRange = (
|
|
223812
|
+
var sanitizeRange = (range2) => range2.replace(
|
|
224022
223813
|
REGEX_REGEXP_RANGE,
|
|
224023
223814
|
(match2, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match2 : EMPTY
|
|
224024
223815
|
);
|
|
@@ -224154,7 +223945,7 @@ var require_ignore = __commonJS({
|
|
|
224154
223945
|
// > can be used to match one of the characters in a range.
|
|
224155
223946
|
// `\` is escaped by step 3
|
|
224156
223947
|
/(\\)?\[([^\]/]*?)(\\*)($|\])/g,
|
|
224157
|
-
(match2, leadEscape,
|
|
223948
|
+
(match2, leadEscape, range2, endEscape, close) => leadEscape === ESCAPE ? `\\[${range2}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range2)}${endEscape}]` : "[]" : "[]"
|
|
224158
223949
|
],
|
|
224159
223950
|
// ending
|
|
224160
223951
|
[
|
|
@@ -227745,13 +227536,13 @@ var require_parse_options = __commonJS({
|
|
|
227745
227536
|
var require_identifiers = __commonJS({
|
|
227746
227537
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
227747
227538
|
"use strict";
|
|
227748
|
-
var
|
|
227539
|
+
var numeric2 = /^[0-9]+$/;
|
|
227749
227540
|
var compareIdentifiers = (a, b) => {
|
|
227750
227541
|
if (typeof a === "number" && typeof b === "number") {
|
|
227751
227542
|
return a === b ? 0 : a < b ? -1 : 1;
|
|
227752
227543
|
}
|
|
227753
|
-
const anum =
|
|
227754
|
-
const bnum =
|
|
227544
|
+
const anum = numeric2.test(a);
|
|
227545
|
+
const bnum = numeric2.test(b);
|
|
227755
227546
|
if (anum && bnum) {
|
|
227756
227547
|
a = +a;
|
|
227757
227548
|
b = +b;
|
|
@@ -228128,8 +227919,8 @@ var require_gte = __commonJS({
|
|
|
228128
227919
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
228129
227920
|
"use strict";
|
|
228130
227921
|
var compare = require_compare();
|
|
228131
|
-
var
|
|
228132
|
-
module2.exports =
|
|
227922
|
+
var gte2 = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
227923
|
+
module2.exports = gte2;
|
|
228133
227924
|
}
|
|
228134
227925
|
});
|
|
228135
227926
|
|
|
@@ -228216,8 +228007,8 @@ var require_lte = __commonJS({
|
|
|
228216
228007
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports2, module2) {
|
|
228217
228008
|
"use strict";
|
|
228218
228009
|
var compare = require_compare();
|
|
228219
|
-
var
|
|
228220
|
-
module2.exports =
|
|
228010
|
+
var lte2 = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
228011
|
+
module2.exports = lte2;
|
|
228221
228012
|
}
|
|
228222
228013
|
});
|
|
228223
228014
|
|
|
@@ -228228,9 +228019,9 @@ var require_cmp = __commonJS({
|
|
|
228228
228019
|
var eq = require_eq();
|
|
228229
228020
|
var neq = require_neq();
|
|
228230
228021
|
var gt = require_gt();
|
|
228231
|
-
var
|
|
228022
|
+
var gte2 = require_gte();
|
|
228232
228023
|
var lt = require_lt();
|
|
228233
|
-
var
|
|
228024
|
+
var lte2 = require_lte();
|
|
228234
228025
|
var cmp = (a, op, b, loose) => {
|
|
228235
228026
|
switch (op) {
|
|
228236
228027
|
case "===":
|
|
@@ -228258,11 +228049,11 @@ var require_cmp = __commonJS({
|
|
|
228258
228049
|
case ">":
|
|
228259
228050
|
return gt(a, b, loose);
|
|
228260
228051
|
case ">=":
|
|
228261
|
-
return
|
|
228052
|
+
return gte2(a, b, loose);
|
|
228262
228053
|
case "<":
|
|
228263
228054
|
return lt(a, b, loose);
|
|
228264
228055
|
case "<=":
|
|
228265
|
-
return
|
|
228056
|
+
return lte2(a, b, loose);
|
|
228266
228057
|
default:
|
|
228267
228058
|
throw new TypeError(`Invalid operator: ${op}`);
|
|
228268
228059
|
}
|
|
@@ -228390,25 +228181,25 @@ var require_range = __commonJS({
|
|
|
228390
228181
|
"use strict";
|
|
228391
228182
|
var SPACE_CHARACTERS = /\s+/g;
|
|
228392
228183
|
var Range = class _Range {
|
|
228393
|
-
constructor(
|
|
228184
|
+
constructor(range2, options) {
|
|
228394
228185
|
options = parseOptions(options);
|
|
228395
|
-
if (
|
|
228396
|
-
if (
|
|
228397
|
-
return
|
|
228186
|
+
if (range2 instanceof _Range) {
|
|
228187
|
+
if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
|
|
228188
|
+
return range2;
|
|
228398
228189
|
} else {
|
|
228399
|
-
return new _Range(
|
|
228190
|
+
return new _Range(range2.raw, options);
|
|
228400
228191
|
}
|
|
228401
228192
|
}
|
|
228402
|
-
if (
|
|
228403
|
-
this.raw =
|
|
228404
|
-
this.set = [[
|
|
228193
|
+
if (range2 instanceof Comparator) {
|
|
228194
|
+
this.raw = range2.value;
|
|
228195
|
+
this.set = [[range2]];
|
|
228405
228196
|
this.formatted = void 0;
|
|
228406
228197
|
return this;
|
|
228407
228198
|
}
|
|
228408
228199
|
this.options = options;
|
|
228409
228200
|
this.loose = !!options.loose;
|
|
228410
228201
|
this.includePrerelease = !!options.includePrerelease;
|
|
228411
|
-
this.raw =
|
|
228202
|
+
this.raw = range2.trim().replace(SPACE_CHARACTERS, " ");
|
|
228412
228203
|
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
228413
228204
|
if (!this.set.length) {
|
|
228414
228205
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
@@ -228453,24 +228244,24 @@ var require_range = __commonJS({
|
|
|
228453
228244
|
toString() {
|
|
228454
228245
|
return this.range;
|
|
228455
228246
|
}
|
|
228456
|
-
parseRange(
|
|
228247
|
+
parseRange(range2) {
|
|
228457
228248
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
228458
|
-
const memoKey = memoOpts + ":" +
|
|
228249
|
+
const memoKey = memoOpts + ":" + range2;
|
|
228459
228250
|
const cached = cache.get(memoKey);
|
|
228460
228251
|
if (cached) {
|
|
228461
228252
|
return cached;
|
|
228462
228253
|
}
|
|
228463
228254
|
const loose = this.options.loose;
|
|
228464
228255
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
228465
|
-
|
|
228466
|
-
debug("hyphen replace",
|
|
228467
|
-
|
|
228468
|
-
debug("comparator trim",
|
|
228469
|
-
|
|
228470
|
-
debug("tilde trim",
|
|
228471
|
-
|
|
228472
|
-
debug("caret trim",
|
|
228473
|
-
let rangeList =
|
|
228256
|
+
range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
228257
|
+
debug("hyphen replace", range2);
|
|
228258
|
+
range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
228259
|
+
debug("comparator trim", range2);
|
|
228260
|
+
range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
228261
|
+
debug("tilde trim", range2);
|
|
228262
|
+
range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
228263
|
+
debug("caret trim", range2);
|
|
228264
|
+
let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
228474
228265
|
if (loose) {
|
|
228475
228266
|
rangeList = rangeList.filter((comp) => {
|
|
228476
228267
|
debug("loose invalid filter", comp, this.options);
|
|
@@ -228493,12 +228284,12 @@ var require_range = __commonJS({
|
|
|
228493
228284
|
cache.set(memoKey, result);
|
|
228494
228285
|
return result;
|
|
228495
228286
|
}
|
|
228496
|
-
intersects(
|
|
228497
|
-
if (!(
|
|
228287
|
+
intersects(range2, options) {
|
|
228288
|
+
if (!(range2 instanceof _Range)) {
|
|
228498
228289
|
throw new TypeError("a Range is required");
|
|
228499
228290
|
}
|
|
228500
228291
|
return this.set.some((thisComparators) => {
|
|
228501
|
-
return isSatisfiable(thisComparators, options) &&
|
|
228292
|
+
return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => {
|
|
228502
228293
|
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
228503
228294
|
return rangeComparators.every((rangeComparator) => {
|
|
228504
228295
|
return thisComparator.intersects(rangeComparator, options);
|
|
@@ -228766,13 +228557,13 @@ var require_satisfies = __commonJS({
|
|
|
228766
228557
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(exports2, module2) {
|
|
228767
228558
|
"use strict";
|
|
228768
228559
|
var Range = require_range();
|
|
228769
|
-
var satisfies = (version3,
|
|
228560
|
+
var satisfies = (version3, range2, options) => {
|
|
228770
228561
|
try {
|
|
228771
|
-
|
|
228562
|
+
range2 = new Range(range2, options);
|
|
228772
228563
|
} catch (er) {
|
|
228773
228564
|
return false;
|
|
228774
228565
|
}
|
|
228775
|
-
return
|
|
228566
|
+
return range2.test(version3);
|
|
228776
228567
|
};
|
|
228777
228568
|
module2.exports = satisfies;
|
|
228778
228569
|
}
|
|
@@ -235747,7 +235538,7 @@ var init_transformers_node = __esm({
|
|
|
235747
235538
|
}
|
|
235748
235539
|
return program;
|
|
235749
235540
|
}
|
|
235750
|
-
function
|
|
235541
|
+
function range2(start2, stop2, step = 1) {
|
|
235751
235542
|
if (stop2 === void 0) {
|
|
235752
235543
|
stop2 = start2;
|
|
235753
235544
|
start2 = 0;
|
|
@@ -236292,7 +236083,7 @@ var init_transformers_node = __esm({
|
|
|
236292
236083
|
env3.set("raise_exception", (args2) => {
|
|
236293
236084
|
throw new Error(args2);
|
|
236294
236085
|
});
|
|
236295
|
-
env3.set("range",
|
|
236086
|
+
env3.set("range", range2);
|
|
236296
236087
|
env3.set("strftime_now", strftime_now);
|
|
236297
236088
|
env3.set("True", true);
|
|
236298
236089
|
env3.set("False", false);
|
|
@@ -276048,8 +275839,8 @@ async function semanticIdentifierSearch(options) {
|
|
|
276048
275839
|
];
|
|
276049
275840
|
for (let i2 = 0; i2 < top.length; i2++) {
|
|
276050
275841
|
const item = top[i2];
|
|
276051
|
-
const
|
|
276052
|
-
lines.push(`${i2 + 1}. ${item.doc.kind} ${item.doc.name} - ${item.doc.path} (${
|
|
275842
|
+
const range2 = formatLineRange3(item.doc.line, item.doc.endLine);
|
|
275843
|
+
lines.push(`${i2 + 1}. ${item.doc.kind} ${item.doc.name} - ${item.doc.path} (${range2})`);
|
|
276053
275844
|
lines.push(` Score: ${Math.round(item.score * 1e3) / 10}% | Semantic: ${Math.round(item.semanticScore * 1e3) / 10}% | Keyword: ${Math.round(item.keywordScore * 1e3) / 10}%`);
|
|
276054
275845
|
lines.push(` Signature: ${item.doc.signature}`);
|
|
276055
275846
|
if (item.doc.parentName) lines.push(` Parent: ${item.doc.parentName}`);
|
|
@@ -278000,10 +277791,220 @@ async function buildCodeGraph(opts) {
|
|
|
278000
277791
|
import * as path3 from "path";
|
|
278001
277792
|
import * as path22 from "path";
|
|
278002
277793
|
|
|
278003
|
-
// ../../node_modules/.pnpm/
|
|
278004
|
-
var
|
|
277794
|
+
// ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
277795
|
+
var balanced = (a, b, str) => {
|
|
277796
|
+
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
277797
|
+
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
277798
|
+
const r = ma !== null && mb != null && range(ma, mb, str);
|
|
277799
|
+
return r && {
|
|
277800
|
+
start: r[0],
|
|
277801
|
+
end: r[1],
|
|
277802
|
+
pre: str.slice(0, r[0]),
|
|
277803
|
+
body: str.slice(r[0] + ma.length, r[1]),
|
|
277804
|
+
post: str.slice(r[1] + mb.length)
|
|
277805
|
+
};
|
|
277806
|
+
};
|
|
277807
|
+
var maybeMatch = (reg, str) => {
|
|
277808
|
+
const m = str.match(reg);
|
|
277809
|
+
return m ? m[0] : null;
|
|
277810
|
+
};
|
|
277811
|
+
var range = (a, b, str) => {
|
|
277812
|
+
let begs, beg, left, right = void 0, result;
|
|
277813
|
+
let ai = str.indexOf(a);
|
|
277814
|
+
let bi = str.indexOf(b, ai + 1);
|
|
277815
|
+
let i2 = ai;
|
|
277816
|
+
if (ai >= 0 && bi > 0) {
|
|
277817
|
+
if (a === b) {
|
|
277818
|
+
return [ai, bi];
|
|
277819
|
+
}
|
|
277820
|
+
begs = [];
|
|
277821
|
+
left = str.length;
|
|
277822
|
+
while (i2 >= 0 && !result) {
|
|
277823
|
+
if (i2 === ai) {
|
|
277824
|
+
begs.push(i2);
|
|
277825
|
+
ai = str.indexOf(a, i2 + 1);
|
|
277826
|
+
} else if (begs.length === 1) {
|
|
277827
|
+
const r = begs.pop();
|
|
277828
|
+
if (r !== void 0)
|
|
277829
|
+
result = [r, bi];
|
|
277830
|
+
} else {
|
|
277831
|
+
beg = begs.pop();
|
|
277832
|
+
if (beg !== void 0 && beg < left) {
|
|
277833
|
+
left = beg;
|
|
277834
|
+
right = bi;
|
|
277835
|
+
}
|
|
277836
|
+
bi = str.indexOf(b, i2 + 1);
|
|
277837
|
+
}
|
|
277838
|
+
i2 = ai < bi && ai >= 0 ? ai : bi;
|
|
277839
|
+
}
|
|
277840
|
+
if (begs.length && right !== void 0) {
|
|
277841
|
+
result = [left, right];
|
|
277842
|
+
}
|
|
277843
|
+
}
|
|
277844
|
+
return result;
|
|
277845
|
+
};
|
|
277846
|
+
|
|
277847
|
+
// ../../node_modules/.pnpm/brace-expansion@5.0.4/node_modules/brace-expansion/dist/esm/index.js
|
|
277848
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
277849
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
277850
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
277851
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
277852
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
277853
|
+
var escSlashPattern = new RegExp(escSlash, "g");
|
|
277854
|
+
var escOpenPattern = new RegExp(escOpen, "g");
|
|
277855
|
+
var escClosePattern = new RegExp(escClose, "g");
|
|
277856
|
+
var escCommaPattern = new RegExp(escComma, "g");
|
|
277857
|
+
var escPeriodPattern = new RegExp(escPeriod, "g");
|
|
277858
|
+
var slashPattern = /\\\\/g;
|
|
277859
|
+
var openPattern = /\\{/g;
|
|
277860
|
+
var closePattern = /\\}/g;
|
|
277861
|
+
var commaPattern = /\\,/g;
|
|
277862
|
+
var periodPattern = /\\\./g;
|
|
277863
|
+
var EXPANSION_MAX = 1e5;
|
|
277864
|
+
function numeric(str) {
|
|
277865
|
+
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
277866
|
+
}
|
|
277867
|
+
function escapeBraces(str) {
|
|
277868
|
+
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
|
|
277869
|
+
}
|
|
277870
|
+
function unescapeBraces(str) {
|
|
277871
|
+
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
|
|
277872
|
+
}
|
|
277873
|
+
function parseCommaParts(str) {
|
|
277874
|
+
if (!str) {
|
|
277875
|
+
return [""];
|
|
277876
|
+
}
|
|
277877
|
+
const parts2 = [];
|
|
277878
|
+
const m = balanced("{", "}", str);
|
|
277879
|
+
if (!m) {
|
|
277880
|
+
return str.split(",");
|
|
277881
|
+
}
|
|
277882
|
+
const { pre, body: body2, post: post2 } = m;
|
|
277883
|
+
const p = pre.split(",");
|
|
277884
|
+
p[p.length - 1] += "{" + body2 + "}";
|
|
277885
|
+
const postParts = parseCommaParts(post2);
|
|
277886
|
+
if (post2.length) {
|
|
277887
|
+
;
|
|
277888
|
+
p[p.length - 1] += postParts.shift();
|
|
277889
|
+
p.push.apply(p, postParts);
|
|
277890
|
+
}
|
|
277891
|
+
parts2.push.apply(parts2, p);
|
|
277892
|
+
return parts2;
|
|
277893
|
+
}
|
|
277894
|
+
function expand(str, options = {}) {
|
|
277895
|
+
if (!str) {
|
|
277896
|
+
return [];
|
|
277897
|
+
}
|
|
277898
|
+
const { max: max2 = EXPANSION_MAX } = options;
|
|
277899
|
+
if (str.slice(0, 2) === "{}") {
|
|
277900
|
+
str = "\\{\\}" + str.slice(2);
|
|
277901
|
+
}
|
|
277902
|
+
return expand_(escapeBraces(str), max2, true).map(unescapeBraces);
|
|
277903
|
+
}
|
|
277904
|
+
function embrace(str) {
|
|
277905
|
+
return "{" + str + "}";
|
|
277906
|
+
}
|
|
277907
|
+
function isPadded(el) {
|
|
277908
|
+
return /^-?0\d/.test(el);
|
|
277909
|
+
}
|
|
277910
|
+
function lte(i2, y) {
|
|
277911
|
+
return i2 <= y;
|
|
277912
|
+
}
|
|
277913
|
+
function gte(i2, y) {
|
|
277914
|
+
return i2 >= y;
|
|
277915
|
+
}
|
|
277916
|
+
function expand_(str, max2, isTop) {
|
|
277917
|
+
const expansions = [];
|
|
277918
|
+
const m = balanced("{", "}", str);
|
|
277919
|
+
if (!m)
|
|
277920
|
+
return [str];
|
|
277921
|
+
const pre = m.pre;
|
|
277922
|
+
const post2 = m.post.length ? expand_(m.post, max2, false) : [""];
|
|
277923
|
+
if (/\$$/.test(m.pre)) {
|
|
277924
|
+
for (let k = 0; k < post2.length && k < max2; k++) {
|
|
277925
|
+
const expansion = pre + "{" + m.body + "}" + post2[k];
|
|
277926
|
+
expansions.push(expansion);
|
|
277927
|
+
}
|
|
277928
|
+
} else {
|
|
277929
|
+
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
277930
|
+
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
277931
|
+
const isSequence = isNumericSequence || isAlphaSequence;
|
|
277932
|
+
const isOptions = m.body.indexOf(",") >= 0;
|
|
277933
|
+
if (!isSequence && !isOptions) {
|
|
277934
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
277935
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
277936
|
+
return expand_(str, max2, true);
|
|
277937
|
+
}
|
|
277938
|
+
return [str];
|
|
277939
|
+
}
|
|
277940
|
+
let n;
|
|
277941
|
+
if (isSequence) {
|
|
277942
|
+
n = m.body.split(/\.\./);
|
|
277943
|
+
} else {
|
|
277944
|
+
n = parseCommaParts(m.body);
|
|
277945
|
+
if (n.length === 1 && n[0] !== void 0) {
|
|
277946
|
+
n = expand_(n[0], max2, false).map(embrace);
|
|
277947
|
+
if (n.length === 1) {
|
|
277948
|
+
return post2.map((p) => m.pre + n[0] + p);
|
|
277949
|
+
}
|
|
277950
|
+
}
|
|
277951
|
+
}
|
|
277952
|
+
let N;
|
|
277953
|
+
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
|
|
277954
|
+
const x = numeric(n[0]);
|
|
277955
|
+
const y = numeric(n[1]);
|
|
277956
|
+
const width = Math.max(n[0].length, n[1].length);
|
|
277957
|
+
let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
|
|
277958
|
+
let test = lte;
|
|
277959
|
+
const reverse = y < x;
|
|
277960
|
+
if (reverse) {
|
|
277961
|
+
incr *= -1;
|
|
277962
|
+
test = gte;
|
|
277963
|
+
}
|
|
277964
|
+
const pad = n.some(isPadded);
|
|
277965
|
+
N = [];
|
|
277966
|
+
for (let i2 = x; test(i2, y); i2 += incr) {
|
|
277967
|
+
let c;
|
|
277968
|
+
if (isAlphaSequence) {
|
|
277969
|
+
c = String.fromCharCode(i2);
|
|
277970
|
+
if (c === "\\") {
|
|
277971
|
+
c = "";
|
|
277972
|
+
}
|
|
277973
|
+
} else {
|
|
277974
|
+
c = String(i2);
|
|
277975
|
+
if (pad) {
|
|
277976
|
+
const need = width - c.length;
|
|
277977
|
+
if (need > 0) {
|
|
277978
|
+
const z = new Array(need + 1).join("0");
|
|
277979
|
+
if (i2 < 0) {
|
|
277980
|
+
c = "-" + z + c.slice(1);
|
|
277981
|
+
} else {
|
|
277982
|
+
c = z + c;
|
|
277983
|
+
}
|
|
277984
|
+
}
|
|
277985
|
+
}
|
|
277986
|
+
}
|
|
277987
|
+
N.push(c);
|
|
277988
|
+
}
|
|
277989
|
+
} else {
|
|
277990
|
+
N = [];
|
|
277991
|
+
for (let j = 0; j < n.length; j++) {
|
|
277992
|
+
N.push.apply(N, expand_(n[j], max2, false));
|
|
277993
|
+
}
|
|
277994
|
+
}
|
|
277995
|
+
for (let j = 0; j < N.length; j++) {
|
|
277996
|
+
for (let k = 0; k < post2.length && expansions.length < max2; k++) {
|
|
277997
|
+
const expansion = pre + N[j] + post2[k];
|
|
277998
|
+
if (!isTop || isSequence || expansion) {
|
|
277999
|
+
expansions.push(expansion);
|
|
278000
|
+
}
|
|
278001
|
+
}
|
|
278002
|
+
}
|
|
278003
|
+
}
|
|
278004
|
+
return expansions;
|
|
278005
|
+
}
|
|
278005
278006
|
|
|
278006
|
-
// ../../node_modules/.pnpm/minimatch@
|
|
278007
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
278007
278008
|
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
278008
278009
|
var assertValidPattern = (pattern) => {
|
|
278009
278010
|
if (typeof pattern !== "string") {
|
|
@@ -278014,7 +278015,7 @@ var assertValidPattern = (pattern) => {
|
|
|
278014
278015
|
}
|
|
278015
278016
|
};
|
|
278016
278017
|
|
|
278017
|
-
// ../../node_modules/.pnpm/minimatch@
|
|
278018
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/brace-expressions.js
|
|
278018
278019
|
var posixClasses = {
|
|
278019
278020
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
278020
278021
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
@@ -278123,12 +278124,15 @@ var parseClass = (glob, position) => {
|
|
|
278123
278124
|
return [comb, uflag, endPos - pos, true];
|
|
278124
278125
|
};
|
|
278125
278126
|
|
|
278126
|
-
// ../../node_modules/.pnpm/minimatch@
|
|
278127
|
-
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
278128
|
-
|
|
278127
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/unescape.js
|
|
278128
|
+
var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
|
|
278129
|
+
if (magicalBraces) {
|
|
278130
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
278131
|
+
}
|
|
278132
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
278129
278133
|
};
|
|
278130
278134
|
|
|
278131
|
-
// ../../node_modules/.pnpm/minimatch@
|
|
278135
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/ast.js
|
|
278132
278136
|
var _a;
|
|
278133
278137
|
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
278134
278138
|
var isExtglobType = (c) => types.has(c);
|
|
@@ -278154,9 +278158,30 @@ var adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
|
278154
278158
|
]);
|
|
278155
278159
|
var usurpMap = /* @__PURE__ */ new Map([
|
|
278156
278160
|
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
278157
|
-
[
|
|
278158
|
-
|
|
278159
|
-
|
|
278161
|
+
[
|
|
278162
|
+
"?",
|
|
278163
|
+
/* @__PURE__ */ new Map([
|
|
278164
|
+
["*", "*"],
|
|
278165
|
+
["+", "*"]
|
|
278166
|
+
])
|
|
278167
|
+
],
|
|
278168
|
+
[
|
|
278169
|
+
"@",
|
|
278170
|
+
/* @__PURE__ */ new Map([
|
|
278171
|
+
["!", "!"],
|
|
278172
|
+
["?", "?"],
|
|
278173
|
+
["@", "@"],
|
|
278174
|
+
["*", "*"],
|
|
278175
|
+
["+", "+"]
|
|
278176
|
+
])
|
|
278177
|
+
],
|
|
278178
|
+
[
|
|
278179
|
+
"+",
|
|
278180
|
+
/* @__PURE__ */ new Map([
|
|
278181
|
+
["?", "*"],
|
|
278182
|
+
["*", "*"]
|
|
278183
|
+
])
|
|
278184
|
+
]
|
|
278160
278185
|
]);
|
|
278161
278186
|
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
278162
278187
|
var startNoDot = "(?!\\.)";
|
|
@@ -278167,6 +278192,7 @@ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
|
278167
278192
|
var qmark = "[^/]";
|
|
278168
278193
|
var star = qmark + "*?";
|
|
278169
278194
|
var starNoEmpty = qmark + "+?";
|
|
278195
|
+
var ID = 0;
|
|
278170
278196
|
var AST = class {
|
|
278171
278197
|
type;
|
|
278172
278198
|
#root;
|
|
@@ -278182,6 +278208,22 @@ var AST = class {
|
|
|
278182
278208
|
// set to true if it's an extglob with no children
|
|
278183
278209
|
// (which really means one child of '')
|
|
278184
278210
|
#emptyExt = false;
|
|
278211
|
+
id = ++ID;
|
|
278212
|
+
get depth() {
|
|
278213
|
+
return (this.#parent?.depth ?? -1) + 1;
|
|
278214
|
+
}
|
|
278215
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
278216
|
+
return {
|
|
278217
|
+
"@@type": "AST",
|
|
278218
|
+
id: this.id,
|
|
278219
|
+
type: this.type,
|
|
278220
|
+
root: this.#root.id,
|
|
278221
|
+
parent: this.#parent?.id,
|
|
278222
|
+
depth: this.depth,
|
|
278223
|
+
partsLength: this.#parts.length,
|
|
278224
|
+
parts: this.#parts
|
|
278225
|
+
};
|
|
278226
|
+
}
|
|
278185
278227
|
constructor(type, parent, options = {}) {
|
|
278186
278228
|
this.type = type;
|
|
278187
278229
|
if (type)
|
|
@@ -278378,7 +278420,7 @@ var AST = class {
|
|
|
278378
278420
|
acc += c;
|
|
278379
278421
|
continue;
|
|
278380
278422
|
}
|
|
278381
|
-
const doRecurse = isExtglobType(c) && str.charAt(i2) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
278423
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
278382
278424
|
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
|
278383
278425
|
if (doRecurse) {
|
|
278384
278426
|
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
@@ -278466,44 +278508,14 @@ var AST = class {
|
|
|
278466
278508
|
return false;
|
|
278467
278509
|
this.#parts = gc.#parts;
|
|
278468
278510
|
for (const p of this.#parts) {
|
|
278469
|
-
if (typeof p === "object")
|
|
278511
|
+
if (typeof p === "object") {
|
|
278470
278512
|
p.#parent = this;
|
|
278513
|
+
}
|
|
278471
278514
|
}
|
|
278472
278515
|
this.type = nt;
|
|
278473
278516
|
this.#toString = void 0;
|
|
278474
278517
|
this.#emptyExt = false;
|
|
278475
278518
|
}
|
|
278476
|
-
#flatten() {
|
|
278477
|
-
if (!isExtglobAST(this)) {
|
|
278478
|
-
for (const p of this.#parts) {
|
|
278479
|
-
if (typeof p === "object")
|
|
278480
|
-
p.#flatten();
|
|
278481
|
-
}
|
|
278482
|
-
} else {
|
|
278483
|
-
let iterations = 0;
|
|
278484
|
-
let done = false;
|
|
278485
|
-
do {
|
|
278486
|
-
done = true;
|
|
278487
|
-
for (let i2 = 0; i2 < this.#parts.length; i2++) {
|
|
278488
|
-
const c = this.#parts[i2];
|
|
278489
|
-
if (typeof c === "object") {
|
|
278490
|
-
c.#flatten();
|
|
278491
|
-
if (this.#canAdopt(c)) {
|
|
278492
|
-
done = false;
|
|
278493
|
-
this.#adopt(c, i2);
|
|
278494
|
-
} else if (this.#canAdoptWithSpace(c)) {
|
|
278495
|
-
done = false;
|
|
278496
|
-
this.#adoptWithSpace(c, i2);
|
|
278497
|
-
} else if (this.#canUsurp(c)) {
|
|
278498
|
-
done = false;
|
|
278499
|
-
this.#usurp(c);
|
|
278500
|
-
}
|
|
278501
|
-
}
|
|
278502
|
-
}
|
|
278503
|
-
} while (!done && ++iterations < 10);
|
|
278504
|
-
}
|
|
278505
|
-
this.#toString = void 0;
|
|
278506
|
-
}
|
|
278507
278519
|
static fromGlob(pattern, options = {}) {
|
|
278508
278520
|
const ast = new _a(null, void 0, options);
|
|
278509
278521
|
_a.#parseAST(pattern, ast, 0, options, 0);
|
|
@@ -278605,7 +278617,7 @@ var AST = class {
|
|
|
278605
278617
|
this.#fillNegs();
|
|
278606
278618
|
}
|
|
278607
278619
|
if (!isExtglobAST(this)) {
|
|
278608
|
-
const noEmpty = this.isStart() && this.isEnd();
|
|
278620
|
+
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
|
278609
278621
|
const src = this.#parts.map((p) => {
|
|
278610
278622
|
const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
278611
278623
|
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
@@ -278676,6 +278688,38 @@ var AST = class {
|
|
|
278676
278688
|
this.#uflag
|
|
278677
278689
|
];
|
|
278678
278690
|
}
|
|
278691
|
+
#flatten() {
|
|
278692
|
+
if (!isExtglobAST(this)) {
|
|
278693
|
+
for (const p of this.#parts) {
|
|
278694
|
+
if (typeof p === "object") {
|
|
278695
|
+
p.#flatten();
|
|
278696
|
+
}
|
|
278697
|
+
}
|
|
278698
|
+
} else {
|
|
278699
|
+
let iterations = 0;
|
|
278700
|
+
let done = false;
|
|
278701
|
+
do {
|
|
278702
|
+
done = true;
|
|
278703
|
+
for (let i2 = 0; i2 < this.#parts.length; i2++) {
|
|
278704
|
+
const c = this.#parts[i2];
|
|
278705
|
+
if (typeof c === "object") {
|
|
278706
|
+
c.#flatten();
|
|
278707
|
+
if (this.#canAdopt(c)) {
|
|
278708
|
+
done = false;
|
|
278709
|
+
this.#adopt(c, i2);
|
|
278710
|
+
} else if (this.#canAdoptWithSpace(c)) {
|
|
278711
|
+
done = false;
|
|
278712
|
+
this.#adoptWithSpace(c, i2);
|
|
278713
|
+
} else if (this.#canUsurp(c)) {
|
|
278714
|
+
done = false;
|
|
278715
|
+
this.#usurp(c);
|
|
278716
|
+
}
|
|
278717
|
+
}
|
|
278718
|
+
}
|
|
278719
|
+
} while (!done && ++iterations < 10);
|
|
278720
|
+
}
|
|
278721
|
+
this.#toString = void 0;
|
|
278722
|
+
}
|
|
278679
278723
|
#partsToRegExp(dot) {
|
|
278680
278724
|
return this.#parts.map((p) => {
|
|
278681
278725
|
if (typeof p === "string") {
|
|
@@ -278696,9 +278740,18 @@ var AST = class {
|
|
|
278696
278740
|
if (escaping) {
|
|
278697
278741
|
escaping = false;
|
|
278698
278742
|
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
278699
|
-
inStar = false;
|
|
278700
278743
|
continue;
|
|
278701
278744
|
}
|
|
278745
|
+
if (c === "*") {
|
|
278746
|
+
if (inStar)
|
|
278747
|
+
continue;
|
|
278748
|
+
inStar = true;
|
|
278749
|
+
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
|
278750
|
+
hasMagic = true;
|
|
278751
|
+
continue;
|
|
278752
|
+
} else {
|
|
278753
|
+
inStar = false;
|
|
278754
|
+
}
|
|
278702
278755
|
if (c === "\\") {
|
|
278703
278756
|
if (i2 === glob.length - 1) {
|
|
278704
278757
|
re += "\\\\";
|
|
@@ -278714,20 +278767,9 @@ var AST = class {
|
|
|
278714
278767
|
uflag = uflag || needUflag;
|
|
278715
278768
|
i2 += consumed2 - 1;
|
|
278716
278769
|
hasMagic = hasMagic || magic;
|
|
278717
|
-
inStar = false;
|
|
278718
278770
|
continue;
|
|
278719
278771
|
}
|
|
278720
278772
|
}
|
|
278721
|
-
if (c === "*") {
|
|
278722
|
-
if (inStar)
|
|
278723
|
-
continue;
|
|
278724
|
-
inStar = true;
|
|
278725
|
-
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
|
278726
|
-
hasMagic = true;
|
|
278727
|
-
continue;
|
|
278728
|
-
} else {
|
|
278729
|
-
inStar = false;
|
|
278730
|
-
}
|
|
278731
278773
|
if (c === "?") {
|
|
278732
278774
|
re += qmark;
|
|
278733
278775
|
hasMagic = true;
|
|
@@ -278740,12 +278782,15 @@ var AST = class {
|
|
|
278740
278782
|
};
|
|
278741
278783
|
_a = AST;
|
|
278742
278784
|
|
|
278743
|
-
// ../../node_modules/.pnpm/minimatch@
|
|
278744
|
-
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
278785
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/escape.js
|
|
278786
|
+
var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
|
|
278787
|
+
if (magicalBraces) {
|
|
278788
|
+
return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
278789
|
+
}
|
|
278745
278790
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
278746
278791
|
};
|
|
278747
278792
|
|
|
278748
|
-
// ../../node_modules/.pnpm/minimatch@
|
|
278793
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/index.js
|
|
278749
278794
|
var minimatch = (p, pattern, options = {}) => {
|
|
278750
278795
|
assertValidPattern(pattern);
|
|
278751
278796
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
@@ -278861,7 +278906,7 @@ var braceExpand = (pattern, options = {}) => {
|
|
|
278861
278906
|
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
278862
278907
|
return [pattern];
|
|
278863
278908
|
}
|
|
278864
|
-
return (
|
|
278909
|
+
return expand(pattern, { max: options.braceExpandMax });
|
|
278865
278910
|
};
|
|
278866
278911
|
minimatch.braceExpand = braceExpand;
|
|
278867
278912
|
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
@@ -278904,7 +278949,8 @@ var Minimatch = class {
|
|
|
278904
278949
|
this.pattern = pattern;
|
|
278905
278950
|
this.platform = options.platform || defaultPlatform;
|
|
278906
278951
|
this.isWindows = this.platform === "win32";
|
|
278907
|
-
|
|
278952
|
+
const awe = "allowWindowsEscape";
|
|
278953
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false;
|
|
278908
278954
|
if (this.windowsPathsNoEscape) {
|
|
278909
278955
|
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
278910
278956
|
}
|
|
@@ -278961,7 +279007,10 @@ var Minimatch = class {
|
|
|
278961
279007
|
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
278962
279008
|
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
278963
279009
|
if (isUNC) {
|
|
278964
|
-
return [
|
|
279010
|
+
return [
|
|
279011
|
+
...s.slice(0, 4),
|
|
279012
|
+
...s.slice(4).map((ss) => this.parse(ss))
|
|
279013
|
+
];
|
|
278965
279014
|
} else if (isDrive) {
|
|
278966
279015
|
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
278967
279016
|
}
|
|
@@ -279277,9 +279326,11 @@ var Minimatch = class {
|
|
|
279277
279326
|
];
|
|
279278
279327
|
if (head.length) {
|
|
279279
279328
|
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
279280
|
-
if (!this.#matchOne(fileHead, head, partial, 0, 0))
|
|
279329
|
+
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
|
279281
279330
|
return false;
|
|
279331
|
+
}
|
|
279282
279332
|
fileIndex += head.length;
|
|
279333
|
+
patternIndex += head.length;
|
|
279283
279334
|
}
|
|
279284
279335
|
let fileTailMatch = 0;
|
|
279285
279336
|
if (tail.length) {
|
|
@@ -279293,8 +279344,9 @@ var Minimatch = class {
|
|
|
279293
279344
|
return false;
|
|
279294
279345
|
}
|
|
279295
279346
|
tailStart--;
|
|
279296
|
-
if (!this.#matchOne(file, tail, partial, tailStart, 0))
|
|
279347
|
+
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
|
279297
279348
|
return false;
|
|
279349
|
+
}
|
|
279298
279350
|
fileTailMatch = tail.length + 1;
|
|
279299
279351
|
}
|
|
279300
279352
|
}
|
|
@@ -279330,6 +279382,8 @@ var Minimatch = class {
|
|
|
279330
279382
|
}
|
|
279331
279383
|
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
279332
279384
|
}
|
|
279385
|
+
// return false for "nope, not matching"
|
|
279386
|
+
// return null for "not matching, cannot keep trying"
|
|
279333
279387
|
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
279334
279388
|
const bs = bodySegments[bodyIndex];
|
|
279335
279389
|
if (!bs) {
|
|
@@ -279347,8 +279401,9 @@ var Minimatch = class {
|
|
|
279347
279401
|
const m = this.#matchOne(file.slice(0, fileIndex + body2.length), body2, partial, fileIndex, 0);
|
|
279348
279402
|
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
279349
279403
|
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body2.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
279350
|
-
if (sub !== false)
|
|
279404
|
+
if (sub !== false) {
|
|
279351
279405
|
return sub;
|
|
279406
|
+
}
|
|
279352
279407
|
}
|
|
279353
279408
|
const f = file[fileIndex];
|
|
279354
279409
|
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
@@ -279368,8 +279423,9 @@ var Minimatch = class {
|
|
|
279368
279423
|
let p = pattern[pi];
|
|
279369
279424
|
let f = file[fi];
|
|
279370
279425
|
this.debug(pattern, p, f);
|
|
279371
|
-
if (p === false || p === GLOBSTAR)
|
|
279426
|
+
if (p === false || p === GLOBSTAR) {
|
|
279372
279427
|
return false;
|
|
279428
|
+
}
|
|
279373
279429
|
let hit;
|
|
279374
279430
|
if (typeof p === "string") {
|
|
279375
279431
|
hit = f === p;
|
|
@@ -279452,16 +279508,27 @@ var Minimatch = class {
|
|
|
279452
279508
|
pp[i2] = twoStar;
|
|
279453
279509
|
}
|
|
279454
279510
|
} else if (next === void 0) {
|
|
279455
|
-
pp[i2 - 1] = prev + "(
|
|
279511
|
+
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
|
|
279456
279512
|
} else if (next !== GLOBSTAR) {
|
|
279457
279513
|
pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
279458
279514
|
pp[i2 + 1] = GLOBSTAR;
|
|
279459
279515
|
}
|
|
279460
279516
|
});
|
|
279461
|
-
|
|
279517
|
+
const filtered = pp.filter((p) => p !== GLOBSTAR);
|
|
279518
|
+
if (this.partial && filtered.length >= 1) {
|
|
279519
|
+
const prefixes = [];
|
|
279520
|
+
for (let i2 = 1; i2 <= filtered.length; i2++) {
|
|
279521
|
+
prefixes.push(filtered.slice(0, i2).join("/"));
|
|
279522
|
+
}
|
|
279523
|
+
return "(?:" + prefixes.join("|") + ")";
|
|
279524
|
+
}
|
|
279525
|
+
return filtered.join("/");
|
|
279462
279526
|
}).join("|");
|
|
279463
279527
|
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
279464
279528
|
re = "^" + open + re + close + "$";
|
|
279529
|
+
if (this.partial) {
|
|
279530
|
+
re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
|
|
279531
|
+
}
|
|
279465
279532
|
if (this.negate)
|
|
279466
279533
|
re = "^(?!" + re + ").+$";
|
|
279467
279534
|
try {
|
|
@@ -282996,7 +283063,7 @@ var ContextEngine = class {
|
|
|
282996
283063
|
// src/server.ts
|
|
282997
283064
|
init_dist();
|
|
282998
283065
|
|
|
282999
|
-
// ../subscriptions/dist/chunk-
|
|
283066
|
+
// ../subscriptions/dist/chunk-WJ5IOQVB.js
|
|
283000
283067
|
var PLAN_IDS = ["free", "pro", "team", "enterprise"];
|
|
283001
283068
|
var PLAN_RANK = Object.fromEntries(
|
|
283002
283069
|
PLAN_IDS.map((id, index2) => [id, index2])
|
|
@@ -283087,8 +283154,8 @@ var PLAN_DEFINITIONS = {
|
|
|
283087
283154
|
pro: {
|
|
283088
283155
|
displayName: "Pro",
|
|
283089
283156
|
tagline: "Full verification for you and your team \u2014 fix, prove, and gate AI-generated code.",
|
|
283090
|
-
monthlyPriceUsd:
|
|
283091
|
-
priceLabel: "$
|
|
283157
|
+
monthlyPriceUsd: 19,
|
|
283158
|
+
priceLabel: "$19/mo",
|
|
283092
283159
|
billingInterval: "month",
|
|
283093
283160
|
badgeToken: "tier-pro",
|
|
283094
283161
|
highlights: [
|
|
@@ -283107,8 +283174,8 @@ var PLAN_DEFINITIONS = {
|
|
|
283107
283174
|
team: {
|
|
283108
283175
|
displayName: "Team",
|
|
283109
283176
|
tagline: "Verification-first building at scale.",
|
|
283110
|
-
monthlyPriceUsd:
|
|
283111
|
-
priceLabel: "$
|
|
283177
|
+
monthlyPriceUsd: 19,
|
|
283178
|
+
priceLabel: "$19/mo",
|
|
283112
283179
|
billingInterval: "month",
|
|
283113
283180
|
badgeToken: "tier-team",
|
|
283114
283181
|
highlights: [
|
|
@@ -283131,8 +283198,8 @@ var PLAN_DEFINITIONS = {
|
|
|
283131
283198
|
enterprise: {
|
|
283132
283199
|
displayName: "Enterprise",
|
|
283133
283200
|
tagline: "Teams, compliance, and scale.",
|
|
283134
|
-
monthlyPriceUsd:
|
|
283135
|
-
priceLabel: "$
|
|
283201
|
+
monthlyPriceUsd: 19,
|
|
283202
|
+
priceLabel: "$19/mo",
|
|
283136
283203
|
billingInterval: "month",
|
|
283137
283204
|
badgeToken: "tier-enterprise",
|
|
283138
283205
|
highlights: [
|
|
@@ -283273,6 +283340,8 @@ var PLAN_QUOTAS = {
|
|
|
283273
283340
|
islSpecsPerMonth: 0,
|
|
283274
283341
|
atlasViewsPerMonth: Infinity,
|
|
283275
283342
|
// wikicode/atlas is free per product spec
|
|
283343
|
+
guidedRoutesPerDay: 5,
|
|
283344
|
+
guidedFollowUpsPerRoute: 5,
|
|
283276
283345
|
proofHistoryEntries: 0
|
|
283277
283346
|
},
|
|
283278
283347
|
pro: {
|
|
@@ -283300,6 +283369,8 @@ var PLAN_QUOTAS = {
|
|
|
283300
283369
|
contextEngineRulesPerMonth: Infinity,
|
|
283301
283370
|
islSpecsPerMonth: Infinity,
|
|
283302
283371
|
atlasViewsPerMonth: Infinity,
|
|
283372
|
+
guidedRoutesPerDay: Infinity,
|
|
283373
|
+
guidedFollowUpsPerRoute: Infinity,
|
|
283303
283374
|
proofHistoryEntries: Infinity
|
|
283304
283375
|
},
|
|
283305
283376
|
team: {
|
|
@@ -283326,6 +283397,8 @@ var PLAN_QUOTAS = {
|
|
|
283326
283397
|
contextEngineRulesPerMonth: Infinity,
|
|
283327
283398
|
islSpecsPerMonth: Infinity,
|
|
283328
283399
|
atlasViewsPerMonth: Infinity,
|
|
283400
|
+
guidedRoutesPerDay: Infinity,
|
|
283401
|
+
guidedFollowUpsPerRoute: Infinity,
|
|
283329
283402
|
proofHistoryEntries: Infinity
|
|
283330
283403
|
},
|
|
283331
283404
|
enterprise: {
|
|
@@ -283352,6 +283425,8 @@ var PLAN_QUOTAS = {
|
|
|
283352
283425
|
contextEngineRulesPerMonth: Infinity,
|
|
283353
283426
|
islSpecsPerMonth: Infinity,
|
|
283354
283427
|
atlasViewsPerMonth: Infinity,
|
|
283428
|
+
guidedRoutesPerDay: Infinity,
|
|
283429
|
+
guidedFollowUpsPerRoute: Infinity,
|
|
283355
283430
|
proofHistoryEntries: Infinity
|
|
283356
283431
|
}
|
|
283357
283432
|
};
|
|
@@ -283757,12 +283832,18 @@ var FEATURE_REGISTRY = {
|
|
|
283757
283832
|
requiredPlan: "free",
|
|
283758
283833
|
category: "analysis"
|
|
283759
283834
|
},
|
|
283760
|
-
/** CLI `vibecheck roast` — stylized scan output (free
|
|
283835
|
+
/** CLI `vibecheck roast` — stylized scan output (free for everyone; no login on CLI). */
|
|
283761
283836
|
Roast: {
|
|
283762
283837
|
entitlement: ENTITLEMENTS.SCAN_BASIC,
|
|
283763
283838
|
title: "Roast",
|
|
283764
283839
|
subtitle: "Scan findings with editorial voice",
|
|
283765
|
-
benefits: [
|
|
283840
|
+
benefits: [
|
|
283841
|
+
"Same engines as scan",
|
|
283842
|
+
"No VibeCheck login required (CLI)",
|
|
283843
|
+
"Does not consume daily scan quota",
|
|
283844
|
+
"Shareable output",
|
|
283845
|
+
"CLI, MCP, and IDE panel"
|
|
283846
|
+
],
|
|
283766
283847
|
requiredPlan: "free",
|
|
283767
283848
|
category: "analysis"
|
|
283768
283849
|
},
|
|
@@ -283850,6 +283931,20 @@ var FEATURE_REGISTRY = {
|
|
|
283850
283931
|
requiredPlan: "free",
|
|
283851
283932
|
category: "analysis"
|
|
283852
283933
|
},
|
|
283934
|
+
/**
|
|
283935
|
+
* LLM-powered guided routes (intent → stops). Free tier: taste limit from `PLAN_QUOTAS.free.guidedRoutesPerDay`;
|
|
283936
|
+
* Pro+ unlimited. Use getAccessMode + getLimitForFeature — not canAccessFeature alone.
|
|
283937
|
+
*/
|
|
283938
|
+
"Guided Route": {
|
|
283939
|
+
entitlement: ENTITLEMENTS.WIKICODE_VIEW,
|
|
283940
|
+
title: "Guided Route (LLM)",
|
|
283941
|
+
subtitle: "Intent-driven tour with AI-ordered stops",
|
|
283942
|
+
benefits: ["Hybrid search + call graph context", "Next/prev stops", "Follow-up Q&A on each stop"],
|
|
283943
|
+
requiredPlan: "pro",
|
|
283944
|
+
category: "analysis",
|
|
283945
|
+
freeTasteLimit: "guidedRoute",
|
|
283946
|
+
upgradeMessage: "You have used today\u2019s free guided routes. Upgrade to Pro for unlimited LLM routes and follow-ups."
|
|
283947
|
+
},
|
|
283853
283948
|
"Proof History": {
|
|
283854
283949
|
entitlement: ENTITLEMENTS.PROOF_VIEW,
|
|
283855
283950
|
title: "Proof History",
|
|
@@ -284095,7 +284190,8 @@ var VALID_FEATURE_LIMIT_KEYS = /* @__PURE__ */ new Set([
|
|
|
284095
284190
|
"islSpec",
|
|
284096
284191
|
"atlas",
|
|
284097
284192
|
"proofHistory",
|
|
284098
|
-
"autoFix"
|
|
284193
|
+
"autoFix",
|
|
284194
|
+
"guidedRoute"
|
|
284099
284195
|
]);
|
|
284100
284196
|
function validateFeatureRegistry() {
|
|
284101
284197
|
const errs = [];
|
|
@@ -284169,6 +284265,8 @@ var FEATURE_NAMES = {
|
|
|
284169
284265
|
REVIEW_WORKFLOWS: "Review Workflows",
|
|
284170
284266
|
FLOW_WORKFLOWS: "Flow Workflows",
|
|
284171
284267
|
WIKICODE_ATLAS: "WikiCode Atlas",
|
|
284268
|
+
/** LLM guided routes — use getAccessMode for free taste vs Pro unlimited */
|
|
284269
|
+
GUIDED_ROUTE: "Guided Route",
|
|
284172
284270
|
SHIP_SCORE: "Ship Score",
|
|
284173
284271
|
ISL_STUDIO: "ISL Studio",
|
|
284174
284272
|
// ── Pro features ────────────────────────────────────────────────────────
|
|
@@ -285147,7 +285245,7 @@ function createScanIdempotencyKey(prefix) {
|
|
|
285147
285245
|
// src/mcp-scan-meter-client.ts
|
|
285148
285246
|
var MCP_SCAN_METER_CLIENT = {
|
|
285149
285247
|
type: "mcp",
|
|
285150
|
-
version: "24.0.
|
|
285248
|
+
version: "24.0.2"
|
|
285151
285249
|
};
|
|
285152
285250
|
|
|
285153
285251
|
// src/server.ts
|
|
@@ -285438,7 +285536,7 @@ async function handleCallToolRequest(request, runtimeOverrides = {}) {
|
|
|
285438
285536
|
${validation.errors.join("\n")}`
|
|
285439
285537
|
);
|
|
285440
285538
|
}
|
|
285441
|
-
const BILLABLE_ENGINE_TOOLS = /* @__PURE__ */ new Set(["vibecheck_scan", "
|
|
285539
|
+
const BILLABLE_ENGINE_TOOLS = /* @__PURE__ */ new Set(["vibecheck_scan", "vibecheck_score"]);
|
|
285442
285540
|
if (BILLABLE_ENGINE_TOOLS.has(name2)) {
|
|
285443
285541
|
const token = process.env.VIBECHECK_TOKEN?.trim();
|
|
285444
285542
|
if (token && !shouldSkipServerScanMetering() && !isUnlimitedDailyScansPlan(userPlan)) {
|
|
@@ -285567,16 +285665,6 @@ ${validation.errors.join("\n")}`
|
|
|
285567
285665
|
MCP_TOOL_TIMEOUT_MS,
|
|
285568
285666
|
"vibecheck_roast"
|
|
285569
285667
|
);
|
|
285570
|
-
const roastRec = await recordMcpBillableUsage("mcp-roast");
|
|
285571
|
-
if (!roastRec.ok) {
|
|
285572
|
-
return buildErrorResponse(
|
|
285573
|
-
JSON.stringify({
|
|
285574
|
-
code: "SCAN_RECORD_FAILED",
|
|
285575
|
-
message: "Roast completed locally but scan usage could not be recorded.",
|
|
285576
|
-
detail: roastRec.message
|
|
285577
|
-
})
|
|
285578
|
-
);
|
|
285579
|
-
}
|
|
285580
285668
|
return {
|
|
285581
285669
|
content: [{ type: "text", text: output }]
|
|
285582
285670
|
};
|