@gapi/gcli 1.8.244 → 1.8.245
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/.agents/skills/local-ai-runners/SKILL.md +5 -0
- package/README-CLI.md +30 -0
- package/README.md +4 -1
- package/docs/changelog.d/2026-10-24-local-ai-runners-runner-daemon-start-stop-restart-and-start-reports-whether-t.md +25 -0
- package/docs/features/local-ai-runners.md +2 -0
- package/package.json +1 -1
- package/release/index.js +735 -649
package/release/index.js
CHANGED
|
@@ -4056,13 +4056,13 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
4056
4056
|
assertDictionary(original, context);
|
|
4057
4057
|
const abort = original === null || original === void 0 ? void 0 : original.abort;
|
|
4058
4058
|
const close = original === null || original === void 0 ? void 0 : original.close;
|
|
4059
|
-
const
|
|
4059
|
+
const start3 = original === null || original === void 0 ? void 0 : original.start;
|
|
4060
4060
|
const type = original === null || original === void 0 ? void 0 : original.type;
|
|
4061
4061
|
const write = original === null || original === void 0 ? void 0 : original.write;
|
|
4062
4062
|
return {
|
|
4063
4063
|
abort: abort === void 0 ? void 0 : convertUnderlyingSinkAbortCallback(abort, original, `${context} has member 'abort' that`),
|
|
4064
4064
|
close: close === void 0 ? void 0 : convertUnderlyingSinkCloseCallback(close, original, `${context} has member 'close' that`),
|
|
4065
|
-
start:
|
|
4065
|
+
start: start3 === void 0 ? void 0 : convertUnderlyingSinkStartCallback(start3, original, `${context} has member 'start' that`),
|
|
4066
4066
|
write: write === void 0 ? void 0 : convertUnderlyingSinkWriteCallback(write, original, `${context} has member 'write' that`),
|
|
4067
4067
|
type
|
|
4068
4068
|
};
|
|
@@ -5853,13 +5853,13 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
5853
5853
|
const autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;
|
|
5854
5854
|
const cancel = original === null || original === void 0 ? void 0 : original.cancel;
|
|
5855
5855
|
const pull = original === null || original === void 0 ? void 0 : original.pull;
|
|
5856
|
-
const
|
|
5856
|
+
const start3 = original === null || original === void 0 ? void 0 : original.start;
|
|
5857
5857
|
const type = original === null || original === void 0 ? void 0 : original.type;
|
|
5858
5858
|
return {
|
|
5859
5859
|
autoAllocateChunkSize: autoAllocateChunkSize === void 0 ? void 0 : convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, `${context} has member 'autoAllocateChunkSize' that`),
|
|
5860
5860
|
cancel: cancel === void 0 ? void 0 : convertUnderlyingSourceCancelCallback(cancel, original, `${context} has member 'cancel' that`),
|
|
5861
5861
|
pull: pull === void 0 ? void 0 : convertUnderlyingSourcePullCallback(pull, original, `${context} has member 'pull' that`),
|
|
5862
|
-
start:
|
|
5862
|
+
start: start3 === void 0 ? void 0 : convertUnderlyingSourceStartCallback(start3, original, `${context} has member 'start' that`),
|
|
5863
5863
|
type: type === void 0 ? void 0 : convertReadableStreamType(type, `${context} has member 'type' that`)
|
|
5864
5864
|
};
|
|
5865
5865
|
}
|
|
@@ -6286,14 +6286,14 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
6286
6286
|
const cancel = original === null || original === void 0 ? void 0 : original.cancel;
|
|
6287
6287
|
const flush = original === null || original === void 0 ? void 0 : original.flush;
|
|
6288
6288
|
const readableType = original === null || original === void 0 ? void 0 : original.readableType;
|
|
6289
|
-
const
|
|
6289
|
+
const start3 = original === null || original === void 0 ? void 0 : original.start;
|
|
6290
6290
|
const transform2 = original === null || original === void 0 ? void 0 : original.transform;
|
|
6291
6291
|
const writableType = original === null || original === void 0 ? void 0 : original.writableType;
|
|
6292
6292
|
return {
|
|
6293
6293
|
cancel: cancel === void 0 ? void 0 : convertTransformerCancelCallback(cancel, original, `${context} has member 'cancel' that`),
|
|
6294
6294
|
flush: flush === void 0 ? void 0 : convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`),
|
|
6295
6295
|
readableType,
|
|
6296
|
-
start:
|
|
6296
|
+
start: start3 === void 0 ? void 0 : convertTransformerStartCallback(start3, original, `${context} has member 'start' that`),
|
|
6297
6297
|
transform: transform2 === void 0 ? void 0 : convertTransformerTransformCallback(transform2, original, `${context} has member 'transform' that`),
|
|
6298
6298
|
writableType
|
|
6299
6299
|
};
|
|
@@ -6915,9 +6915,9 @@ var init_fetch_blob = __esm({
|
|
|
6915
6915
|
* @param {number} [end]
|
|
6916
6916
|
* @param {string} [type]
|
|
6917
6917
|
*/
|
|
6918
|
-
slice(
|
|
6918
|
+
slice(start3 = 0, end = this.size, type = "") {
|
|
6919
6919
|
const { size } = this;
|
|
6920
|
-
let relativeStart =
|
|
6920
|
+
let relativeStart = start3 < 0 ? Math.max(size + start3, 0) : Math.min(start3, size);
|
|
6921
6921
|
let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);
|
|
6922
6922
|
const span = Math.max(relativeEnd - relativeStart, 0);
|
|
6923
6923
|
const parts = this.#parts;
|
|
@@ -7373,9 +7373,9 @@ var init_multipart_parser = __esm({
|
|
|
7373
7373
|
const clear = (name2) => {
|
|
7374
7374
|
delete this[name2 + "Mark"];
|
|
7375
7375
|
};
|
|
7376
|
-
const callback = (callbackSymbol,
|
|
7377
|
-
if (
|
|
7378
|
-
this[callbackSymbol](ui8a && ui8a.subarray(
|
|
7376
|
+
const callback = (callbackSymbol, start3, end, ui8a) => {
|
|
7377
|
+
if (start3 === void 0 || start3 !== end) {
|
|
7378
|
+
this[callbackSymbol](ui8a && ui8a.subarray(start3, end));
|
|
7379
7379
|
}
|
|
7380
7380
|
};
|
|
7381
7381
|
const dataCallback = (name2, clear2) => {
|
|
@@ -9922,7 +9922,7 @@ var require_animationFrames = __commonJS({
|
|
|
9922
9922
|
function animationFramesFactory(timestampProvider) {
|
|
9923
9923
|
return new Observable_1.Observable(function(subscriber) {
|
|
9924
9924
|
var provider = timestampProvider || performanceTimestampProvider_1.performanceTimestampProvider;
|
|
9925
|
-
var
|
|
9925
|
+
var start3 = provider.now();
|
|
9926
9926
|
var id = 0;
|
|
9927
9927
|
var run2 = function() {
|
|
9928
9928
|
if (!subscriber.closed) {
|
|
@@ -9931,7 +9931,7 @@ var require_animationFrames = __commonJS({
|
|
|
9931
9931
|
var now = provider.now();
|
|
9932
9932
|
subscriber.next({
|
|
9933
9933
|
timestamp: timestampProvider ? now : timestamp,
|
|
9934
|
-
elapsed: now -
|
|
9934
|
+
elapsed: now - start3
|
|
9935
9935
|
});
|
|
9936
9936
|
run2();
|
|
9937
9937
|
});
|
|
@@ -13722,17 +13722,17 @@ var require_range = __commonJS({
|
|
|
13722
13722
|
exports2.range = void 0;
|
|
13723
13723
|
var Observable_1 = require_Observable();
|
|
13724
13724
|
var empty_1 = require_empty();
|
|
13725
|
-
function range(
|
|
13725
|
+
function range(start3, count, scheduler) {
|
|
13726
13726
|
if (count == null) {
|
|
13727
|
-
count =
|
|
13728
|
-
|
|
13727
|
+
count = start3;
|
|
13728
|
+
start3 = 0;
|
|
13729
13729
|
}
|
|
13730
13730
|
if (count <= 0) {
|
|
13731
13731
|
return empty_1.EMPTY;
|
|
13732
13732
|
}
|
|
13733
|
-
var end = count +
|
|
13733
|
+
var end = count + start3;
|
|
13734
13734
|
return new Observable_1.Observable(scheduler ? function(subscriber) {
|
|
13735
|
-
var n =
|
|
13735
|
+
var n = start3;
|
|
13736
13736
|
return scheduler.schedule(function() {
|
|
13737
13737
|
if (n < end) {
|
|
13738
13738
|
subscriber.next(n++);
|
|
@@ -13742,7 +13742,7 @@ var require_range = __commonJS({
|
|
|
13742
13742
|
}
|
|
13743
13743
|
});
|
|
13744
13744
|
} : function(subscriber) {
|
|
13745
|
-
var n =
|
|
13745
|
+
var n = start3;
|
|
13746
13746
|
while (n < end && !subscriber.closed) {
|
|
13747
13747
|
subscriber.next(n++);
|
|
13748
13748
|
}
|
|
@@ -30125,14 +30125,14 @@ var require_errors = __commonJS({
|
|
|
30125
30125
|
}
|
|
30126
30126
|
return str2.substring(this_len - search.length, this_len) === search;
|
|
30127
30127
|
}
|
|
30128
|
-
function includes(str2, search,
|
|
30129
|
-
if (typeof
|
|
30130
|
-
|
|
30128
|
+
function includes(str2, search, start3) {
|
|
30129
|
+
if (typeof start3 !== "number") {
|
|
30130
|
+
start3 = 0;
|
|
30131
30131
|
}
|
|
30132
|
-
if (
|
|
30132
|
+
if (start3 + search.length > str2.length) {
|
|
30133
30133
|
return false;
|
|
30134
30134
|
} else {
|
|
30135
|
-
return str2.indexOf(search,
|
|
30135
|
+
return str2.indexOf(search, start3) !== -1;
|
|
30136
30136
|
}
|
|
30137
30137
|
}
|
|
30138
30138
|
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
@@ -32441,14 +32441,14 @@ var require_BufferList = __commonJS({
|
|
|
32441
32441
|
const offset = this._offset(index);
|
|
32442
32442
|
return this._bufs[offset[0]][offset[1]];
|
|
32443
32443
|
};
|
|
32444
|
-
BufferList.prototype.slice = function slice(
|
|
32445
|
-
if (typeof
|
|
32446
|
-
|
|
32444
|
+
BufferList.prototype.slice = function slice(start3, end) {
|
|
32445
|
+
if (typeof start3 === "number" && start3 < 0) {
|
|
32446
|
+
start3 += this.length;
|
|
32447
32447
|
}
|
|
32448
32448
|
if (typeof end === "number" && end < 0) {
|
|
32449
32449
|
end += this.length;
|
|
32450
32450
|
}
|
|
32451
|
-
return this.copy(null, 0,
|
|
32451
|
+
return this.copy(null, 0, start3, end);
|
|
32452
32452
|
};
|
|
32453
32453
|
BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) {
|
|
32454
32454
|
if (typeof srcStart !== "number" || srcStart < 0) {
|
|
@@ -32468,7 +32468,7 @@ var require_BufferList = __commonJS({
|
|
|
32468
32468
|
const len = srcEnd - srcStart;
|
|
32469
32469
|
let bytes = len;
|
|
32470
32470
|
let bufoff = copy2 && dstStart || 0;
|
|
32471
|
-
let
|
|
32471
|
+
let start3 = off[1];
|
|
32472
32472
|
if (srcStart === 0 && srcEnd === this.length) {
|
|
32473
32473
|
if (!copy2) {
|
|
32474
32474
|
return this._bufs.length === 1 ? this._bufs[0] : Buffer4.concat(this._bufs, this.length);
|
|
@@ -32479,43 +32479,43 @@ var require_BufferList = __commonJS({
|
|
|
32479
32479
|
}
|
|
32480
32480
|
return dst;
|
|
32481
32481
|
}
|
|
32482
|
-
if (bytes <= this._bufs[off[0]].length -
|
|
32483
|
-
return copy2 ? this._bufs[off[0]].copy(dst, dstStart,
|
|
32482
|
+
if (bytes <= this._bufs[off[0]].length - start3) {
|
|
32483
|
+
return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start3, start3 + bytes) : this._bufs[off[0]].slice(start3, start3 + bytes);
|
|
32484
32484
|
}
|
|
32485
32485
|
if (!copy2) {
|
|
32486
32486
|
dst = Buffer4.allocUnsafe(len);
|
|
32487
32487
|
}
|
|
32488
32488
|
for (let i2 = off[0]; i2 < this._bufs.length; i2++) {
|
|
32489
|
-
const l = this._bufs[i2].length -
|
|
32489
|
+
const l = this._bufs[i2].length - start3;
|
|
32490
32490
|
if (bytes > l) {
|
|
32491
|
-
this._bufs[i2].copy(dst, bufoff,
|
|
32491
|
+
this._bufs[i2].copy(dst, bufoff, start3);
|
|
32492
32492
|
bufoff += l;
|
|
32493
32493
|
} else {
|
|
32494
|
-
this._bufs[i2].copy(dst, bufoff,
|
|
32494
|
+
this._bufs[i2].copy(dst, bufoff, start3, start3 + bytes);
|
|
32495
32495
|
bufoff += l;
|
|
32496
32496
|
break;
|
|
32497
32497
|
}
|
|
32498
32498
|
bytes -= l;
|
|
32499
|
-
if (
|
|
32500
|
-
|
|
32499
|
+
if (start3) {
|
|
32500
|
+
start3 = 0;
|
|
32501
32501
|
}
|
|
32502
32502
|
}
|
|
32503
32503
|
if (dst.length > bufoff) return dst.slice(0, bufoff);
|
|
32504
32504
|
return dst;
|
|
32505
32505
|
};
|
|
32506
|
-
BufferList.prototype.shallowSlice = function shallowSlice(
|
|
32507
|
-
|
|
32506
|
+
BufferList.prototype.shallowSlice = function shallowSlice(start3, end) {
|
|
32507
|
+
start3 = start3 || 0;
|
|
32508
32508
|
end = typeof end !== "number" ? this.length : end;
|
|
32509
|
-
if (
|
|
32510
|
-
|
|
32509
|
+
if (start3 < 0) {
|
|
32510
|
+
start3 += this.length;
|
|
32511
32511
|
}
|
|
32512
32512
|
if (end < 0) {
|
|
32513
32513
|
end += this.length;
|
|
32514
32514
|
}
|
|
32515
|
-
if (
|
|
32515
|
+
if (start3 === end) {
|
|
32516
32516
|
return this._new();
|
|
32517
32517
|
}
|
|
32518
|
-
const startOffset = this._offset(
|
|
32518
|
+
const startOffset = this._offset(start3);
|
|
32519
32519
|
const endOffset = this._offset(end);
|
|
32520
32520
|
const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1);
|
|
32521
32521
|
if (endOffset[1] === 0) {
|
|
@@ -32528,8 +32528,8 @@ var require_BufferList = __commonJS({
|
|
|
32528
32528
|
}
|
|
32529
32529
|
return this._new(buffers);
|
|
32530
32530
|
};
|
|
32531
|
-
BufferList.prototype.toString = function toString(encoding,
|
|
32532
|
-
return this.slice(
|
|
32531
|
+
BufferList.prototype.toString = function toString(encoding, start3, end) {
|
|
32532
|
+
return this.slice(start3, end).toString(encoding);
|
|
32533
32533
|
};
|
|
32534
32534
|
BufferList.prototype.consume = function consume(bytes) {
|
|
32535
32535
|
bytes = Math.trunc(bytes);
|
|
@@ -33143,14 +33143,14 @@ var require_errors2 = __commonJS({
|
|
|
33143
33143
|
}
|
|
33144
33144
|
return str2.substring(this_len - search.length, this_len) === search;
|
|
33145
33145
|
}
|
|
33146
|
-
function includes(str2, search,
|
|
33147
|
-
if (typeof
|
|
33148
|
-
|
|
33146
|
+
function includes(str2, search, start3) {
|
|
33147
|
+
if (typeof start3 !== "number") {
|
|
33148
|
+
start3 = 0;
|
|
33149
33149
|
}
|
|
33150
|
-
if (
|
|
33150
|
+
if (start3 + search.length > str2.length) {
|
|
33151
33151
|
return false;
|
|
33152
33152
|
} else {
|
|
33153
|
-
return str2.indexOf(search,
|
|
33153
|
+
return str2.indexOf(search, start3) !== -1;
|
|
33154
33154
|
}
|
|
33155
33155
|
}
|
|
33156
33156
|
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
@@ -35271,7 +35271,7 @@ var require_decoder = __commonJS({
|
|
|
35271
35271
|
offset += 1;
|
|
35272
35272
|
const size = SIZES[first2] || -1;
|
|
35273
35273
|
if (bufLength < size) return null;
|
|
35274
|
-
const inRange = (
|
|
35274
|
+
const inRange = (start3, end) => first2 >= start3 && first2 <= end;
|
|
35275
35275
|
if (first2 < 128) return [first2, 1];
|
|
35276
35276
|
if ((first2 & 240) === 128) {
|
|
35277
35277
|
const length = first2 & 15;
|
|
@@ -42735,8 +42735,8 @@ var require_typescript = __commonJS({
|
|
|
42735
42735
|
}
|
|
42736
42736
|
return false;
|
|
42737
42737
|
}
|
|
42738
|
-
function indexOfAnyCharCode(text, charCodes,
|
|
42739
|
-
for (let i2 =
|
|
42738
|
+
function indexOfAnyCharCode(text, charCodes, start3) {
|
|
42739
|
+
for (let i2 = start3 ?? 0; i2 < text.length; i2++) {
|
|
42740
42740
|
if (contains(charCodes, text.charCodeAt(i2))) {
|
|
42741
42741
|
return i2;
|
|
42742
42742
|
}
|
|
@@ -42949,9 +42949,9 @@ var require_typescript = __commonJS({
|
|
|
42949
42949
|
const len = array2.length;
|
|
42950
42950
|
let previousKey;
|
|
42951
42951
|
let key;
|
|
42952
|
-
let
|
|
42952
|
+
let start3 = 0;
|
|
42953
42953
|
let pos = 0;
|
|
42954
|
-
while (
|
|
42954
|
+
while (start3 < len) {
|
|
42955
42955
|
while (pos < len) {
|
|
42956
42956
|
const value = array2[pos];
|
|
42957
42957
|
key = keyfn(value, pos);
|
|
@@ -42962,12 +42962,12 @@ var require_typescript = __commonJS({
|
|
|
42962
42962
|
}
|
|
42963
42963
|
pos++;
|
|
42964
42964
|
}
|
|
42965
|
-
if (
|
|
42966
|
-
const v = mapfn(array2.slice(
|
|
42965
|
+
if (start3 < pos) {
|
|
42966
|
+
const v = mapfn(array2.slice(start3, pos), previousKey, start3, pos);
|
|
42967
42967
|
if (v) {
|
|
42968
42968
|
result.push(v);
|
|
42969
42969
|
}
|
|
42970
|
-
|
|
42970
|
+
start3 = pos;
|
|
42971
42971
|
}
|
|
42972
42972
|
previousKey = key;
|
|
42973
42973
|
pos++;
|
|
@@ -43001,18 +43001,18 @@ var require_typescript = __commonJS({
|
|
|
43001
43001
|
return false;
|
|
43002
43002
|
}
|
|
43003
43003
|
function getRangesWhere(arr, pred, cb) {
|
|
43004
|
-
let
|
|
43004
|
+
let start3;
|
|
43005
43005
|
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
43006
43006
|
if (pred(arr[i2])) {
|
|
43007
|
-
|
|
43007
|
+
start3 = start3 === void 0 ? i2 : start3;
|
|
43008
43008
|
} else {
|
|
43009
|
-
if (
|
|
43010
|
-
cb(
|
|
43011
|
-
|
|
43009
|
+
if (start3 !== void 0) {
|
|
43010
|
+
cb(start3, i2);
|
|
43011
|
+
start3 = void 0;
|
|
43012
43012
|
}
|
|
43013
43013
|
}
|
|
43014
43014
|
}
|
|
43015
|
-
if (
|
|
43015
|
+
if (start3 !== void 0) cb(start3, arr.length);
|
|
43016
43016
|
}
|
|
43017
43017
|
function concatenate(array1, array2) {
|
|
43018
43018
|
if (array2 === void 0 || array2.length === 0) return array1;
|
|
@@ -43182,12 +43182,12 @@ var require_typescript = __commonJS({
|
|
|
43182
43182
|
function toOffset(array2, offset) {
|
|
43183
43183
|
return offset < 0 ? array2.length + offset : offset;
|
|
43184
43184
|
}
|
|
43185
|
-
function addRange(to, from11,
|
|
43185
|
+
function addRange(to, from11, start3, end) {
|
|
43186
43186
|
if (from11 === void 0 || from11.length === 0) return to;
|
|
43187
|
-
if (to === void 0) return from11.slice(
|
|
43188
|
-
|
|
43187
|
+
if (to === void 0) return from11.slice(start3, end);
|
|
43188
|
+
start3 = start3 === void 0 ? 0 : toOffset(from11, start3);
|
|
43189
43189
|
end = end === void 0 ? from11.length : toOffset(from11, end);
|
|
43190
|
-
for (let i2 =
|
|
43190
|
+
for (let i2 = start3; i2 < end && i2 < from11.length; i2++) {
|
|
43191
43191
|
if (from11[i2] !== void 0) {
|
|
43192
43192
|
to.push(from11[i2]);
|
|
43193
43193
|
}
|
|
@@ -43306,11 +43306,11 @@ var require_typescript = __commonJS({
|
|
|
43306
43306
|
}
|
|
43307
43307
|
return ~low;
|
|
43308
43308
|
}
|
|
43309
|
-
function reduceLeft(array2, f3, initial,
|
|
43309
|
+
function reduceLeft(array2, f3, initial, start3, count) {
|
|
43310
43310
|
if (array2 && array2.length > 0) {
|
|
43311
43311
|
const size = array2.length;
|
|
43312
43312
|
if (size > 0) {
|
|
43313
|
-
let pos =
|
|
43313
|
+
let pos = start3 === void 0 || start3 < 0 ? 0 : start3;
|
|
43314
43314
|
const end = count === void 0 || pos + count > size - 1 ? size - 1 : pos + count;
|
|
43315
43315
|
let result;
|
|
43316
43316
|
if (arguments.length <= 2) {
|
|
@@ -45492,9 +45492,9 @@ ${lanes.join("\n")}
|
|
|
45492
45492
|
function measure(measureName, startMarkName, endMarkName) {
|
|
45493
45493
|
if (enabled) {
|
|
45494
45494
|
const end = (endMarkName !== void 0 ? marks.get(endMarkName) : void 0) ?? timestamp();
|
|
45495
|
-
const
|
|
45495
|
+
const start3 = (startMarkName !== void 0 ? marks.get(startMarkName) : void 0) ?? timeorigin;
|
|
45496
45496
|
const previousDuration = durations.get(measureName) || 0;
|
|
45497
|
-
durations.set(measureName, previousDuration + (end -
|
|
45497
|
+
durations.set(measureName, previousDuration + (end - start3));
|
|
45498
45498
|
performanceImpl == null ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName);
|
|
45499
45499
|
}
|
|
45500
45500
|
}
|
|
@@ -48379,7 +48379,7 @@ ${lanes.join("\n")}
|
|
|
48379
48379
|
var _a2;
|
|
48380
48380
|
timerToUpdateChildWatches = void 0;
|
|
48381
48381
|
sysLog(`sysLog:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size}`);
|
|
48382
|
-
const
|
|
48382
|
+
const start3 = timestamp();
|
|
48383
48383
|
const invokeMap = /* @__PURE__ */ new Map();
|
|
48384
48384
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
48385
48385
|
const result = cacheToUpdateChildWatches.entries().next();
|
|
@@ -48389,7 +48389,7 @@ ${lanes.join("\n")}
|
|
|
48389
48389
|
const hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
48390
48390
|
if (!((_a2 = cache.get(dirPath)) == null ? void 0 : _a2.targetWatcher)) invokeCallbacks(dirName, dirPath, invokeMap, hasChanges ? void 0 : fileNames);
|
|
48391
48391
|
}
|
|
48392
|
-
sysLog(`sysLog:: invokingWatchers:: Elapsed:: ${timestamp() -
|
|
48392
|
+
sysLog(`sysLog:: invokingWatchers:: Elapsed:: ${timestamp() - start3}ms:: ${cacheToUpdateChildWatches.size}`);
|
|
48393
48393
|
callbackCache.forEach((callbacks, rootDirName) => {
|
|
48394
48394
|
const existing = invokeMap.get(rootDirName);
|
|
48395
48395
|
if (existing) {
|
|
@@ -48402,7 +48402,7 @@ ${lanes.join("\n")}
|
|
|
48402
48402
|
});
|
|
48403
48403
|
}
|
|
48404
48404
|
});
|
|
48405
|
-
const elapsed = timestamp() -
|
|
48405
|
+
const elapsed = timestamp() - start3;
|
|
48406
48406
|
sysLog(`sysLog:: Elapsed:: ${elapsed}ms:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size} ${timerToUpdateChildWatches}`);
|
|
48407
48407
|
}
|
|
48408
48408
|
function removeChildWatches(parentWatcher) {
|
|
@@ -49338,12 +49338,12 @@ ${lanes.join("\n")}
|
|
|
49338
49338
|
function isVolumeCharacter(charCode) {
|
|
49339
49339
|
return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90;
|
|
49340
49340
|
}
|
|
49341
|
-
function getFileUrlVolumeSeparatorEnd(url2,
|
|
49342
|
-
const ch0 = url2.charCodeAt(
|
|
49343
|
-
if (ch0 === 58) return
|
|
49344
|
-
if (ch0 === 37 && url2.charCodeAt(
|
|
49345
|
-
const ch2 = url2.charCodeAt(
|
|
49346
|
-
if (ch2 === 97 || ch2 === 65) return
|
|
49341
|
+
function getFileUrlVolumeSeparatorEnd(url2, start3) {
|
|
49342
|
+
const ch0 = url2.charCodeAt(start3);
|
|
49343
|
+
if (ch0 === 58) return start3 + 1;
|
|
49344
|
+
if (ch0 === 37 && url2.charCodeAt(start3 + 1) === 51) {
|
|
49345
|
+
const ch2 = url2.charCodeAt(start3 + 2);
|
|
49346
|
+
if (ch2 === 97 || ch2 === 65) return start3 + 3;
|
|
49347
49347
|
}
|
|
49348
49348
|
return -1;
|
|
49349
49349
|
}
|
|
@@ -49701,19 +49701,19 @@ ${lanes.join("\n")}
|
|
|
49701
49701
|
function getPathComponentsRelativeTo(from11, to, stringEqualityComparer, getCanonicalFileName) {
|
|
49702
49702
|
const fromComponents = reducePathComponents(getPathComponents(from11));
|
|
49703
49703
|
const toComponents = reducePathComponents(getPathComponents(to));
|
|
49704
|
-
let
|
|
49705
|
-
for (
|
|
49706
|
-
const fromComponent = getCanonicalFileName(fromComponents[
|
|
49707
|
-
const toComponent = getCanonicalFileName(toComponents[
|
|
49708
|
-
const comparer =
|
|
49704
|
+
let start3;
|
|
49705
|
+
for (start3 = 0; start3 < fromComponents.length && start3 < toComponents.length; start3++) {
|
|
49706
|
+
const fromComponent = getCanonicalFileName(fromComponents[start3]);
|
|
49707
|
+
const toComponent = getCanonicalFileName(toComponents[start3]);
|
|
49708
|
+
const comparer = start3 === 0 ? equateStringsCaseInsensitive : stringEqualityComparer;
|
|
49709
49709
|
if (!comparer(fromComponent, toComponent)) break;
|
|
49710
49710
|
}
|
|
49711
|
-
if (
|
|
49711
|
+
if (start3 === 0) {
|
|
49712
49712
|
return toComponents;
|
|
49713
49713
|
}
|
|
49714
|
-
const components = toComponents.slice(
|
|
49714
|
+
const components = toComponents.slice(start3);
|
|
49715
49715
|
const relative2 = [];
|
|
49716
|
-
for (;
|
|
49716
|
+
for (; start3 < fromComponents.length; start3++) {
|
|
49717
49717
|
relative2.push("..");
|
|
49718
49718
|
}
|
|
49719
49719
|
return ["", ...relative2, ...components];
|
|
@@ -52753,7 +52753,7 @@ ${lanes.join("\n")}
|
|
|
52753
52753
|
}
|
|
52754
52754
|
return true;
|
|
52755
52755
|
}
|
|
52756
|
-
function createScanner(languageVersion, skipTrivia2, languageVariant = 0, textInitial, onError,
|
|
52756
|
+
function createScanner(languageVersion, skipTrivia2, languageVariant = 0, textInitial, onError, start3, length2) {
|
|
52757
52757
|
var text = textInitial;
|
|
52758
52758
|
var pos;
|
|
52759
52759
|
var end;
|
|
@@ -52766,7 +52766,7 @@ ${lanes.join("\n")}
|
|
|
52766
52766
|
var skipJsDocLeadingAsterisks = 0;
|
|
52767
52767
|
var scriptKind = 0;
|
|
52768
52768
|
var jsDocParsingMode = 0;
|
|
52769
|
-
setText(text,
|
|
52769
|
+
setText(text, start3, length2);
|
|
52770
52770
|
var scanner2 = {
|
|
52771
52771
|
getTokenFullStart: () => fullStartPos,
|
|
52772
52772
|
getStartPos: () => fullStartPos,
|
|
@@ -54156,7 +54156,7 @@ ${lanes.join("\n")}
|
|
|
54156
54156
|
}
|
|
54157
54157
|
break;
|
|
54158
54158
|
default:
|
|
54159
|
-
const
|
|
54159
|
+
const start32 = pos;
|
|
54160
54160
|
const setFlags = scanPatternModifiers(
|
|
54161
54161
|
0
|
|
54162
54162
|
/* None */
|
|
@@ -54164,8 +54164,8 @@ ${lanes.join("\n")}
|
|
|
54164
54164
|
if (charCodeChecked(pos) === 45) {
|
|
54165
54165
|
pos++;
|
|
54166
54166
|
scanPatternModifiers(setFlags);
|
|
54167
|
-
if (pos ===
|
|
54168
|
-
error210(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign,
|
|
54167
|
+
if (pos === start32 + 1) {
|
|
54168
|
+
error210(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start32, pos - start32);
|
|
54169
54169
|
}
|
|
54170
54170
|
}
|
|
54171
54171
|
scanExpectedChar(
|
|
@@ -54736,7 +54736,7 @@ ${lanes.join("\n")}
|
|
|
54736
54736
|
mayContainStrings = true;
|
|
54737
54737
|
}
|
|
54738
54738
|
pos++;
|
|
54739
|
-
|
|
54739
|
+
start3 = pos;
|
|
54740
54740
|
characterCount = 0;
|
|
54741
54741
|
break;
|
|
54742
54742
|
default:
|
|
@@ -55442,13 +55442,13 @@ ${lanes.join("\n")}
|
|
|
55442
55442
|
function textSpanIntersectsWithTextSpan(span, other) {
|
|
55443
55443
|
return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length);
|
|
55444
55444
|
}
|
|
55445
|
-
function textSpanIntersectsWith(span,
|
|
55446
|
-
return decodedTextSpanIntersectsWith(span.start, span.length,
|
|
55445
|
+
function textSpanIntersectsWith(span, start3, length2) {
|
|
55446
|
+
return decodedTextSpanIntersectsWith(span.start, span.length, start3, length2);
|
|
55447
55447
|
}
|
|
55448
|
-
function decodedTextSpanIntersectsWith(start1, length1,
|
|
55448
|
+
function decodedTextSpanIntersectsWith(start1, length1, start22, length2) {
|
|
55449
55449
|
const end1 = start1 + length1;
|
|
55450
|
-
const end2 =
|
|
55451
|
-
return
|
|
55450
|
+
const end2 = start22 + length2;
|
|
55451
|
+
return start22 <= end1 && end2 >= start1;
|
|
55452
55452
|
}
|
|
55453
55453
|
function textSpanIntersectsWithPosition(span, position) {
|
|
55454
55454
|
return position <= textSpanEnd(span) && position >= span.start;
|
|
@@ -55457,9 +55457,9 @@ ${lanes.join("\n")}
|
|
|
55457
55457
|
return textSpanIntersectsWith(span, range.pos, range.end - range.pos);
|
|
55458
55458
|
}
|
|
55459
55459
|
function textSpanIntersection(span1, span2) {
|
|
55460
|
-
const
|
|
55460
|
+
const start3 = Math.max(span1.start, span2.start);
|
|
55461
55461
|
const end = Math.min(textSpanEnd(span1), textSpanEnd(span2));
|
|
55462
|
-
return
|
|
55462
|
+
return start3 <= end ? createTextSpanFromBounds(start3, end) : void 0;
|
|
55463
55463
|
}
|
|
55464
55464
|
function normalizeSpans(spans) {
|
|
55465
55465
|
spans = spans.filter((span) => span.length > 0).sort((a, b) => {
|
|
@@ -55471,9 +55471,9 @@ ${lanes.join("\n")}
|
|
|
55471
55471
|
let span = spans[i2];
|
|
55472
55472
|
let j = i2 + 1;
|
|
55473
55473
|
while (j < spans.length && textSpanIntersectsWithTextSpan(span, spans[j])) {
|
|
55474
|
-
const
|
|
55474
|
+
const start3 = Math.min(span.start, spans[j].start);
|
|
55475
55475
|
const end = Math.max(textSpanEnd(span), textSpanEnd(spans[j]));
|
|
55476
|
-
span = createTextSpanFromBounds(
|
|
55476
|
+
span = createTextSpanFromBounds(start3, end);
|
|
55477
55477
|
j++;
|
|
55478
55478
|
}
|
|
55479
55479
|
i2 = j;
|
|
@@ -55481,17 +55481,17 @@ ${lanes.join("\n")}
|
|
|
55481
55481
|
}
|
|
55482
55482
|
return result;
|
|
55483
55483
|
}
|
|
55484
|
-
function createTextSpan(
|
|
55485
|
-
if (
|
|
55484
|
+
function createTextSpan(start3, length2) {
|
|
55485
|
+
if (start3 < 0) {
|
|
55486
55486
|
throw new Error("start < 0");
|
|
55487
55487
|
}
|
|
55488
55488
|
if (length2 < 0) {
|
|
55489
55489
|
throw new Error("length < 0");
|
|
55490
55490
|
}
|
|
55491
|
-
return { start:
|
|
55491
|
+
return { start: start3, length: length2 };
|
|
55492
55492
|
}
|
|
55493
|
-
function createTextSpanFromBounds(
|
|
55494
|
-
return createTextSpan(
|
|
55493
|
+
function createTextSpanFromBounds(start3, end) {
|
|
55494
|
+
return createTextSpan(start3, end - start3);
|
|
55495
55495
|
}
|
|
55496
55496
|
function textChangeRangeNewSpan(range) {
|
|
55497
55497
|
return createTextSpan(range.span.start, range.newLength);
|
|
@@ -57248,10 +57248,10 @@ ${lanes.join("\n")}
|
|
|
57248
57248
|
if (lineIndex + 1 === lineStarts.length) {
|
|
57249
57249
|
return sourceText.length - 1;
|
|
57250
57250
|
} else {
|
|
57251
|
-
const
|
|
57251
|
+
const start3 = lineStarts[lineIndex];
|
|
57252
57252
|
let pos = lineStarts[lineIndex + 1] - 1;
|
|
57253
57253
|
Debug.assert(isLineBreak(sourceText.charCodeAt(pos)));
|
|
57254
|
-
while (
|
|
57254
|
+
while (start3 <= pos && isLineBreak(sourceText.charCodeAt(pos))) {
|
|
57255
57255
|
pos--;
|
|
57256
57256
|
}
|
|
57257
57257
|
return pos;
|
|
@@ -57331,8 +57331,8 @@ ${lanes.join("\n")}
|
|
|
57331
57331
|
}
|
|
57332
57332
|
return false;
|
|
57333
57333
|
}
|
|
57334
|
-
function isPinnedComment(text,
|
|
57335
|
-
return text.charCodeAt(
|
|
57334
|
+
function isPinnedComment(text, start3) {
|
|
57335
|
+
return text.charCodeAt(start3 + 1) === 42 && text.charCodeAt(start3 + 2) === 33;
|
|
57336
57336
|
}
|
|
57337
57337
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
57338
57338
|
const directivesByLine = new Map(
|
|
@@ -58313,8 +58313,8 @@ ${lanes.join("\n")}
|
|
|
58313
58313
|
return createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args);
|
|
58314
58314
|
}
|
|
58315
58315
|
function createDiagnosticForNodeArray(sourceFile, nodes, message, ...args) {
|
|
58316
|
-
const
|
|
58317
|
-
return createFileDiagnostic(sourceFile,
|
|
58316
|
+
const start3 = skipTrivia(sourceFile.text, nodes.pos);
|
|
58317
|
+
return createFileDiagnostic(sourceFile, start3, nodes.end - start3, message, ...args);
|
|
58318
58318
|
}
|
|
58319
58319
|
function createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args) {
|
|
58320
58320
|
const span = getErrorSpanForNode(sourceFile, node);
|
|
@@ -58325,20 +58325,20 @@ ${lanes.join("\n")}
|
|
|
58325
58325
|
return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation);
|
|
58326
58326
|
}
|
|
58327
58327
|
function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) {
|
|
58328
|
-
const
|
|
58329
|
-
return createFileDiagnosticFromMessageChain(sourceFile,
|
|
58328
|
+
const start3 = skipTrivia(sourceFile.text, nodes.pos);
|
|
58329
|
+
return createFileDiagnosticFromMessageChain(sourceFile, start3, nodes.end - start3, messageChain, relatedInformation);
|
|
58330
58330
|
}
|
|
58331
|
-
function assertDiagnosticLocation(sourceText,
|
|
58332
|
-
Debug.assertGreaterThanOrEqual(
|
|
58331
|
+
function assertDiagnosticLocation(sourceText, start3, length2) {
|
|
58332
|
+
Debug.assertGreaterThanOrEqual(start3, 0);
|
|
58333
58333
|
Debug.assertGreaterThanOrEqual(length2, 0);
|
|
58334
|
-
Debug.assertLessThanOrEqual(
|
|
58335
|
-
Debug.assertLessThanOrEqual(
|
|
58334
|
+
Debug.assertLessThanOrEqual(start3, sourceText.length);
|
|
58335
|
+
Debug.assertLessThanOrEqual(start3 + length2, sourceText.length);
|
|
58336
58336
|
}
|
|
58337
|
-
function createFileDiagnosticFromMessageChain(file2,
|
|
58338
|
-
assertDiagnosticLocation(file2.text,
|
|
58337
|
+
function createFileDiagnosticFromMessageChain(file2, start3, length2, messageChain, relatedInformation) {
|
|
58338
|
+
assertDiagnosticLocation(file2.text, start3, length2);
|
|
58339
58339
|
return {
|
|
58340
58340
|
file: file2,
|
|
58341
|
-
start:
|
|
58341
|
+
start: start3,
|
|
58342
58342
|
length: length2,
|
|
58343
58343
|
code: messageChain.code,
|
|
58344
58344
|
category: messageChain.category,
|
|
@@ -58394,8 +58394,8 @@ ${lanes.join("\n")}
|
|
|
58394
58394
|
pos
|
|
58395
58395
|
);
|
|
58396
58396
|
scanner2.scan();
|
|
58397
|
-
const
|
|
58398
|
-
return createTextSpanFromBounds(
|
|
58397
|
+
const start3 = scanner2.getTokenStart();
|
|
58398
|
+
return createTextSpanFromBounds(start3, scanner2.getTokenEnd());
|
|
58399
58399
|
}
|
|
58400
58400
|
function scanTokenAtPosition(sourceFile, pos) {
|
|
58401
58401
|
const scanner2 = createScanner(
|
|
@@ -58462,9 +58462,9 @@ ${lanes.join("\n")}
|
|
|
58462
58462
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
58463
58463
|
case 297:
|
|
58464
58464
|
case 298: {
|
|
58465
|
-
const
|
|
58465
|
+
const start3 = skipTrivia(sourceFile.text, node.pos);
|
|
58466
58466
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
58467
|
-
return createTextSpanFromBounds(
|
|
58467
|
+
return createTextSpanFromBounds(start3, end);
|
|
58468
58468
|
}
|
|
58469
58469
|
case 254:
|
|
58470
58470
|
case 230: {
|
|
@@ -58481,7 +58481,7 @@ ${lanes.join("\n")}
|
|
|
58481
58481
|
}
|
|
58482
58482
|
case 177: {
|
|
58483
58483
|
const constructorDeclaration = node;
|
|
58484
|
-
const
|
|
58484
|
+
const start3 = skipTrivia(sourceFile.text, constructorDeclaration.pos);
|
|
58485
58485
|
const scanner2 = createScanner(
|
|
58486
58486
|
sourceFile.languageVersion,
|
|
58487
58487
|
/*skipTrivia*/
|
|
@@ -58490,14 +58490,14 @@ ${lanes.join("\n")}
|
|
|
58490
58490
|
sourceFile.text,
|
|
58491
58491
|
/*onError*/
|
|
58492
58492
|
void 0,
|
|
58493
|
-
|
|
58493
|
+
start3
|
|
58494
58494
|
);
|
|
58495
58495
|
let token = scanner2.scan();
|
|
58496
58496
|
while (token !== 137 && token !== 1) {
|
|
58497
58497
|
token = scanner2.scan();
|
|
58498
58498
|
}
|
|
58499
58499
|
const end = scanner2.getTokenEnd();
|
|
58500
|
-
return createTextSpanFromBounds(
|
|
58500
|
+
return createTextSpanFromBounds(start3, end);
|
|
58501
58501
|
}
|
|
58502
58502
|
}
|
|
58503
58503
|
if (errorNode === void 0) {
|
|
@@ -62098,8 +62098,8 @@ ${lanes.join("\n")}
|
|
|
62098
62098
|
function rangeContainsRange(r1, r2) {
|
|
62099
62099
|
return startEndContainsRange(r1.pos, r1.end, r2);
|
|
62100
62100
|
}
|
|
62101
|
-
function startEndContainsRange(
|
|
62102
|
-
return
|
|
62101
|
+
function startEndContainsRange(start3, end, range) {
|
|
62102
|
+
return start3 <= range.pos && end >= range.end;
|
|
62103
62103
|
}
|
|
62104
62104
|
function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) {
|
|
62105
62105
|
while (pos-- > stopPos) {
|
|
@@ -62481,18 +62481,18 @@ ${lanes.join("\n")}
|
|
|
62481
62481
|
function getLocaleSpecificMessage(message) {
|
|
62482
62482
|
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
62483
62483
|
}
|
|
62484
|
-
function createDetachedDiagnostic(fileName, sourceText,
|
|
62485
|
-
if (
|
|
62486
|
-
length2 = sourceText.length -
|
|
62484
|
+
function createDetachedDiagnostic(fileName, sourceText, start3, length2, message, ...args) {
|
|
62485
|
+
if (start3 + length2 > sourceText.length) {
|
|
62486
|
+
length2 = sourceText.length - start3;
|
|
62487
62487
|
}
|
|
62488
|
-
assertDiagnosticLocation(sourceText,
|
|
62488
|
+
assertDiagnosticLocation(sourceText, start3, length2);
|
|
62489
62489
|
let text = getLocaleSpecificMessage(message);
|
|
62490
62490
|
if (some(args)) {
|
|
62491
62491
|
text = formatStringFromArgs(text, args);
|
|
62492
62492
|
}
|
|
62493
62493
|
return {
|
|
62494
62494
|
file: void 0,
|
|
62495
|
-
start:
|
|
62495
|
+
start: start3,
|
|
62496
62496
|
length: length2,
|
|
62497
62497
|
messageText: text,
|
|
62498
62498
|
category: message.category,
|
|
@@ -62540,15 +62540,15 @@ ${lanes.join("\n")}
|
|
|
62540
62540
|
}
|
|
62541
62541
|
return diagnosticsWithLocation;
|
|
62542
62542
|
}
|
|
62543
|
-
function createFileDiagnostic(file2,
|
|
62544
|
-
assertDiagnosticLocation(file2.text,
|
|
62543
|
+
function createFileDiagnostic(file2, start3, length2, message, ...args) {
|
|
62544
|
+
assertDiagnosticLocation(file2.text, start3, length2);
|
|
62545
62545
|
let text = getLocaleSpecificMessage(message);
|
|
62546
62546
|
if (some(args)) {
|
|
62547
62547
|
text = formatStringFromArgs(text, args);
|
|
62548
62548
|
}
|
|
62549
62549
|
return {
|
|
62550
62550
|
file: file2,
|
|
62551
|
-
start:
|
|
62551
|
+
start: start3,
|
|
62552
62552
|
length: length2,
|
|
62553
62553
|
messageText: text,
|
|
62554
62554
|
category: message.category,
|
|
@@ -70443,8 +70443,8 @@ ${lanes.join("\n")}
|
|
|
70443
70443
|
function createGlobalMethodCall(globalObjectName, methodName, argumentsList) {
|
|
70444
70444
|
return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList);
|
|
70445
70445
|
}
|
|
70446
|
-
function createArraySliceCall(array2,
|
|
70447
|
-
return createMethodCall(array2, "slice",
|
|
70446
|
+
function createArraySliceCall(array2, start3) {
|
|
70447
|
+
return createMethodCall(array2, "slice", start3 === void 0 ? [] : [asExpression(start3)]);
|
|
70448
70448
|
}
|
|
70449
70449
|
function createArrayConcatCall(array2, argumentsList) {
|
|
70450
70450
|
return createMethodCall(array2, "concat", argumentsList);
|
|
@@ -70756,8 +70756,8 @@ ${lanes.join("\n")}
|
|
|
70756
70756
|
Debug.assert(every(nodes, isStatementOrBlock), "Cannot lift nodes to a Block.");
|
|
70757
70757
|
return singleOrUndefined(nodes) || createBlock(nodes);
|
|
70758
70758
|
}
|
|
70759
|
-
function findSpanEnd(array2, test,
|
|
70760
|
-
let i2 =
|
|
70759
|
+
function findSpanEnd(array2, test, start3) {
|
|
70760
|
+
let i2 = start3;
|
|
70761
70761
|
while (i2 < array2.length && test(array2[i2])) {
|
|
70762
70762
|
i2++;
|
|
70763
70763
|
}
|
|
@@ -74331,8 +74331,8 @@ ${lanes.join("\n")}
|
|
|
74331
74331
|
}
|
|
74332
74332
|
}
|
|
74333
74333
|
}
|
|
74334
|
-
function isJSDocLikeText(text,
|
|
74335
|
-
return text.charCodeAt(
|
|
74334
|
+
function isJSDocLikeText(text, start3) {
|
|
74335
|
+
return text.charCodeAt(start3 + 1) === 42 && text.charCodeAt(start3 + 2) === 42 && text.charCodeAt(start3 + 3) !== 47;
|
|
74336
74336
|
}
|
|
74337
74337
|
function isFileProbablyExternalModule(sourceFile) {
|
|
74338
74338
|
return forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) || getImportMetaIfNecessary(sourceFile);
|
|
@@ -75480,15 +75480,15 @@ ${lanes.join("\n")}
|
|
|
75480
75480
|
newSourceFile.flags |= sourceFile.flags & 12582912;
|
|
75481
75481
|
return newSourceFile;
|
|
75482
75482
|
}
|
|
75483
|
-
function parseIsolatedJSDocComment(content,
|
|
75484
|
-
const result = Parser.JSDocParser.parseIsolatedJSDocComment(content,
|
|
75483
|
+
function parseIsolatedJSDocComment(content, start3, length2) {
|
|
75484
|
+
const result = Parser.JSDocParser.parseIsolatedJSDocComment(content, start3, length2);
|
|
75485
75485
|
if (result && result.jsDoc) {
|
|
75486
75486
|
Parser.fixupParentReferences(result.jsDoc);
|
|
75487
75487
|
}
|
|
75488
75488
|
return result;
|
|
75489
75489
|
}
|
|
75490
|
-
function parseJSDocTypeExpressionForTests(content,
|
|
75491
|
-
return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content,
|
|
75490
|
+
function parseJSDocTypeExpressionForTests(content, start3, length2) {
|
|
75491
|
+
return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start3, length2);
|
|
75492
75492
|
}
|
|
75493
75493
|
var Parser;
|
|
75494
75494
|
((Parser2) => {
|
|
@@ -75857,12 +75857,12 @@ ${lanes.join("\n")}
|
|
|
75857
75857
|
const savedParseDiagnostics = parseDiagnostics;
|
|
75858
75858
|
parseDiagnostics = [];
|
|
75859
75859
|
let pos = 0;
|
|
75860
|
-
let
|
|
75861
|
-
while (
|
|
75860
|
+
let start3 = findNextStatementWithAwait(sourceFile.statements, 0);
|
|
75861
|
+
while (start3 !== -1) {
|
|
75862
75862
|
const prevStatement = sourceFile.statements[pos];
|
|
75863
|
-
const nextStatement = sourceFile.statements[
|
|
75864
|
-
addRange(statements, sourceFile.statements, pos,
|
|
75865
|
-
pos = findNextStatementWithoutAwait(sourceFile.statements,
|
|
75863
|
+
const nextStatement = sourceFile.statements[start3];
|
|
75864
|
+
addRange(statements, sourceFile.statements, pos, start3);
|
|
75865
|
+
pos = findNextStatementWithoutAwait(sourceFile.statements, start3);
|
|
75866
75866
|
const diagnosticStart = findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos);
|
|
75867
75867
|
const diagnosticEnd = diagnosticStart >= 0 ? findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= nextStatement.pos, diagnosticStart) : -1;
|
|
75868
75868
|
if (diagnosticStart >= 0) {
|
|
@@ -75896,7 +75896,7 @@ ${lanes.join("\n")}
|
|
|
75896
75896
|
2
|
|
75897
75897
|
/* Reparse */
|
|
75898
75898
|
);
|
|
75899
|
-
|
|
75899
|
+
start3 = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1;
|
|
75900
75900
|
}
|
|
75901
75901
|
if (pos >= 0) {
|
|
75902
75902
|
const prevStatement = sourceFile.statements[pos];
|
|
@@ -76103,18 +76103,18 @@ ${lanes.join("\n")}
|
|
|
76103
76103
|
function parseErrorAtCurrentToken(message, ...args) {
|
|
76104
76104
|
return parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), message, ...args);
|
|
76105
76105
|
}
|
|
76106
|
-
function parseErrorAtPosition(
|
|
76106
|
+
function parseErrorAtPosition(start3, length2, message, ...args) {
|
|
76107
76107
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
76108
76108
|
let result;
|
|
76109
|
-
if (!lastError ||
|
|
76110
|
-
result = createDetachedDiagnostic(fileName, sourceText,
|
|
76109
|
+
if (!lastError || start3 !== lastError.start) {
|
|
76110
|
+
result = createDetachedDiagnostic(fileName, sourceText, start3, length2, message, ...args);
|
|
76111
76111
|
parseDiagnostics.push(result);
|
|
76112
76112
|
}
|
|
76113
76113
|
parseErrorBeforeNextFinishedNode = true;
|
|
76114
76114
|
return result;
|
|
76115
76115
|
}
|
|
76116
|
-
function parseErrorAt(
|
|
76117
|
-
return parseErrorAtPosition(
|
|
76116
|
+
function parseErrorAt(start3, end, message, ...args) {
|
|
76117
|
+
return parseErrorAtPosition(start3, end - start3, message, ...args);
|
|
76118
76118
|
}
|
|
76119
76119
|
function parseErrorAtRange(range, message, ...args) {
|
|
76120
76120
|
parseErrorAt(range.pos, range.end, message, ...args);
|
|
@@ -79396,8 +79396,8 @@ ${lanes.join("\n")}
|
|
|
79396
79396
|
parseErrorAtRange(openingTag, Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);
|
|
79397
79397
|
} else {
|
|
79398
79398
|
const tag = openingTag.tagName;
|
|
79399
|
-
const
|
|
79400
|
-
parseErrorAt(
|
|
79399
|
+
const start3 = Math.min(skipTrivia(sourceText, tag.pos), tag.end);
|
|
79400
|
+
parseErrorAt(start3, tag.end, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTag.tagName));
|
|
79401
79401
|
}
|
|
79402
79402
|
return void 0;
|
|
79403
79403
|
case 31:
|
|
@@ -82234,7 +82234,7 @@ ${lanes.join("\n")}
|
|
|
82234
82234
|
})(Tristate || (Tristate = {}));
|
|
82235
82235
|
let JSDocParser;
|
|
82236
82236
|
((JSDocParser2) => {
|
|
82237
|
-
function parseJSDocTypeExpressionForTests2(content,
|
|
82237
|
+
function parseJSDocTypeExpressionForTests2(content, start3, length2) {
|
|
82238
82238
|
initializeState(
|
|
82239
82239
|
"file.js",
|
|
82240
82240
|
content,
|
|
@@ -82245,7 +82245,7 @@ ${lanes.join("\n")}
|
|
|
82245
82245
|
0
|
|
82246
82246
|
/* ParseAll */
|
|
82247
82247
|
);
|
|
82248
|
-
scanner2.setText(content,
|
|
82248
|
+
scanner2.setText(content, start3, length2);
|
|
82249
82249
|
currentToken = scanner2.scan();
|
|
82250
82250
|
const jsDocTypeExpression = parseJSDocTypeExpression();
|
|
82251
82251
|
const sourceFile = createSourceFile2(
|
|
@@ -82315,7 +82315,7 @@ ${lanes.join("\n")}
|
|
|
82315
82315
|
return finishNode(result, pos);
|
|
82316
82316
|
}
|
|
82317
82317
|
JSDocParser2.parseJSDocNameReference = parseJSDocNameReference;
|
|
82318
|
-
function parseIsolatedJSDocComment2(content,
|
|
82318
|
+
function parseIsolatedJSDocComment2(content, start3, length2) {
|
|
82319
82319
|
initializeState(
|
|
82320
82320
|
"",
|
|
82321
82321
|
content,
|
|
@@ -82326,18 +82326,18 @@ ${lanes.join("\n")}
|
|
|
82326
82326
|
0
|
|
82327
82327
|
/* ParseAll */
|
|
82328
82328
|
);
|
|
82329
|
-
const jsDoc = doInsideOfContext(16777216, () => parseJSDocCommentWorker(
|
|
82329
|
+
const jsDoc = doInsideOfContext(16777216, () => parseJSDocCommentWorker(start3, length2));
|
|
82330
82330
|
const sourceFile = { languageVariant: 0, text: content };
|
|
82331
82331
|
const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
82332
82332
|
clearState();
|
|
82333
82333
|
return jsDoc ? { jsDoc, diagnostics } : void 0;
|
|
82334
82334
|
}
|
|
82335
82335
|
JSDocParser2.parseIsolatedJSDocComment = parseIsolatedJSDocComment2;
|
|
82336
|
-
function parseJSDocComment(parent2,
|
|
82336
|
+
function parseJSDocComment(parent2, start3, length2) {
|
|
82337
82337
|
const saveToken = currentToken;
|
|
82338
82338
|
const saveParseDiagnosticsLength = parseDiagnostics.length;
|
|
82339
82339
|
const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode;
|
|
82340
|
-
const comment = doInsideOfContext(16777216, () => parseJSDocCommentWorker(
|
|
82340
|
+
const comment = doInsideOfContext(16777216, () => parseJSDocCommentWorker(start3, length2));
|
|
82341
82341
|
setParent(comment, parent2);
|
|
82342
82342
|
if (contextFlags & 524288) {
|
|
82343
82343
|
if (!jsDocDiagnostics) {
|
|
@@ -82364,14 +82364,14 @@ ${lanes.join("\n")}
|
|
|
82364
82364
|
PropertyLikeParse2[PropertyLikeParse2["Parameter"] = 2] = "Parameter";
|
|
82365
82365
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
82366
82366
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
82367
|
-
function parseJSDocCommentWorker(
|
|
82367
|
+
function parseJSDocCommentWorker(start3 = 0, length2) {
|
|
82368
82368
|
const content = sourceText;
|
|
82369
|
-
const end = length2 === void 0 ? content.length :
|
|
82370
|
-
length2 = end -
|
|
82371
|
-
Debug.assert(
|
|
82372
|
-
Debug.assert(
|
|
82369
|
+
const end = length2 === void 0 ? content.length : start3 + length2;
|
|
82370
|
+
length2 = end - start3;
|
|
82371
|
+
Debug.assert(start3 >= 0);
|
|
82372
|
+
Debug.assert(start3 <= end);
|
|
82373
82373
|
Debug.assert(end <= content.length);
|
|
82374
|
-
if (!isJSDocLikeText(content,
|
|
82374
|
+
if (!isJSDocLikeText(content, start3)) {
|
|
82375
82375
|
return void 0;
|
|
82376
82376
|
}
|
|
82377
82377
|
let tags;
|
|
@@ -82383,13 +82383,13 @@ ${lanes.join("\n")}
|
|
|
82383
82383
|
const parts = [];
|
|
82384
82384
|
const saveParsingContext = parsingContext;
|
|
82385
82385
|
parsingContext |= 1 << 25;
|
|
82386
|
-
const result = scanner2.scanRange(
|
|
82386
|
+
const result = scanner2.scanRange(start3 + 3, length2 - 5, doJSDocScan);
|
|
82387
82387
|
parsingContext = saveParsingContext;
|
|
82388
82388
|
return result;
|
|
82389
82389
|
function doJSDocScan() {
|
|
82390
82390
|
let state = 1;
|
|
82391
82391
|
let margin;
|
|
82392
|
-
let indent3 =
|
|
82392
|
+
let indent3 = start3 - (content.lastIndexOf("\n", start3) + 1) + 4;
|
|
82393
82393
|
function pushComment(text) {
|
|
82394
82394
|
if (!margin) {
|
|
82395
82395
|
margin = indent3;
|
|
@@ -82461,7 +82461,7 @@ ${lanes.join("\n")}
|
|
|
82461
82461
|
if (!linkEnd) {
|
|
82462
82462
|
removeLeadingNewlines(comments);
|
|
82463
82463
|
}
|
|
82464
|
-
parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd ??
|
|
82464
|
+
parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd ?? start3, commentEnd));
|
|
82465
82465
|
parts.push(link);
|
|
82466
82466
|
comments = [];
|
|
82467
82467
|
linkEnd = scanner2.getTokenEnd();
|
|
@@ -82484,11 +82484,11 @@ ${lanes.join("\n")}
|
|
|
82484
82484
|
}
|
|
82485
82485
|
const trimmedComments = comments.join("").trimEnd();
|
|
82486
82486
|
if (parts.length && trimmedComments.length) {
|
|
82487
|
-
parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ??
|
|
82487
|
+
parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start3, commentsPos));
|
|
82488
82488
|
}
|
|
82489
82489
|
if (parts.length && tags) Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
|
|
82490
82490
|
const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
|
|
82491
|
-
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts,
|
|
82491
|
+
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start3, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start3, end);
|
|
82492
82492
|
}
|
|
82493
82493
|
function removeLeadingNewlines(comments2) {
|
|
82494
82494
|
while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) {
|
|
@@ -83630,15 +83630,15 @@ ${lanes.join("\n")}
|
|
|
83630
83630
|
}
|
|
83631
83631
|
function extendToAffectedRange(sourceFile, changeRange) {
|
|
83632
83632
|
const maxLookahead = 1;
|
|
83633
|
-
let
|
|
83634
|
-
for (let i2 = 0;
|
|
83635
|
-
const nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile,
|
|
83636
|
-
Debug.assert(nearestNode.pos <=
|
|
83633
|
+
let start3 = changeRange.span.start;
|
|
83634
|
+
for (let i2 = 0; start3 > 0 && i2 <= maxLookahead; i2++) {
|
|
83635
|
+
const nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start3);
|
|
83636
|
+
Debug.assert(nearestNode.pos <= start3);
|
|
83637
83637
|
const position = nearestNode.pos;
|
|
83638
|
-
|
|
83638
|
+
start3 = Math.max(0, position - 1);
|
|
83639
83639
|
}
|
|
83640
|
-
const finalSpan = createTextSpanFromBounds(
|
|
83641
|
-
const finalLength = changeRange.newLength + (changeRange.span.start -
|
|
83640
|
+
const finalSpan = createTextSpanFromBounds(start3, textSpanEnd(changeRange.span));
|
|
83641
|
+
const finalLength = changeRange.newLength + (changeRange.span.start - start3);
|
|
83642
83642
|
return createTextChangeRange(finalSpan, finalLength);
|
|
83643
83643
|
}
|
|
83644
83644
|
function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) {
|
|
@@ -85738,19 +85738,19 @@ ${lanes.join("\n")}
|
|
|
85738
85738
|
while (true) {
|
|
85739
85739
|
while (pos < text.length && text.charCodeAt(pos) <= 32) pos++;
|
|
85740
85740
|
if (pos >= text.length) break;
|
|
85741
|
-
const
|
|
85742
|
-
if (text.charCodeAt(
|
|
85741
|
+
const start3 = pos;
|
|
85742
|
+
if (text.charCodeAt(start3) === 34) {
|
|
85743
85743
|
pos++;
|
|
85744
85744
|
while (pos < text.length && text.charCodeAt(pos) !== 34) pos++;
|
|
85745
85745
|
if (pos < text.length) {
|
|
85746
|
-
args.push(text.substring(
|
|
85746
|
+
args.push(text.substring(start3 + 1, pos));
|
|
85747
85747
|
pos++;
|
|
85748
85748
|
} else {
|
|
85749
85749
|
errors.push(createCompilerDiagnostic(Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));
|
|
85750
85750
|
}
|
|
85751
85751
|
} else {
|
|
85752
85752
|
while (text.charCodeAt(pos) > 32) pos++;
|
|
85753
|
-
args.push(text.substring(
|
|
85753
|
+
args.push(text.substring(start3, pos));
|
|
85754
85754
|
}
|
|
85755
85755
|
}
|
|
85756
85756
|
parseStrings(args);
|
|
@@ -93450,7 +93450,7 @@ ${lanes.join("\n")}
|
|
|
93450
93450
|
currentFlow = reportedUnreachableFlow;
|
|
93451
93451
|
if (!options.allowUnreachableCode) {
|
|
93452
93452
|
const isError = unreachableCodeIsError(options) && !(node.flags & 33554432) && (!isVariableStatement(node) || !!(getCombinedNodeFlags(node.declarationList) & 7) || node.declarationList.declarations.some((d) => !!d.initializer));
|
|
93453
|
-
eachUnreachableRange(node, options, (
|
|
93453
|
+
eachUnreachableRange(node, options, (start3, end) => errorOrSuggestionOnRange(isError, start3, end, Diagnostics.Unreachable_code_detected));
|
|
93454
93454
|
}
|
|
93455
93455
|
}
|
|
93456
93456
|
}
|
|
@@ -93464,7 +93464,7 @@ ${lanes.join("\n")}
|
|
|
93464
93464
|
if (isStatement(node) && isExecutableStatement(node) && isBlock(node.parent)) {
|
|
93465
93465
|
const { statements } = node.parent;
|
|
93466
93466
|
const slice = sliceAfter(statements, node);
|
|
93467
|
-
getRangesWhere(slice, isExecutableStatement, (
|
|
93467
|
+
getRangesWhere(slice, isExecutableStatement, (start3, afterEnd) => cb(slice[start3], slice[afterEnd - 1]));
|
|
93468
93468
|
} else {
|
|
93469
93469
|
cb(node, node);
|
|
93470
93470
|
}
|
|
@@ -100726,7 +100726,7 @@ ${lanes.join("\n")}
|
|
|
100726
100726
|
deepCloneOrReuseNode
|
|
100727
100727
|
)), node);
|
|
100728
100728
|
}
|
|
100729
|
-
function deepCloneOrReuseNodes(nodes, visitor, test,
|
|
100729
|
+
function deepCloneOrReuseNodes(nodes, visitor, test, start3, count) {
|
|
100730
100730
|
if (nodes && nodes.length === 0) {
|
|
100731
100731
|
return setTextRange(factory.createNodeArray(
|
|
100732
100732
|
/*elements*/
|
|
@@ -100734,7 +100734,7 @@ ${lanes.join("\n")}
|
|
|
100734
100734
|
nodes.hasTrailingComma
|
|
100735
100735
|
), nodes);
|
|
100736
100736
|
}
|
|
100737
|
-
return visitNodes2(nodes, visitor, test,
|
|
100737
|
+
return visitNodes2(nodes, visitor, test, start3, count);
|
|
100738
100738
|
}
|
|
100739
100739
|
}
|
|
100740
100740
|
function createTypeNodeFromObjectType(type2) {
|
|
@@ -100853,13 +100853,13 @@ ${lanes.join("\n")}
|
|
|
100853
100853
|
if (outerTypeParameters) {
|
|
100854
100854
|
const length2 = outerTypeParameters.length;
|
|
100855
100855
|
while (i2 < length2) {
|
|
100856
|
-
const
|
|
100856
|
+
const start3 = i2;
|
|
100857
100857
|
const parent2 = getParentSymbolOfTypeParameter(outerTypeParameters[i2]);
|
|
100858
100858
|
do {
|
|
100859
100859
|
i2++;
|
|
100860
100860
|
} while (i2 < length2 && getParentSymbolOfTypeParameter(outerTypeParameters[i2]) === parent2);
|
|
100861
|
-
if (!rangeEquals(outerTypeParameters, typeArguments,
|
|
100862
|
-
const typeArgumentSlice = mapToTypeNodes(typeArguments.slice(
|
|
100861
|
+
if (!rangeEquals(outerTypeParameters, typeArguments, start3, i2)) {
|
|
100862
|
+
const typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start3, i2), context);
|
|
100863
100863
|
const restoreFlags2 = saveRestoreFlags(context);
|
|
100864
100864
|
context.flags |= 16;
|
|
100865
100865
|
const ref = symbolToTypeNode(parent2, context, 788968, typeArgumentSlice);
|
|
@@ -124189,12 +124189,12 @@ ${lanes.join("\n")}
|
|
|
124189
124189
|
scanner2.setScriptTarget(sourceFile.languageVersion);
|
|
124190
124190
|
scanner2.setLanguageVariant(sourceFile.languageVariant);
|
|
124191
124191
|
scanner2.setOnError((message, length2, arg0) => {
|
|
124192
|
-
const
|
|
124193
|
-
if (message.category === 3 && lastError &&
|
|
124194
|
-
const error310 = createDetachedDiagnostic(sourceFile.fileName, sourceFile.text,
|
|
124192
|
+
const start3 = scanner2.getTokenEnd();
|
|
124193
|
+
if (message.category === 3 && lastError && start3 === lastError.start && length2 === lastError.length) {
|
|
124194
|
+
const error310 = createDetachedDiagnostic(sourceFile.fileName, sourceFile.text, start3, length2, message, arg0);
|
|
124195
124195
|
addRelatedInfo(lastError, error310);
|
|
124196
|
-
} else if (!lastError ||
|
|
124197
|
-
lastError = createFileDiagnostic(sourceFile,
|
|
124196
|
+
} else if (!lastError || start3 !== lastError.start) {
|
|
124197
|
+
lastError = createFileDiagnostic(sourceFile, start3, length2, message, arg0);
|
|
124198
124198
|
diagnostics.add(lastError);
|
|
124199
124199
|
}
|
|
124200
124200
|
});
|
|
@@ -126892,14 +126892,14 @@ ${lanes.join("\n")}
|
|
|
126892
126892
|
}
|
|
126893
126893
|
function getDiagnosticSpanForCallNode(node) {
|
|
126894
126894
|
const sourceFile = getSourceFileOfNode(node);
|
|
126895
|
-
const { start:
|
|
126896
|
-
return { start:
|
|
126895
|
+
const { start: start3, length: length2 } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression);
|
|
126896
|
+
return { start: start3, length: length2, sourceFile };
|
|
126897
126897
|
}
|
|
126898
126898
|
function getDiagnosticForCallNode(node, message, ...args) {
|
|
126899
126899
|
if (isCallExpression(node)) {
|
|
126900
|
-
const { sourceFile, start:
|
|
126900
|
+
const { sourceFile, start: start3, length: length2 } = getDiagnosticSpanForCallNode(node);
|
|
126901
126901
|
if ("message" in message) {
|
|
126902
|
-
return createFileDiagnostic(sourceFile,
|
|
126902
|
+
return createFileDiagnostic(sourceFile, start3, length2, message, ...args);
|
|
126903
126903
|
}
|
|
126904
126904
|
return createDiagnosticForFileFromMessageChain(sourceFile, message);
|
|
126905
126905
|
} else {
|
|
@@ -127230,8 +127230,8 @@ ${lanes.join("\n")}
|
|
|
127230
127230
|
const related = [...flatMap(diags, (d) => d.relatedInformation)];
|
|
127231
127231
|
let diag2;
|
|
127232
127232
|
if (every(diags, (d) => d.start === diags[0].start && d.length === diags[0].length && d.file === diags[0].file)) {
|
|
127233
|
-
const { file: file2, start:
|
|
127234
|
-
diag2 = { file: file2, start:
|
|
127233
|
+
const { file: file2, start: start3, length: length2 } = diags[0];
|
|
127234
|
+
diag2 = { file: file2, start: start3, length: length2, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related };
|
|
127235
127235
|
} else {
|
|
127236
127236
|
diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), getErrorNodeForCallNode(node), chain, related);
|
|
127237
127237
|
}
|
|
@@ -127815,8 +127815,8 @@ ${lanes.join("\n")}
|
|
|
127815
127815
|
addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo));
|
|
127816
127816
|
}
|
|
127817
127817
|
if (isCallExpression(errorTarget.parent)) {
|
|
127818
|
-
const { start:
|
|
127819
|
-
diagnostic.start =
|
|
127818
|
+
const { start: start3, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent);
|
|
127819
|
+
diagnostic.start = start3;
|
|
127820
127820
|
diagnostic.length = length2;
|
|
127821
127821
|
}
|
|
127822
127822
|
diagnostics.add(diagnostic);
|
|
@@ -128531,9 +128531,9 @@ ${lanes.join("\n")}
|
|
|
128531
128531
|
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
|
|
128532
128532
|
}
|
|
128533
128533
|
if (compilerOptions.erasableSyntaxOnly) {
|
|
128534
|
-
const
|
|
128534
|
+
const start3 = skipTrivia(file2.text, node.pos);
|
|
128535
128535
|
const end = node.expression.pos;
|
|
128536
|
-
diagnostics.add(createFileDiagnostic(file2,
|
|
128536
|
+
diagnostics.add(createFileDiagnostic(file2, start3, end - start3, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled));
|
|
128537
128537
|
}
|
|
128538
128538
|
}
|
|
128539
128539
|
return checkAssertionWorker(node, checkMode);
|
|
@@ -129624,10 +129624,10 @@ ${lanes.join("\n")}
|
|
|
129624
129624
|
node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
129625
129625
|
);
|
|
129626
129626
|
}
|
|
129627
|
-
function getNotEqualFactsFromTypeofSwitch(
|
|
129627
|
+
function getNotEqualFactsFromTypeofSwitch(start3, end, witnesses) {
|
|
129628
129628
|
let facts = 0;
|
|
129629
129629
|
for (let i2 = 0; i2 < witnesses.length; i2++) {
|
|
129630
|
-
const witness = i2 <
|
|
129630
|
+
const witness = i2 < start3 || i2 >= end ? witnesses[i2] : void 0;
|
|
129631
129631
|
facts |= witness !== void 0 ? typeofNEFacts.get(witness) || 32768 : 0;
|
|
129632
129632
|
}
|
|
129633
129633
|
return facts;
|
|
@@ -131148,10 +131148,10 @@ ${lanes.join("\n")}
|
|
|
131148
131148
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) {
|
|
131149
131149
|
const sf = getSourceFileOfNode(left);
|
|
131150
131150
|
const sourceText = sf.text;
|
|
131151
|
-
const
|
|
131151
|
+
const start3 = skipTrivia(sourceText, left.pos);
|
|
131152
131152
|
const isInDiag2657 = sf.parseDiagnostics.some((diag2) => {
|
|
131153
131153
|
if (diag2.code !== Diagnostics.JSX_expressions_must_have_one_parent_element.code) return false;
|
|
131154
|
-
return textSpanContainsPosition(diag2,
|
|
131154
|
+
return textSpanContainsPosition(diag2, start3);
|
|
131155
131155
|
});
|
|
131156
131156
|
if (!isInDiag2657) error210(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
|
|
131157
131157
|
}
|
|
@@ -135766,9 +135766,9 @@ ${lanes.join("\n")}
|
|
|
135766
135766
|
checkExpression(node.expression);
|
|
135767
135767
|
const sourceFile = getSourceFileOfNode(node);
|
|
135768
135768
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
135769
|
-
const
|
|
135769
|
+
const start3 = getSpanOfTokenAtPosition(sourceFile, node.pos).start;
|
|
135770
135770
|
const end = node.statement.pos;
|
|
135771
|
-
grammarErrorAtPos(sourceFile,
|
|
135771
|
+
grammarErrorAtPos(sourceFile, start3, end - start3, Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);
|
|
135772
135772
|
}
|
|
135773
135773
|
}
|
|
135774
135774
|
function checkSwitchStatement(node) {
|
|
@@ -140807,9 +140807,9 @@ ${lanes.join("\n")}
|
|
|
140807
140807
|
}
|
|
140808
140808
|
function checkGrammarTypeParameterList(typeParameters, file2) {
|
|
140809
140809
|
if (typeParameters && typeParameters.length === 0) {
|
|
140810
|
-
const
|
|
140810
|
+
const start3 = typeParameters.pos - "<".length;
|
|
140811
140811
|
const end = skipTrivia(file2.text, typeParameters.end) + ">".length;
|
|
140812
|
-
return grammarErrorAtPos(file2,
|
|
140812
|
+
return grammarErrorAtPos(file2, start3, end - start3, Diagnostics.Type_parameter_list_cannot_be_empty);
|
|
140813
140813
|
}
|
|
140814
140814
|
return false;
|
|
140815
140815
|
}
|
|
@@ -140933,9 +140933,9 @@ ${lanes.join("\n")}
|
|
|
140933
140933
|
function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) {
|
|
140934
140934
|
if (typeArguments && typeArguments.length === 0) {
|
|
140935
140935
|
const sourceFile = getSourceFileOfNode(node);
|
|
140936
|
-
const
|
|
140936
|
+
const start3 = typeArguments.pos - "<".length;
|
|
140937
140937
|
const end = skipTrivia(sourceFile.text, typeArguments.end) + ">".length;
|
|
140938
|
-
return grammarErrorAtPos(sourceFile,
|
|
140938
|
+
return grammarErrorAtPos(sourceFile, start3, end - start3, Diagnostics.Type_argument_list_cannot_be_empty);
|
|
140939
140939
|
}
|
|
140940
140940
|
return false;
|
|
140941
140941
|
}
|
|
@@ -141650,10 +141650,10 @@ ${lanes.join("\n")}
|
|
|
141650
141650
|
}
|
|
141651
141651
|
return false;
|
|
141652
141652
|
}
|
|
141653
|
-
function grammarErrorAtPos(nodeForSourceFile,
|
|
141653
|
+
function grammarErrorAtPos(nodeForSourceFile, start3, length2, message, ...args) {
|
|
141654
141654
|
const sourceFile = getSourceFileOfNode(nodeForSourceFile);
|
|
141655
141655
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
141656
|
-
diagnostics.add(createFileDiagnostic(sourceFile,
|
|
141656
|
+
diagnostics.add(createFileDiagnostic(sourceFile, start3, length2, message, ...args));
|
|
141657
141657
|
return true;
|
|
141658
141658
|
}
|
|
141659
141659
|
return false;
|
|
@@ -142195,28 +142195,28 @@ ${lanes.join("\n")}
|
|
|
142195
142195
|
Debug.assertNode(visitedNode, test);
|
|
142196
142196
|
return visitedNode;
|
|
142197
142197
|
}
|
|
142198
|
-
function visitNodes2(nodes, visitor, test,
|
|
142198
|
+
function visitNodes2(nodes, visitor, test, start3, count) {
|
|
142199
142199
|
if (nodes === void 0) {
|
|
142200
142200
|
return nodes;
|
|
142201
142201
|
}
|
|
142202
142202
|
const length2 = nodes.length;
|
|
142203
|
-
if (
|
|
142204
|
-
|
|
142203
|
+
if (start3 === void 0 || start3 < 0) {
|
|
142204
|
+
start3 = 0;
|
|
142205
142205
|
}
|
|
142206
|
-
if (count === void 0 || count > length2 -
|
|
142207
|
-
count = length2 -
|
|
142206
|
+
if (count === void 0 || count > length2 - start3) {
|
|
142207
|
+
count = length2 - start3;
|
|
142208
142208
|
}
|
|
142209
142209
|
let hasTrailingComma;
|
|
142210
142210
|
let pos = -1;
|
|
142211
142211
|
let end = -1;
|
|
142212
|
-
if (
|
|
142213
|
-
hasTrailingComma = nodes.hasTrailingComma &&
|
|
142212
|
+
if (start3 > 0 || count < length2) {
|
|
142213
|
+
hasTrailingComma = nodes.hasTrailingComma && start3 + count === length2;
|
|
142214
142214
|
} else {
|
|
142215
142215
|
pos = nodes.pos;
|
|
142216
142216
|
end = nodes.end;
|
|
142217
142217
|
hasTrailingComma = nodes.hasTrailingComma;
|
|
142218
142218
|
}
|
|
142219
|
-
const updated = visitArrayWorker(nodes, visitor, test,
|
|
142219
|
+
const updated = visitArrayWorker(nodes, visitor, test, start3, count);
|
|
142220
142220
|
if (updated !== nodes) {
|
|
142221
142221
|
const updatedArray = factory.createNodeArray(updated, hasTrailingComma);
|
|
142222
142222
|
setTextRangePosEnd(updatedArray, pos, end);
|
|
@@ -142224,27 +142224,27 @@ ${lanes.join("\n")}
|
|
|
142224
142224
|
}
|
|
142225
142225
|
return nodes;
|
|
142226
142226
|
}
|
|
142227
|
-
function visitArray(nodes, visitor, test,
|
|
142227
|
+
function visitArray(nodes, visitor, test, start3, count) {
|
|
142228
142228
|
if (nodes === void 0) {
|
|
142229
142229
|
return nodes;
|
|
142230
142230
|
}
|
|
142231
142231
|
const length2 = nodes.length;
|
|
142232
|
-
if (
|
|
142233
|
-
|
|
142232
|
+
if (start3 === void 0 || start3 < 0) {
|
|
142233
|
+
start3 = 0;
|
|
142234
142234
|
}
|
|
142235
|
-
if (count === void 0 || count > length2 -
|
|
142236
|
-
count = length2 -
|
|
142235
|
+
if (count === void 0 || count > length2 - start3) {
|
|
142236
|
+
count = length2 - start3;
|
|
142237
142237
|
}
|
|
142238
|
-
return visitArrayWorker(nodes, visitor, test,
|
|
142238
|
+
return visitArrayWorker(nodes, visitor, test, start3, count);
|
|
142239
142239
|
}
|
|
142240
|
-
function visitArrayWorker(nodes, visitor, test,
|
|
142240
|
+
function visitArrayWorker(nodes, visitor, test, start3, count) {
|
|
142241
142241
|
let updated;
|
|
142242
142242
|
const length2 = nodes.length;
|
|
142243
|
-
if (
|
|
142243
|
+
if (start3 > 0 || count < length2) {
|
|
142244
142244
|
updated = [];
|
|
142245
142245
|
}
|
|
142246
142246
|
for (let i2 = 0; i2 < count; i2++) {
|
|
142247
|
-
const node = nodes[i2 +
|
|
142247
|
+
const node = nodes[i2 + start3];
|
|
142248
142248
|
const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0;
|
|
142249
142249
|
if (updated !== void 0 || visited === void 0 || visited !== node) {
|
|
142250
142250
|
if (updated === void 0) {
|
|
@@ -142270,9 +142270,9 @@ ${lanes.join("\n")}
|
|
|
142270
142270
|
Debug.assertEachNode(nodes, test);
|
|
142271
142271
|
return nodes;
|
|
142272
142272
|
}
|
|
142273
|
-
function visitLexicalEnvironment(statements, visitor, context,
|
|
142273
|
+
function visitLexicalEnvironment(statements, visitor, context, start3, ensureUseStrict, nodesVisitor = visitNodes2) {
|
|
142274
142274
|
context.startLexicalEnvironment();
|
|
142275
|
-
statements = nodesVisitor(statements, visitor, isStatement,
|
|
142275
|
+
statements = nodesVisitor(statements, visitor, isStatement, start3);
|
|
142276
142276
|
if (ensureUseStrict) statements = context.factory.ensureUseStrict(statements);
|
|
142277
142277
|
return factory.mergeLexicalEnvironment(statements, context.endLexicalEnvironment());
|
|
142278
142278
|
}
|
|
@@ -143998,7 +143998,7 @@ ${lanes.join("\n")}
|
|
|
143998
143998
|
}
|
|
143999
143999
|
exit();
|
|
144000
144000
|
}
|
|
144001
|
-
function appendSourceMap(generatedLine, generatedCharacter, map27, sourceMapPath,
|
|
144001
|
+
function appendSourceMap(generatedLine, generatedCharacter, map27, sourceMapPath, start3, end) {
|
|
144002
144002
|
Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack");
|
|
144003
144003
|
Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative");
|
|
144004
144004
|
enter();
|
|
@@ -144009,7 +144009,7 @@ ${lanes.join("\n")}
|
|
|
144009
144009
|
if (end && (raw.generatedLine > end.line || raw.generatedLine === end.line && raw.generatedCharacter > end.character)) {
|
|
144010
144010
|
break;
|
|
144011
144011
|
}
|
|
144012
|
-
if (
|
|
144012
|
+
if (start3 && (raw.generatedLine < start3.line || start3.line === raw.generatedLine && raw.generatedCharacter < start3.character)) {
|
|
144013
144013
|
continue;
|
|
144014
144014
|
}
|
|
144015
144015
|
let newSourceIndex;
|
|
@@ -144037,9 +144037,9 @@ ${lanes.join("\n")}
|
|
|
144037
144037
|
}
|
|
144038
144038
|
}
|
|
144039
144039
|
}
|
|
144040
|
-
const rawGeneratedLine = raw.generatedLine - (
|
|
144040
|
+
const rawGeneratedLine = raw.generatedLine - (start3 ? start3.line : 0);
|
|
144041
144041
|
const newGeneratedLine = rawGeneratedLine + generatedLine;
|
|
144042
|
-
const rawGeneratedCharacter =
|
|
144042
|
+
const rawGeneratedCharacter = start3 && start3.line === raw.generatedLine ? raw.generatedCharacter - start3.character : raw.generatedCharacter;
|
|
144043
144043
|
const newGeneratedCharacter = rawGeneratedLine === 0 ? rawGeneratedCharacter + generatedCharacter : rawGeneratedCharacter;
|
|
144044
144044
|
addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex);
|
|
144045
144045
|
}
|
|
@@ -144794,8 +144794,8 @@ ${lanes.join("\n")}
|
|
|
144794
144794
|
const expression = skipParentheses(statement.expression);
|
|
144795
144795
|
return isSuperCall(expression) ? expression : void 0;
|
|
144796
144796
|
}
|
|
144797
|
-
function findSuperStatementIndexPathWorker(statements,
|
|
144798
|
-
for (let i2 =
|
|
144797
|
+
function findSuperStatementIndexPathWorker(statements, start3, indices) {
|
|
144798
|
+
for (let i2 = start3; i2 < statements.length; i2 += 1) {
|
|
144799
144799
|
const statement = statements[i2];
|
|
144800
144800
|
if (getSuperCallFromStatement(statement)) {
|
|
144801
144801
|
indices.unshift(i2);
|
|
@@ -144807,9 +144807,9 @@ ${lanes.join("\n")}
|
|
|
144807
144807
|
}
|
|
144808
144808
|
return false;
|
|
144809
144809
|
}
|
|
144810
|
-
function findSuperStatementIndexPath(statements,
|
|
144810
|
+
function findSuperStatementIndexPath(statements, start3) {
|
|
144811
144811
|
const indices = [];
|
|
144812
|
-
findSuperStatementIndexPathWorker(statements,
|
|
144812
|
+
findSuperStatementIndexPathWorker(statements, start3, indices);
|
|
144813
144813
|
return indices;
|
|
144814
144814
|
}
|
|
144815
144815
|
function getProperties(node, requireInitializer, isStatic2) {
|
|
@@ -153622,9 +153622,9 @@ ${lanes.join("\n")}
|
|
|
153622
153622
|
}
|
|
153623
153623
|
return result;
|
|
153624
153624
|
}
|
|
153625
|
-
function transformAsyncFunctionBodyWorker(body,
|
|
153625
|
+
function transformAsyncFunctionBodyWorker(body, start3) {
|
|
153626
153626
|
if (isBlock(body)) {
|
|
153627
|
-
return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement,
|
|
153627
|
+
return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start3));
|
|
153628
153628
|
} else {
|
|
153629
153629
|
return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody)));
|
|
153630
153630
|
}
|
|
@@ -155945,9 +155945,9 @@ ${lanes.join("\n")}
|
|
|
155945
155945
|
}
|
|
155946
155946
|
return visitEachChild(node, visitor, context);
|
|
155947
155947
|
}
|
|
155948
|
-
function transformUsingDeclarations(statementsIn,
|
|
155948
|
+
function transformUsingDeclarations(statementsIn, start3, end, envBinding, topLevelStatements) {
|
|
155949
155949
|
const statements = [];
|
|
155950
|
-
for (let i2 =
|
|
155950
|
+
for (let i2 = start3; i2 < end; i2++) {
|
|
155951
155951
|
const statement = statementsIn[i2];
|
|
155952
155952
|
const usingKind = getUsingKind(statement);
|
|
155953
155953
|
if (usingKind) {
|
|
@@ -160332,10 +160332,10 @@ ${lanes.join("\n")}
|
|
|
160332
160332
|
}
|
|
160333
160333
|
}
|
|
160334
160334
|
}
|
|
160335
|
-
function addObjectLiteralMembers(expressions, node, receiver,
|
|
160335
|
+
function addObjectLiteralMembers(expressions, node, receiver, start3) {
|
|
160336
160336
|
const properties = node.properties;
|
|
160337
160337
|
const numProperties = properties.length;
|
|
160338
|
-
for (let i2 =
|
|
160338
|
+
for (let i2 = start3; i2 < numProperties; i2++) {
|
|
160339
160339
|
const property = properties[i2];
|
|
160340
160340
|
switch (property.kind) {
|
|
160341
160341
|
case 178:
|
|
@@ -161653,9 +161653,9 @@ ${lanes.join("\n")}
|
|
|
161653
161653
|
}
|
|
161654
161654
|
return visitEachChild(node, visitor, context);
|
|
161655
161655
|
}
|
|
161656
|
-
function transformAndEmitStatements(statements2,
|
|
161656
|
+
function transformAndEmitStatements(statements2, start3 = 0) {
|
|
161657
161657
|
const numStatements = statements2.length;
|
|
161658
|
-
for (let i2 =
|
|
161658
|
+
for (let i2 = start3; i2 < numStatements; i2++) {
|
|
161659
161659
|
transformAndEmitStatement(statements2[i2]);
|
|
161660
161660
|
}
|
|
161661
161661
|
}
|
|
@@ -162466,8 +162466,8 @@ ${lanes.join("\n")}
|
|
|
162466
162466
|
function supportsUnlabeledContinue(block) {
|
|
162467
162467
|
return block.kind === 3;
|
|
162468
162468
|
}
|
|
162469
|
-
function hasImmediateContainingLabeledBlock(labelText,
|
|
162470
|
-
for (let j =
|
|
162469
|
+
function hasImmediateContainingLabeledBlock(labelText, start3) {
|
|
162470
|
+
for (let j = start3; j >= 0; j--) {
|
|
162471
162471
|
const containingBlock = blockStack[j];
|
|
162472
162472
|
if (supportsLabeledBreakOrContinue(containingBlock)) {
|
|
162473
162473
|
if (containingBlock.labelText === labelText) {
|
|
@@ -173434,10 +173434,10 @@ ${lanes.join("\n")}
|
|
|
173434
173434
|
onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers);
|
|
173435
173435
|
let lastMode;
|
|
173436
173436
|
let mode;
|
|
173437
|
-
let
|
|
173437
|
+
let start3 = 0;
|
|
173438
173438
|
let pos = 0;
|
|
173439
173439
|
let lastModifier;
|
|
173440
|
-
while (
|
|
173440
|
+
while (start3 < modifiers.length) {
|
|
173441
173441
|
while (pos < modifiers.length) {
|
|
173442
173442
|
lastModifier = modifiers[pos];
|
|
173443
173443
|
mode = isDecorator(lastModifier) ? "decorators" : "modifiers";
|
|
@@ -173449,7 +173449,7 @@ ${lanes.join("\n")}
|
|
|
173449
173449
|
pos++;
|
|
173450
173450
|
}
|
|
173451
173451
|
const textRange = { pos: -1, end: -1 };
|
|
173452
|
-
if (
|
|
173452
|
+
if (start3 === 0) textRange.pos = modifiers.pos;
|
|
173453
173453
|
if (pos === modifiers.length - 1) textRange.end = modifiers.end;
|
|
173454
173454
|
if (lastMode === "modifiers" || allowDecorators) {
|
|
173455
173455
|
emitNodeListItems(
|
|
@@ -173459,14 +173459,14 @@ ${lanes.join("\n")}
|
|
|
173459
173459
|
lastMode === "modifiers" ? 2359808 : 2146305,
|
|
173460
173460
|
/*parenthesizerRule*/
|
|
173461
173461
|
void 0,
|
|
173462
|
-
|
|
173463
|
-
pos -
|
|
173462
|
+
start3,
|
|
173463
|
+
pos - start3,
|
|
173464
173464
|
/*hasTrailingComma*/
|
|
173465
173465
|
false,
|
|
173466
173466
|
textRange
|
|
173467
173467
|
);
|
|
173468
173468
|
}
|
|
173469
|
-
|
|
173469
|
+
start3 = pos;
|
|
173470
173470
|
lastMode = mode;
|
|
173471
173471
|
pos++;
|
|
173472
173472
|
}
|
|
@@ -173619,26 +173619,26 @@ ${lanes.join("\n")}
|
|
|
173619
173619
|
break;
|
|
173620
173620
|
}
|
|
173621
173621
|
}
|
|
173622
|
-
function emitList(parentNode, children, format, parenthesizerRule,
|
|
173622
|
+
function emitList(parentNode, children, format, parenthesizerRule, start3, count) {
|
|
173623
173623
|
emitNodeList(
|
|
173624
173624
|
emit,
|
|
173625
173625
|
parentNode,
|
|
173626
173626
|
children,
|
|
173627
173627
|
format | (parentNode && getEmitFlags(parentNode) & 2 ? 65536 : 0),
|
|
173628
173628
|
parenthesizerRule,
|
|
173629
|
-
|
|
173629
|
+
start3,
|
|
173630
173630
|
count
|
|
173631
173631
|
);
|
|
173632
173632
|
}
|
|
173633
|
-
function emitExpressionList(parentNode, children, format, parenthesizerRule,
|
|
173634
|
-
emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule,
|
|
173633
|
+
function emitExpressionList(parentNode, children, format, parenthesizerRule, start3, count) {
|
|
173634
|
+
emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start3, count);
|
|
173635
173635
|
}
|
|
173636
|
-
function emitNodeList(emit2, parentNode, children, format, parenthesizerRule,
|
|
173636
|
+
function emitNodeList(emit2, parentNode, children, format, parenthesizerRule, start3 = 0, count = children ? children.length - start3 : 0) {
|
|
173637
173637
|
const isUndefined = children === void 0;
|
|
173638
173638
|
if (isUndefined && format & 16384) {
|
|
173639
173639
|
return;
|
|
173640
173640
|
}
|
|
173641
|
-
const isEmpty = children === void 0 ||
|
|
173641
|
+
const isEmpty = children === void 0 || start3 >= children.length || count === 0;
|
|
173642
173642
|
if (isEmpty && format & 32768) {
|
|
173643
173643
|
onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children);
|
|
173644
173644
|
onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children);
|
|
@@ -173662,7 +173662,7 @@ ${lanes.join("\n")}
|
|
|
173662
173662
|
writeSpace();
|
|
173663
173663
|
}
|
|
173664
173664
|
} else {
|
|
173665
|
-
emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule,
|
|
173665
|
+
emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start3, count, children.hasTrailingComma, children);
|
|
173666
173666
|
}
|
|
173667
173667
|
onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children);
|
|
173668
173668
|
if (format & 15360) {
|
|
@@ -173672,10 +173672,10 @@ ${lanes.join("\n")}
|
|
|
173672
173672
|
writePunctuation(getClosingBracket(format));
|
|
173673
173673
|
}
|
|
173674
173674
|
}
|
|
173675
|
-
function emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule,
|
|
173675
|
+
function emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start3, count, hasTrailingComma, childrenTextRange) {
|
|
173676
173676
|
const mayEmitInterveningComments = (format & 262144) === 0;
|
|
173677
173677
|
let shouldEmitInterveningComments = mayEmitInterveningComments;
|
|
173678
|
-
const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[
|
|
173678
|
+
const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start3], format);
|
|
173679
173679
|
if (leadingLineTerminatorCount) {
|
|
173680
173680
|
writeLine(leadingLineTerminatorCount);
|
|
173681
173681
|
shouldEmitInterveningComments = false;
|
|
@@ -173689,7 +173689,7 @@ ${lanes.join("\n")}
|
|
|
173689
173689
|
let previousSibling;
|
|
173690
173690
|
let shouldDecreaseIndentAfterEmit = false;
|
|
173691
173691
|
for (let i2 = 0; i2 < count; i2++) {
|
|
173692
|
-
const child = children[
|
|
173692
|
+
const child = children[start3 + i2];
|
|
173693
173693
|
if (format & 32) {
|
|
173694
173694
|
writeLine();
|
|
173695
173695
|
writeDelimiter(format);
|
|
@@ -173753,7 +173753,7 @@ ${lanes.join("\n")}
|
|
|
173753
173753
|
if (format & 128) {
|
|
173754
173754
|
decreaseIndent();
|
|
173755
173755
|
}
|
|
173756
|
-
const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[
|
|
173756
|
+
const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start3 + count - 1], format, childrenTextRange);
|
|
173757
173757
|
if (closingLineTerminatorCount) {
|
|
173758
173758
|
writeLine(closingLineTerminatorCount);
|
|
173759
173759
|
} else if (format & (2097152 | 256)) {
|
|
@@ -175498,9 +175498,9 @@ ${lanes.join("\n")}
|
|
|
175498
175498
|
function createDirectoryWatcherWithLogging(file2, cb, flags, options, detailInfo1, detailInfo2) {
|
|
175499
175499
|
const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file2, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`;
|
|
175500
175500
|
log(watchInfo);
|
|
175501
|
-
const
|
|
175501
|
+
const start3 = timestamp();
|
|
175502
175502
|
const watcher = triggerInvokingFactory.watchDirectory(file2, cb, flags, options, detailInfo1, detailInfo2);
|
|
175503
|
-
const elapsed = timestamp() -
|
|
175503
|
+
const elapsed = timestamp() - start3;
|
|
175504
175504
|
log(`Elapsed:: ${elapsed}ms ${watchInfo}`);
|
|
175505
175505
|
return {
|
|
175506
175506
|
close: () => {
|
|
@@ -175521,13 +175521,13 @@ ${lanes.join("\n")}
|
|
|
175521
175521
|
(...args) => {
|
|
175522
175522
|
const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file2, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`;
|
|
175523
175523
|
log(triggerredInfo);
|
|
175524
|
-
const
|
|
175524
|
+
const start3 = timestamp();
|
|
175525
175525
|
cb.call(
|
|
175526
175526
|
/*thisArg*/
|
|
175527
175527
|
void 0,
|
|
175528
175528
|
...args
|
|
175529
175529
|
);
|
|
175530
|
-
const elapsed = timestamp() -
|
|
175530
|
+
const elapsed = timestamp() - start3;
|
|
175531
175531
|
log(`Elapsed:: ${elapsed}ms ${triggerredInfo}`);
|
|
175532
175532
|
},
|
|
175533
175533
|
flags,
|
|
@@ -175839,9 +175839,9 @@ ${lanes.join("\n")}
|
|
|
175839
175839
|
function formatColorAndReset(text, formatStyle) {
|
|
175840
175840
|
return formatStyle + text + resetEscapeSequence;
|
|
175841
175841
|
}
|
|
175842
|
-
function formatCodeSpan(file2,
|
|
175843
|
-
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file2,
|
|
175844
|
-
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file2,
|
|
175842
|
+
function formatCodeSpan(file2, start3, length2, indent3, squiggleColor, host) {
|
|
175843
|
+
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file2, start3);
|
|
175844
|
+
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file2, start3 + length2);
|
|
175845
175845
|
const lastLineInFile = getLineAndCharacterOfPosition(file2, file2.text.length).line;
|
|
175846
175846
|
const hasMoreThanFiveLines = lastLine - firstLine >= 4;
|
|
175847
175847
|
let gutterWidth = (lastLine + 1 + "").length;
|
|
@@ -175877,8 +175877,8 @@ ${lanes.join("\n")}
|
|
|
175877
175877
|
}
|
|
175878
175878
|
return context;
|
|
175879
175879
|
}
|
|
175880
|
-
function formatLocation(file2,
|
|
175881
|
-
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file2,
|
|
175880
|
+
function formatLocation(file2, start3, host, color = formatColorAndReset) {
|
|
175881
|
+
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file2, start3);
|
|
175882
175882
|
const relativeFileName = host ? convertToRelativePath(file2.fileName, host.getCurrentDirectory(), (fileName) => host.getCanonicalFileName(fileName)) : file2.fileName;
|
|
175883
175883
|
let output = "";
|
|
175884
175884
|
output += color(
|
|
@@ -175904,8 +175904,8 @@ ${lanes.join("\n")}
|
|
|
175904
175904
|
let output = "";
|
|
175905
175905
|
for (const diagnostic of diagnostics) {
|
|
175906
175906
|
if (diagnostic.file) {
|
|
175907
|
-
const { file: file2, start:
|
|
175908
|
-
output += formatLocation(file2,
|
|
175907
|
+
const { file: file2, start: start3 } = diagnostic;
|
|
175908
|
+
output += formatLocation(file2, start3, host);
|
|
175909
175909
|
output += " - ";
|
|
175910
175910
|
}
|
|
175911
175911
|
output += formatColorAndReset(diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
@@ -175921,11 +175921,11 @@ ${lanes.join("\n")}
|
|
|
175921
175921
|
}
|
|
175922
175922
|
if (diagnostic.relatedInformation) {
|
|
175923
175923
|
output += host.getNewLine();
|
|
175924
|
-
for (const { file: file2, start:
|
|
175924
|
+
for (const { file: file2, start: start3, length: length2, messageText } of diagnostic.relatedInformation) {
|
|
175925
175925
|
if (file2) {
|
|
175926
175926
|
output += host.getNewLine();
|
|
175927
|
-
output += halfIndent + formatLocation(file2,
|
|
175928
|
-
output += formatCodeSpan(file2,
|
|
175927
|
+
output += halfIndent + formatLocation(file2, start3, host);
|
|
175928
|
+
output += formatCodeSpan(file2, start3, length2, indent, "\x1B[96m", host);
|
|
175929
175929
|
}
|
|
175930
175930
|
output += host.getNewLine();
|
|
175931
175931
|
output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
|
|
@@ -177522,12 +177522,12 @@ ${lanes.join("\n")}
|
|
|
177522
177522
|
});
|
|
177523
177523
|
}
|
|
177524
177524
|
function markPrecedingCommentDirectiveLine(diagnostic, directives) {
|
|
177525
|
-
const { file: file2, start:
|
|
177525
|
+
const { file: file2, start: start3 } = diagnostic;
|
|
177526
177526
|
if (!file2) {
|
|
177527
177527
|
return -1;
|
|
177528
177528
|
}
|
|
177529
177529
|
const lineStarts = getLineStarts(file2);
|
|
177530
|
-
let line = computeLineAndCharacterOfPosition(lineStarts,
|
|
177530
|
+
let line = computeLineAndCharacterOfPosition(lineStarts, start3).line - 1;
|
|
177531
177531
|
while (line >= 0) {
|
|
177532
177532
|
if (directives.markUsed(line)) {
|
|
177533
177533
|
return line;
|
|
@@ -177768,8 +177768,8 @@ ${lanes.join("\n")}
|
|
|
177768
177768
|
}
|
|
177769
177769
|
}
|
|
177770
177770
|
function createDiagnosticForNodeArray2(nodes, message, ...args) {
|
|
177771
|
-
const
|
|
177772
|
-
return createFileDiagnostic(sourceFile,
|
|
177771
|
+
const start3 = nodes.pos;
|
|
177772
|
+
return createFileDiagnostic(sourceFile, start3, nodes.end - start3, message, ...args);
|
|
177773
177773
|
}
|
|
177774
177774
|
function createDiagnosticForNode2(node, message, ...args) {
|
|
177775
177775
|
return createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args);
|
|
@@ -187686,8 +187686,8 @@ ${lanes.join("\n")}
|
|
|
187686
187686
|
nonlocalNode ? visitNodesWithoutCopyingPositions : void 0
|
|
187687
187687
|
);
|
|
187688
187688
|
}
|
|
187689
|
-
function visitNodesWithoutCopyingPositions(nodes, visitor, test,
|
|
187690
|
-
let result = visitNodes2(nodes, visitor, test,
|
|
187689
|
+
function visitNodesWithoutCopyingPositions(nodes, visitor, test, start3, count) {
|
|
187690
|
+
let result = visitNodes2(nodes, visitor, test, start3, count);
|
|
187691
187691
|
if (result) {
|
|
187692
187692
|
if (result.pos !== -1 || result.end !== -1) {
|
|
187693
187693
|
if (result === nodes) {
|
|
@@ -188836,8 +188836,8 @@ ${lanes.join("\n")}
|
|
|
188836
188836
|
constructor(text) {
|
|
188837
188837
|
this.text = text;
|
|
188838
188838
|
}
|
|
188839
|
-
getText(
|
|
188840
|
-
return
|
|
188839
|
+
getText(start3, end) {
|
|
188840
|
+
return start3 === 0 && end === this.text.length ? this.text : this.text.substring(start3, end);
|
|
188841
188841
|
}
|
|
188842
188842
|
getLength() {
|
|
188843
188843
|
return this.text.length;
|
|
@@ -189561,17 +189561,17 @@ ${lanes.join("\n")}
|
|
|
189561
189561
|
function rangeContainsPositionExclusive(r2, pos) {
|
|
189562
189562
|
return r2.pos < pos && pos < r2.end;
|
|
189563
189563
|
}
|
|
189564
|
-
function rangeContainsStartEnd(range,
|
|
189565
|
-
return range.pos <=
|
|
189564
|
+
function rangeContainsStartEnd(range, start3, end) {
|
|
189565
|
+
return range.pos <= start3 && range.end >= end;
|
|
189566
189566
|
}
|
|
189567
|
-
function rangeOverlapsWithStartEnd(r1,
|
|
189568
|
-
return startEndOverlapsWithStartEnd(r1.pos, r1.end,
|
|
189567
|
+
function rangeOverlapsWithStartEnd(r1, start3, end) {
|
|
189568
|
+
return startEndOverlapsWithStartEnd(r1.pos, r1.end, start3, end);
|
|
189569
189569
|
}
|
|
189570
|
-
function nodeOverlapsWithStartEnd(node, sourceFile,
|
|
189571
|
-
return startEndOverlapsWithStartEnd(node.getStart(sourceFile), node.end,
|
|
189570
|
+
function nodeOverlapsWithStartEnd(node, sourceFile, start3, end) {
|
|
189571
|
+
return startEndOverlapsWithStartEnd(node.getStart(sourceFile), node.end, start3, end);
|
|
189572
189572
|
}
|
|
189573
|
-
function startEndOverlapsWithStartEnd(start1, end1,
|
|
189574
|
-
const start3 = Math.max(start1,
|
|
189573
|
+
function startEndOverlapsWithStartEnd(start1, end1, start22, end2) {
|
|
189574
|
+
const start3 = Math.max(start1, start22);
|
|
189575
189575
|
const end = Math.min(end1, end2);
|
|
189576
189576
|
return start3 < end;
|
|
189577
189577
|
}
|
|
@@ -189989,15 +189989,15 @@ ${lanes.join("\n")}
|
|
|
189989
189989
|
if (end < position) {
|
|
189990
189990
|
return -1;
|
|
189991
189991
|
}
|
|
189992
|
-
const
|
|
189992
|
+
const start3 = allowPositionInLeadingTrivia ? children[middle].getFullStart() : children[middle].getStart(
|
|
189993
189993
|
sourceFile,
|
|
189994
189994
|
/*includeJsDocComment*/
|
|
189995
189995
|
true
|
|
189996
189996
|
);
|
|
189997
|
-
if (
|
|
189997
|
+
if (start3 > position) {
|
|
189998
189998
|
return 1;
|
|
189999
189999
|
}
|
|
190000
|
-
if (nodeContainsPosition(children[middle],
|
|
190000
|
+
if (nodeContainsPosition(children[middle], start3, end)) {
|
|
190001
190001
|
if (children[middle - 1]) {
|
|
190002
190002
|
if (nodeContainsPosition(children[middle - 1])) {
|
|
190003
190003
|
return 1;
|
|
@@ -190005,7 +190005,7 @@ ${lanes.join("\n")}
|
|
|
190005
190005
|
}
|
|
190006
190006
|
return 0;
|
|
190007
190007
|
}
|
|
190008
|
-
if (includePrecedingTokenAtEndPosition &&
|
|
190008
|
+
if (includePrecedingTokenAtEndPosition && start3 === position && children[middle - 1] && children[middle - 1].getEnd() === position && nodeContainsPosition(children[middle - 1])) {
|
|
190009
190009
|
return 1;
|
|
190010
190010
|
}
|
|
190011
190011
|
return -1;
|
|
@@ -190019,17 +190019,17 @@ ${lanes.join("\n")}
|
|
|
190019
190019
|
}
|
|
190020
190020
|
return current;
|
|
190021
190021
|
}
|
|
190022
|
-
function nodeContainsPosition(node,
|
|
190022
|
+
function nodeContainsPosition(node, start3, end) {
|
|
190023
190023
|
end ?? (end = node.getEnd());
|
|
190024
190024
|
if (end < position) {
|
|
190025
190025
|
return false;
|
|
190026
190026
|
}
|
|
190027
|
-
|
|
190027
|
+
start3 ?? (start3 = allowPositionInLeadingTrivia ? node.getFullStart() : node.getStart(
|
|
190028
190028
|
sourceFile,
|
|
190029
190029
|
/*includeJsDocComment*/
|
|
190030
190030
|
true
|
|
190031
190031
|
));
|
|
190032
|
-
if (
|
|
190032
|
+
if (start3 > position) {
|
|
190033
190033
|
return false;
|
|
190034
190034
|
}
|
|
190035
190035
|
if (position < end || position === end && (node.kind === 1 || includeEndPosition)) {
|
|
@@ -190097,12 +190097,12 @@ ${lanes.join("\n")}
|
|
|
190097
190097
|
if (i2 >= 0 && children[i2]) {
|
|
190098
190098
|
const child = children[i2];
|
|
190099
190099
|
if (position < child.end) {
|
|
190100
|
-
const
|
|
190100
|
+
const start3 = child.getStart(
|
|
190101
190101
|
sourceFile,
|
|
190102
190102
|
/*includeJsDoc*/
|
|
190103
190103
|
!excludeJsdoc
|
|
190104
190104
|
);
|
|
190105
|
-
const lookInPreviousChild =
|
|
190105
|
+
const lookInPreviousChild = start3 >= position || // cursor in the leading trivia
|
|
190106
190106
|
!nodeHasTokens(child, sourceFile) || isWhiteSpaceOnlyJsxText(child);
|
|
190107
190107
|
if (lookInPreviousChild) {
|
|
190108
190108
|
const candidate2 = findRightmostChildNodeWithTokens(
|
|
@@ -190169,9 +190169,9 @@ ${lanes.join("\n")}
|
|
|
190169
190169
|
}
|
|
190170
190170
|
function isInString(sourceFile, position, previousToken = findPrecedingToken(position, sourceFile)) {
|
|
190171
190171
|
if (previousToken && isStringTextContainingNode(previousToken)) {
|
|
190172
|
-
const
|
|
190172
|
+
const start3 = previousToken.getStart(sourceFile);
|
|
190173
190173
|
const end = previousToken.getEnd();
|
|
190174
|
-
if (
|
|
190174
|
+
if (start3 < position && position < end) {
|
|
190175
190175
|
return true;
|
|
190176
190176
|
}
|
|
190177
190177
|
if (position === end) {
|
|
@@ -190533,8 +190533,8 @@ ${lanes.join("\n")}
|
|
|
190533
190533
|
function createTextRangeFromSpan(span) {
|
|
190534
190534
|
return createRange(span.start, span.start + span.length);
|
|
190535
190535
|
}
|
|
190536
|
-
function createTextChangeFromStartLength(
|
|
190537
|
-
return createTextChange(createTextSpan(
|
|
190536
|
+
function createTextChangeFromStartLength(start3, length2, newText) {
|
|
190537
|
+
return createTextChange(createTextSpan(start3, length2), newText);
|
|
190538
190538
|
}
|
|
190539
190539
|
function createTextChange(span, newText) {
|
|
190540
190540
|
return { span, newText };
|
|
@@ -191249,9 +191249,9 @@ ${lanes.join("\n")}
|
|
|
191249
191249
|
copyTrailingComments(sourceNode, targetNode, sourceFile);
|
|
191250
191250
|
}
|
|
191251
191251
|
function hasLeadingLineBreak(node, text) {
|
|
191252
|
-
const
|
|
191252
|
+
const start3 = node.getFullStart();
|
|
191253
191253
|
const end = node.getStart();
|
|
191254
|
-
for (let i2 =
|
|
191254
|
+
for (let i2 = start3; i2 < end; i2++) {
|
|
191255
191255
|
if (text.charCodeAt(i2) === 10) return true;
|
|
191256
191256
|
}
|
|
191257
191257
|
return false;
|
|
@@ -192282,7 +192282,7 @@ ${lanes.join("\n")}
|
|
|
192282
192282
|
));
|
|
192283
192283
|
const autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host));
|
|
192284
192284
|
if (autoImportProvider) {
|
|
192285
|
-
const
|
|
192285
|
+
const start3 = timestamp();
|
|
192286
192286
|
const checker = program2.getTypeChecker();
|
|
192287
192287
|
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, host, (module22, file2) => {
|
|
192288
192288
|
if (file2 && !program2.getSourceFile(file2.fileName) || !file2 && !checker.resolveName(
|
|
@@ -192302,7 +192302,7 @@ ${lanes.join("\n")}
|
|
|
192302
192302
|
);
|
|
192303
192303
|
}
|
|
192304
192304
|
});
|
|
192305
|
-
(_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() -
|
|
192305
|
+
(_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp() - start3}`);
|
|
192306
192306
|
}
|
|
192307
192307
|
}
|
|
192308
192308
|
function getIsExcludedPatterns(preferences, useCaseSensitiveFileNames2) {
|
|
@@ -192357,7 +192357,7 @@ ${lanes.join("\n")}
|
|
|
192357
192357
|
}
|
|
192358
192358
|
function getExportInfoMap(importingFile, host, program2, preferences, cancellationToken) {
|
|
192359
192359
|
var _a2, _b, _c, _d, _e;
|
|
192360
|
-
const
|
|
192360
|
+
const start3 = timestamp();
|
|
192361
192361
|
(_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host);
|
|
192362
192362
|
const cache = ((_b = host.getCachedExportInfoMap) == null ? void 0 : _b.call(host)) || createCacheableExportInfoMap({
|
|
192363
192363
|
getCurrentProgram: () => program2,
|
|
@@ -192420,7 +192420,7 @@ ${lanes.join("\n")}
|
|
|
192420
192420
|
cache.clear();
|
|
192421
192421
|
throw err;
|
|
192422
192422
|
}
|
|
192423
|
-
(_e = host.log) == null ? void 0 : _e.call(host, `getExportInfoMap: done in ${timestamp() -
|
|
192423
|
+
(_e = host.log) == null ? void 0 : _e.call(host, `getExportInfoMap: done in ${timestamp() - start3} ms`);
|
|
192424
192424
|
return cache;
|
|
192425
192425
|
}
|
|
192426
192426
|
function getDefaultLikeExportInfo(moduleSymbol, checker) {
|
|
@@ -192656,16 +192656,16 @@ ${lanes.join("\n")}
|
|
|
192656
192656
|
return lastOnTemplateStack === 16 ? 6 : void 0;
|
|
192657
192657
|
}
|
|
192658
192658
|
}
|
|
192659
|
-
function pushEncodedClassification(
|
|
192659
|
+
function pushEncodedClassification(start3, end, offset, classification, result) {
|
|
192660
192660
|
if (classification === 8) {
|
|
192661
192661
|
return;
|
|
192662
192662
|
}
|
|
192663
|
-
if (
|
|
192664
|
-
|
|
192663
|
+
if (start3 === 0 && offset > 0) {
|
|
192664
|
+
start3 += offset;
|
|
192665
192665
|
}
|
|
192666
|
-
const length2 = end -
|
|
192666
|
+
const length2 = end - start3;
|
|
192667
192667
|
if (length2 > 0) {
|
|
192668
|
-
result.push(
|
|
192668
|
+
result.push(start3 - offset, length2, classification);
|
|
192669
192669
|
}
|
|
192670
192670
|
}
|
|
192671
192671
|
function convertClassificationsToResult(classifications, text) {
|
|
@@ -192673,11 +192673,11 @@ ${lanes.join("\n")}
|
|
|
192673
192673
|
const dense = classifications.spans;
|
|
192674
192674
|
let lastEnd = 0;
|
|
192675
192675
|
for (let i2 = 0; i2 < dense.length; i2 += 3) {
|
|
192676
|
-
const
|
|
192676
|
+
const start3 = dense[i2];
|
|
192677
192677
|
const length2 = dense[i2 + 1];
|
|
192678
192678
|
const type = dense[i2 + 2];
|
|
192679
192679
|
if (lastEnd >= 0) {
|
|
192680
|
-
const whitespaceLength2 =
|
|
192680
|
+
const whitespaceLength2 = start3 - lastEnd;
|
|
192681
192681
|
if (whitespaceLength2 > 0) {
|
|
192682
192682
|
entries.push({
|
|
192683
192683
|
length: whitespaceLength2,
|
|
@@ -192687,7 +192687,7 @@ ${lanes.join("\n")}
|
|
|
192687
192687
|
}
|
|
192688
192688
|
}
|
|
192689
192689
|
entries.push({ length: length2, classification: convertClassification(type) });
|
|
192690
|
-
lastEnd =
|
|
192690
|
+
lastEnd = start3 + length2;
|
|
192691
192691
|
}
|
|
192692
192692
|
const whitespaceLength = text.length - lastEnd;
|
|
192693
192693
|
if (whitespaceLength > 0) {
|
|
@@ -192897,10 +192897,10 @@ ${lanes.join("\n")}
|
|
|
192897
192897
|
endOfLineState: 0
|
|
192898
192898
|
/* None */
|
|
192899
192899
|
};
|
|
192900
|
-
function pushClassification(
|
|
192901
|
-
const length2 = end -
|
|
192900
|
+
function pushClassification(start3, end, type) {
|
|
192901
|
+
const length2 = end - start3;
|
|
192902
192902
|
Debug.assert(length2 > 0, `Classification had non-positive length of ${length2}`);
|
|
192903
|
-
spans.push(
|
|
192903
|
+
spans.push(start3);
|
|
192904
192904
|
spans.push(length2);
|
|
192905
192905
|
spans.push(type);
|
|
192906
192906
|
}
|
|
@@ -193025,23 +193025,23 @@ ${lanes.join("\n")}
|
|
|
193025
193025
|
endOfLineState: 0
|
|
193026
193026
|
/* None */
|
|
193027
193027
|
};
|
|
193028
|
-
function pushClassification(
|
|
193029
|
-
result.push(
|
|
193028
|
+
function pushClassification(start3, length2, type) {
|
|
193029
|
+
result.push(start3);
|
|
193030
193030
|
result.push(length2);
|
|
193031
193031
|
result.push(type);
|
|
193032
193032
|
}
|
|
193033
193033
|
function classifyLeadingTriviaAndGetTokenStart(token) {
|
|
193034
193034
|
triviaScanner.resetTokenState(token.pos);
|
|
193035
193035
|
while (true) {
|
|
193036
|
-
const
|
|
193037
|
-
if (!couldStartTrivia(sourceFile.text,
|
|
193038
|
-
return
|
|
193036
|
+
const start3 = triviaScanner.getTokenEnd();
|
|
193037
|
+
if (!couldStartTrivia(sourceFile.text, start3)) {
|
|
193038
|
+
return start3;
|
|
193039
193039
|
}
|
|
193040
193040
|
const kind = triviaScanner.scan();
|
|
193041
193041
|
const end = triviaScanner.getTokenEnd();
|
|
193042
|
-
const width = end -
|
|
193042
|
+
const width = end - start3;
|
|
193043
193043
|
if (!isTrivia(kind)) {
|
|
193044
|
-
return
|
|
193044
|
+
return start3;
|
|
193045
193045
|
}
|
|
193046
193046
|
switch (kind) {
|
|
193047
193047
|
case 4:
|
|
@@ -193049,15 +193049,15 @@ ${lanes.join("\n")}
|
|
|
193049
193049
|
continue;
|
|
193050
193050
|
case 2:
|
|
193051
193051
|
case 3:
|
|
193052
|
-
classifyComment(token, kind,
|
|
193052
|
+
classifyComment(token, kind, start3, width);
|
|
193053
193053
|
triviaScanner.resetTokenState(end);
|
|
193054
193054
|
continue;
|
|
193055
193055
|
case 7:
|
|
193056
193056
|
const text = sourceFile.text;
|
|
193057
|
-
const ch = text.charCodeAt(
|
|
193057
|
+
const ch = text.charCodeAt(start3);
|
|
193058
193058
|
if (ch === 60 || ch === 62) {
|
|
193059
193059
|
pushClassification(
|
|
193060
|
-
|
|
193060
|
+
start3,
|
|
193061
193061
|
width,
|
|
193062
193062
|
1
|
|
193063
193063
|
/* comment */
|
|
@@ -193068,7 +193068,7 @@ ${lanes.join("\n")}
|
|
|
193068
193068
|
ch === 124 || ch === 61
|
|
193069
193069
|
/* equals */
|
|
193070
193070
|
);
|
|
193071
|
-
classifyDisabledMergeCode(text,
|
|
193071
|
+
classifyDisabledMergeCode(text, start3, end);
|
|
193072
193072
|
break;
|
|
193073
193073
|
case 6:
|
|
193074
193074
|
break;
|
|
@@ -193077,24 +193077,24 @@ ${lanes.join("\n")}
|
|
|
193077
193077
|
}
|
|
193078
193078
|
}
|
|
193079
193079
|
}
|
|
193080
|
-
function classifyComment(token, kind,
|
|
193080
|
+
function classifyComment(token, kind, start3, width) {
|
|
193081
193081
|
if (kind === 3) {
|
|
193082
|
-
const docCommentAndDiagnostics = parseIsolatedJSDocComment(sourceFile.text,
|
|
193082
|
+
const docCommentAndDiagnostics = parseIsolatedJSDocComment(sourceFile.text, start3, width);
|
|
193083
193083
|
if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDoc) {
|
|
193084
193084
|
setParent(docCommentAndDiagnostics.jsDoc, token);
|
|
193085
193085
|
classifyJSDocComment(docCommentAndDiagnostics.jsDoc);
|
|
193086
193086
|
return;
|
|
193087
193087
|
}
|
|
193088
193088
|
} else if (kind === 2) {
|
|
193089
|
-
if (tryClassifyTripleSlashComment(
|
|
193089
|
+
if (tryClassifyTripleSlashComment(start3, width)) {
|
|
193090
193090
|
return;
|
|
193091
193091
|
}
|
|
193092
193092
|
}
|
|
193093
|
-
pushCommentRange(
|
|
193093
|
+
pushCommentRange(start3, width);
|
|
193094
193094
|
}
|
|
193095
|
-
function pushCommentRange(
|
|
193095
|
+
function pushCommentRange(start3, width) {
|
|
193096
193096
|
pushClassification(
|
|
193097
|
-
|
|
193097
|
+
start3,
|
|
193098
193098
|
width,
|
|
193099
193099
|
1
|
|
193100
193100
|
/* comment */
|
|
@@ -193210,10 +193210,10 @@ ${lanes.join("\n")}
|
|
|
193210
193210
|
}
|
|
193211
193211
|
}
|
|
193212
193212
|
}
|
|
193213
|
-
function tryClassifyTripleSlashComment(
|
|
193213
|
+
function tryClassifyTripleSlashComment(start3, width) {
|
|
193214
193214
|
const tripleSlashXMLCommentRegEx = /^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/m;
|
|
193215
193215
|
const attributeRegex = /(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/g;
|
|
193216
|
-
const text = sourceFile.text.substr(
|
|
193216
|
+
const text = sourceFile.text.substr(start3, width);
|
|
193217
193217
|
const match = tripleSlashXMLCommentRegEx.exec(text);
|
|
193218
193218
|
if (!match) {
|
|
193219
193219
|
return false;
|
|
@@ -193221,7 +193221,7 @@ ${lanes.join("\n")}
|
|
|
193221
193221
|
if (!match[3] || !(match[3] in commentPragmas)) {
|
|
193222
193222
|
return false;
|
|
193223
193223
|
}
|
|
193224
|
-
let pos =
|
|
193224
|
+
let pos = start3;
|
|
193225
193225
|
pushCommentRange(pos, match[1].length);
|
|
193226
193226
|
pos += match[1].length;
|
|
193227
193227
|
pushClassification(
|
|
@@ -193293,7 +193293,7 @@ ${lanes.join("\n")}
|
|
|
193293
193293
|
);
|
|
193294
193294
|
pos += match[5].length;
|
|
193295
193295
|
}
|
|
193296
|
-
const end =
|
|
193296
|
+
const end = start3 + width;
|
|
193297
193297
|
if (pos < end) {
|
|
193298
193298
|
pushCommentRange(pos, end - pos);
|
|
193299
193299
|
}
|
|
@@ -193304,16 +193304,16 @@ ${lanes.join("\n")}
|
|
|
193304
193304
|
processElement(child);
|
|
193305
193305
|
}
|
|
193306
193306
|
}
|
|
193307
|
-
function classifyDisabledMergeCode(text,
|
|
193307
|
+
function classifyDisabledMergeCode(text, start3, end) {
|
|
193308
193308
|
let i2;
|
|
193309
|
-
for (i2 =
|
|
193309
|
+
for (i2 = start3; i2 < end; i2++) {
|
|
193310
193310
|
if (isLineBreak(text.charCodeAt(i2))) {
|
|
193311
193311
|
break;
|
|
193312
193312
|
}
|
|
193313
193313
|
}
|
|
193314
193314
|
pushClassification(
|
|
193315
|
-
|
|
193316
|
-
i2 -
|
|
193315
|
+
start3,
|
|
193316
|
+
i2 - start3,
|
|
193317
193317
|
1
|
|
193318
193318
|
/* comment */
|
|
193319
193319
|
);
|
|
@@ -193323,12 +193323,12 @@ ${lanes.join("\n")}
|
|
|
193323
193323
|
}
|
|
193324
193324
|
}
|
|
193325
193325
|
function classifyDisabledCodeToken() {
|
|
193326
|
-
const
|
|
193326
|
+
const start3 = mergeConflictScanner.getTokenEnd();
|
|
193327
193327
|
const tokenKind = mergeConflictScanner.scan();
|
|
193328
193328
|
const end = mergeConflictScanner.getTokenEnd();
|
|
193329
193329
|
const type = classifyTokenType(tokenKind);
|
|
193330
193330
|
if (type) {
|
|
193331
|
-
pushClassification(
|
|
193331
|
+
pushClassification(start3, end - start3, type);
|
|
193332
193332
|
}
|
|
193333
193333
|
}
|
|
193334
193334
|
function tryClassifyNode(node) {
|
|
@@ -194569,9 +194569,9 @@ ${lanes.join("\n")}
|
|
|
194569
194569
|
}
|
|
194570
194570
|
function indexOfIgnoringCase(str2, value) {
|
|
194571
194571
|
const n = str2.length - value.length;
|
|
194572
|
-
for (let
|
|
194573
|
-
if (every2(value, (valueChar, i2) => toLowerCase2(str2.charCodeAt(i2 +
|
|
194574
|
-
return
|
|
194572
|
+
for (let start3 = 0; start3 <= n; start3++) {
|
|
194573
|
+
if (every2(value, (valueChar, i2) => toLowerCase2(str2.charCodeAt(i2 + start3)) === valueChar)) {
|
|
194574
|
+
return start3;
|
|
194575
194575
|
}
|
|
194576
194576
|
}
|
|
194577
194577
|
return -1;
|
|
@@ -194686,8 +194686,8 @@ ${lanes.join("\n")}
|
|
|
194686
194686
|
}
|
|
194687
194687
|
return false;
|
|
194688
194688
|
}
|
|
194689
|
-
function isAllPunctuation(identifier,
|
|
194690
|
-
return every2(identifier, (ch) => charIsPunctuation(ch) && ch !== 95,
|
|
194689
|
+
function isAllPunctuation(identifier, start3, end) {
|
|
194690
|
+
return every2(identifier, (ch) => charIsPunctuation(ch) && ch !== 95, start3, end);
|
|
194691
194691
|
}
|
|
194692
194692
|
function transitionFromUpperToLower(identifier, index, wordStart) {
|
|
194693
194693
|
return index !== wordStart && index + 1 < identifier.length && isUpperCaseLetter(identifier.charCodeAt(index)) && isLowerCaseLetter(identifier.charCodeAt(index + 1)) && every2(identifier, isUpperCaseLetter, wordStart, index);
|
|
@@ -194697,16 +194697,16 @@ ${lanes.join("\n")}
|
|
|
194697
194697
|
const currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index));
|
|
194698
194698
|
return currentIsUpper && (!word || !lastIsUpper);
|
|
194699
194699
|
}
|
|
194700
|
-
function everyInRange(
|
|
194701
|
-
for (let i2 =
|
|
194700
|
+
function everyInRange(start3, end, pred) {
|
|
194701
|
+
for (let i2 = start3; i2 < end; i2++) {
|
|
194702
194702
|
if (!pred(i2)) {
|
|
194703
194703
|
return false;
|
|
194704
194704
|
}
|
|
194705
194705
|
}
|
|
194706
194706
|
return true;
|
|
194707
194707
|
}
|
|
194708
|
-
function every2(s2, pred,
|
|
194709
|
-
return everyInRange(
|
|
194708
|
+
function every2(s2, pred, start3 = 0, end = s2.length) {
|
|
194709
|
+
return everyInRange(start3, end, (i2) => pred(s2.charCodeAt(i2), i2));
|
|
194710
194710
|
}
|
|
194711
194711
|
function preProcessFile(sourceText, readImportFiles = true, detectJavaScriptImports = false) {
|
|
194712
194712
|
const pragmaContext = {
|
|
@@ -197930,9 +197930,9 @@ interface Symbol {
|
|
|
197930
197930
|
const all = [];
|
|
197931
197931
|
const ranges = [];
|
|
197932
197932
|
const { toMove, afterLast } = rangeToMove;
|
|
197933
|
-
getRangesWhere(toMove, isAllowedStatementToMove, (
|
|
197934
|
-
for (let i2 =
|
|
197935
|
-
ranges.push({ first: toMove[
|
|
197933
|
+
getRangesWhere(toMove, isAllowedStatementToMove, (start3, afterEndIndex) => {
|
|
197934
|
+
for (let i2 = start3; i2 < afterEndIndex; i2++) all.push(toMove[i2]);
|
|
197935
|
+
ranges.push({ first: toMove[start3], afterLast });
|
|
197936
197936
|
});
|
|
197937
197937
|
return all.length === 0 ? void 0 : { all, ranges };
|
|
197938
197938
|
}
|
|
@@ -198184,8 +198184,8 @@ interface Symbol {
|
|
|
198184
198184
|
const lastDecl = declarations[length(declarations) - 1];
|
|
198185
198185
|
const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
|
|
198186
198186
|
const end = findIndex(sourceFile.statements, (s2) => s2.end >= lastDecl.end);
|
|
198187
|
-
const
|
|
198188
|
-
return { toMove: statementsToMove, start:
|
|
198187
|
+
const start3 = findIndex(sourceFile.statements, (s2) => s2.end >= firstDecl.end);
|
|
198188
|
+
return { toMove: statementsToMove, start: start3, end };
|
|
198189
198189
|
}
|
|
198190
198190
|
return void 0;
|
|
198191
198191
|
}
|
|
@@ -200230,26 +200230,26 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200230
200230
|
const startToken = findFirstNonJsxWhitespaceToken(sourceFile, span.start);
|
|
200231
200231
|
const endToken = findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span));
|
|
200232
200232
|
const adjustedSpan = startToken && endToken && invoked ? getAdjustedSpanFromNodes(startToken, endToken, sourceFile) : span;
|
|
200233
|
-
const
|
|
200234
|
-
const end = cursorRequest ?
|
|
200233
|
+
const start3 = cursorRequest ? getExtractableParent(startToken) : getParentNodeInSpan(startToken, sourceFile, adjustedSpan);
|
|
200234
|
+
const end = cursorRequest ? start3 : getParentNodeInSpan(endToken, sourceFile, adjustedSpan);
|
|
200235
200235
|
let rangeFacts = 0;
|
|
200236
200236
|
let thisNode;
|
|
200237
|
-
if (!
|
|
200237
|
+
if (!start3 || !end) {
|
|
200238
200238
|
return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] };
|
|
200239
200239
|
}
|
|
200240
|
-
if (
|
|
200240
|
+
if (start3.flags & 16777216) {
|
|
200241
200241
|
return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractJSDoc)] };
|
|
200242
200242
|
}
|
|
200243
|
-
if (
|
|
200243
|
+
if (start3.parent !== end.parent) {
|
|
200244
200244
|
return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] };
|
|
200245
200245
|
}
|
|
200246
|
-
if (
|
|
200247
|
-
if (!isBlockLike(
|
|
200246
|
+
if (start3 !== end) {
|
|
200247
|
+
if (!isBlockLike(start3.parent)) {
|
|
200248
200248
|
return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] };
|
|
200249
200249
|
}
|
|
200250
200250
|
const statements = [];
|
|
200251
|
-
for (const statement of
|
|
200252
|
-
if (statement ===
|
|
200251
|
+
for (const statement of start3.parent.statements) {
|
|
200252
|
+
if (statement === start3 || statements.length) {
|
|
200253
200253
|
const errors2 = checkNode(statement);
|
|
200254
200254
|
if (errors2) {
|
|
200255
200255
|
return { errors: errors2 };
|
|
@@ -200265,10 +200265,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200265
200265
|
}
|
|
200266
200266
|
return { targetRange: { range: statements, facts: rangeFacts, thisNode } };
|
|
200267
200267
|
}
|
|
200268
|
-
if (isReturnStatement(
|
|
200268
|
+
if (isReturnStatement(start3) && !start3.expression) {
|
|
200269
200269
|
return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages.cannotExtractRange)] };
|
|
200270
200270
|
}
|
|
200271
|
-
const node = refineNode(
|
|
200271
|
+
const node = refineNode(start3);
|
|
200272
200272
|
const errors = checkRootNode(node) || checkNode(node);
|
|
200273
200273
|
if (errors) {
|
|
200274
200274
|
return { errors };
|
|
@@ -200500,12 +200500,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
200500
200500
|
}
|
|
200501
200501
|
}
|
|
200502
200502
|
function getAdjustedSpanFromNodes(startNode2, endNode2, sourceFile) {
|
|
200503
|
-
const
|
|
200503
|
+
const start3 = startNode2.getStart(sourceFile);
|
|
200504
200504
|
let end = endNode2.getEnd();
|
|
200505
200505
|
if (sourceFile.text.charCodeAt(end) === 59) {
|
|
200506
200506
|
end++;
|
|
200507
200507
|
}
|
|
200508
|
-
return { start:
|
|
200508
|
+
return { start: start3, length: end - start3 };
|
|
200509
200509
|
}
|
|
200510
200510
|
function getStatementOrExpressionRange(node) {
|
|
200511
200511
|
if (isStatement(node)) {
|
|
@@ -201413,9 +201413,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
201413
201413
|
let expressionDiagnostic;
|
|
201414
201414
|
if (expression === void 0) {
|
|
201415
201415
|
const statements = targetRange.range;
|
|
201416
|
-
const
|
|
201416
|
+
const start3 = first2(statements).getStart();
|
|
201417
201417
|
const end = last(statements).end;
|
|
201418
|
-
expressionDiagnostic = createFileDiagnostic(sourceFile,
|
|
201418
|
+
expressionDiagnostic = createFileDiagnostic(sourceFile, start3, end - start3, Messages.expressionExpected);
|
|
201419
201419
|
} else if (checker.getTypeAtLocation(expression).flags & (16384 | 131072)) {
|
|
201420
201420
|
expressionDiagnostic = createDiagnosticForNode(expression, Messages.uselessConstantType);
|
|
201421
201421
|
}
|
|
@@ -203877,18 +203877,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
203877
203877
|
return match ? [createTextSpanFromNode(token, sourceFile), createTextSpanFromNode(match, sourceFile)].sort((a, b) => a.start - b.start) : emptyArray;
|
|
203878
203878
|
}
|
|
203879
203879
|
function getIndentationAtPosition(fileName, position, editorOptions) {
|
|
203880
|
-
let
|
|
203880
|
+
let start3 = timestamp();
|
|
203881
203881
|
const settings = toEditorSettings(editorOptions);
|
|
203882
203882
|
const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
|
|
203883
|
-
log("getIndentationAtPosition: getCurrentSourceFile: " + (timestamp() -
|
|
203884
|
-
|
|
203883
|
+
log("getIndentationAtPosition: getCurrentSourceFile: " + (timestamp() - start3));
|
|
203884
|
+
start3 = timestamp();
|
|
203885
203885
|
const result = ts_formatting_exports.SmartIndenter.getIndentation(position, sourceFile, settings);
|
|
203886
|
-
log("getIndentationAtPosition: computeIndentation : " + (timestamp() -
|
|
203886
|
+
log("getIndentationAtPosition: computeIndentation : " + (timestamp() - start3));
|
|
203887
203887
|
return result;
|
|
203888
203888
|
}
|
|
203889
|
-
function getFormattingEditsForRange(fileName,
|
|
203889
|
+
function getFormattingEditsForRange(fileName, start3, end, options) {
|
|
203890
203890
|
const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
|
|
203891
|
-
return ts_formatting_exports.formatSelection(
|
|
203891
|
+
return ts_formatting_exports.formatSelection(start3, end, sourceFile, ts_formatting_exports.getFormatContext(toEditorSettings(options), host));
|
|
203892
203892
|
}
|
|
203893
203893
|
function getFormattingEditsForDocument(fileName, options) {
|
|
203894
203894
|
return ts_formatting_exports.formatDocument(syntaxTreeCache.getCurrentSourceFile(fileName), ts_formatting_exports.getFormatContext(toEditorSettings(options), host));
|
|
@@ -203910,10 +203910,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
203910
203910
|
}
|
|
203911
203911
|
return [];
|
|
203912
203912
|
}
|
|
203913
|
-
function getCodeFixesAtPosition(fileName,
|
|
203913
|
+
function getCodeFixesAtPosition(fileName, start3, end, errorCodes68, formatOptions, preferences = emptyOptions) {
|
|
203914
203914
|
synchronizeHostData();
|
|
203915
203915
|
const sourceFile = getValidSourceFile(fileName);
|
|
203916
|
-
const span = createTextSpanFromBounds(
|
|
203916
|
+
const span = createTextSpanFromBounds(start3, end);
|
|
203917
203917
|
const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
|
|
203918
203918
|
return flatMap(deduplicate(errorCodes68, equateValues, compareValues), (errorCode) => {
|
|
203919
203919
|
cancellationToken.throwIfCancellationRequested();
|
|
@@ -204617,8 +204617,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
204617
204617
|
return spanInNode(tokenAtLocation);
|
|
204618
204618
|
function textSpan(startNode2, endNode2) {
|
|
204619
204619
|
const lastDecorator = canHaveDecorators(startNode2) ? findLast(startNode2.modifiers, isDecorator) : void 0;
|
|
204620
|
-
const
|
|
204621
|
-
return createTextSpanFromBounds(
|
|
204620
|
+
const start3 = lastDecorator ? skipTrivia(sourceFile.text, lastDecorator.end) : startNode2.getStart(sourceFile);
|
|
204621
|
+
return createTextSpanFromBounds(start3, (endNode2 || startNode2).getEnd());
|
|
204622
204622
|
}
|
|
204623
204623
|
function textSpanEndingAtNextToken(startNode2, previousTokenToFindNextEndToken) {
|
|
204624
204624
|
return textSpan(startNode2, findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent, sourceFile));
|
|
@@ -204633,11 +204633,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
204633
204633
|
if (nodeArray) {
|
|
204634
204634
|
const index = nodeArray.indexOf(node);
|
|
204635
204635
|
if (index >= 0) {
|
|
204636
|
-
let
|
|
204636
|
+
let start3 = index;
|
|
204637
204637
|
let end = index + 1;
|
|
204638
|
-
while (
|
|
204638
|
+
while (start3 > 0 && match(nodeArray[start3 - 1])) start3--;
|
|
204639
204639
|
while (end < nodeArray.length && match(nodeArray[end])) end++;
|
|
204640
|
-
return createTextSpanFromBounds(skipTrivia(sourceFile.text, nodeArray[
|
|
204640
|
+
return createTextSpanFromBounds(skipTrivia(sourceFile.text, nodeArray[start3].pos), nodeArray[end - 1].end);
|
|
204641
204641
|
}
|
|
204642
204642
|
}
|
|
204643
204643
|
return textSpan(node);
|
|
@@ -205819,7 +205819,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
205819
205819
|
return decl;
|
|
205820
205820
|
}
|
|
205821
205821
|
function getIsMatchingAsyncError(span, errorCode) {
|
|
205822
|
-
return ({ start:
|
|
205822
|
+
return ({ start: start3, length: length2, relatedInformation, code }) => isNumber(start3) && isNumber(length2) && textSpansEqual({ start: start3, length: length2 }, span) && code === errorCode && !!relatedInformation && some(relatedInformation, (related) => related.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code);
|
|
205823
205823
|
}
|
|
205824
205824
|
var fixId3 = "addMissingAwait";
|
|
205825
205825
|
var propertyAccessCode = Diagnostics.Property_0_does_not_exist_on_type_1.code;
|
|
@@ -205904,7 +205904,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
205904
205904
|
function isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program2) {
|
|
205905
205905
|
const checker = program2.getTypeChecker();
|
|
205906
205906
|
const diagnostics = checker.getDiagnostics(sourceFile, cancellationToken);
|
|
205907
|
-
return some(diagnostics, ({ start:
|
|
205907
|
+
return some(diagnostics, ({ start: start3, length: length2, relatedInformation, code }) => isNumber(start3) && isNumber(length2) && textSpansEqual({ start: start3, length: length2 }, span) && code === errorCode && !!relatedInformation && some(relatedInformation, (related) => related.code === Diagnostics.Did_you_forget_to_use_await.code));
|
|
205908
205908
|
}
|
|
205909
205909
|
function findAwaitableInitializers(expression, sourceFile, cancellationToken, program2, checker) {
|
|
205910
205910
|
const identifiers = getIdentifiersFromErrorSpanExpression(expression, checker);
|
|
@@ -206281,8 +206281,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
206281
206281
|
fixIds: [fixId8],
|
|
206282
206282
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes8, (changes, diag2) => makeChange8(changes, diag2.file, diag2.start))
|
|
206283
206283
|
});
|
|
206284
|
-
function makeChange8(changeTracker, sourceFile,
|
|
206285
|
-
const token = getTokenAtPosition(sourceFile,
|
|
206284
|
+
function makeChange8(changeTracker, sourceFile, start3) {
|
|
206285
|
+
const token = getTokenAtPosition(sourceFile, start3);
|
|
206286
206286
|
const param = token.parent;
|
|
206287
206287
|
if (!isParameter(param)) {
|
|
206288
206288
|
return Debug.fail("Tried to add a parameter name to a non-parameter: " + Debug.formatSyntaxKind(token.kind));
|
|
@@ -210582,12 +210582,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
210582
210582
|
},
|
|
210583
210583
|
fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId],
|
|
210584
210584
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes21, (changes, diag2) => {
|
|
210585
|
-
const { code, start:
|
|
210585
|
+
const { code, start: start3 } = diag2;
|
|
210586
210586
|
const info = errorCodeFixIdMap[code];
|
|
210587
210587
|
if (!info || info.fixId !== context.fixId) {
|
|
210588
210588
|
return;
|
|
210589
210589
|
}
|
|
210590
|
-
dispatchChanges(changes, context, code,
|
|
210590
|
+
dispatchChanges(changes, context, code, start3);
|
|
210591
210591
|
})
|
|
210592
210592
|
});
|
|
210593
210593
|
function dispatchChanges(changeTracker, context, errorCode, pos) {
|
|
@@ -211086,8 +211086,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
211086
211086
|
errorCodes: errorCodes27,
|
|
211087
211087
|
fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen],
|
|
211088
211088
|
getCodeActions: function getCodeActionsToCorrectReturnValue(context) {
|
|
211089
|
-
const { program: program2, sourceFile, span: { start:
|
|
211090
|
-
const info = getInfo9(program2.getTypeChecker(), sourceFile,
|
|
211089
|
+
const { program: program2, sourceFile, span: { start: start3 }, errorCode } = context;
|
|
211090
|
+
const info = getInfo9(program2.getTypeChecker(), sourceFile, start3, errorCode);
|
|
211091
211091
|
if (!info) return void 0;
|
|
211092
211092
|
if (info.kind === 0) {
|
|
211093
211093
|
return append(
|
|
@@ -212296,8 +212296,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212296
212296
|
registerCodeFix({
|
|
212297
212297
|
errorCodes: errorCodes31,
|
|
212298
212298
|
getCodeActions: function getCodeActionsToFixNotFoundModule(context) {
|
|
212299
|
-
const { host, sourceFile, span: { start:
|
|
212300
|
-
const packageName = errorCode === errorCannotFindImplicitJsxImport ? getJSXImplicitImportBase(context.program.getCompilerOptions(), sourceFile) : tryGetImportedPackageName(sourceFile,
|
|
212299
|
+
const { host, sourceFile, span: { start: start3 }, errorCode } = context;
|
|
212300
|
+
const packageName = errorCode === errorCannotFindImplicitJsxImport ? getJSXImplicitImportBase(context.program.getCompilerOptions(), sourceFile) : tryGetImportedPackageName(sourceFile, start3);
|
|
212301
212301
|
if (packageName === void 0) return void 0;
|
|
212302
212302
|
const typesPackageName = getTypesPackageNameToInstall(packageName, host, errorCode);
|
|
212303
212303
|
return typesPackageName === void 0 ? [] : [createCodeFixAction(
|
|
@@ -212715,13 +212715,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212715
212715
|
function isValidCharacter(character) {
|
|
212716
212716
|
return hasProperty(htmlEntity, character);
|
|
212717
212717
|
}
|
|
212718
|
-
function doChange26(changes, preferences, sourceFile,
|
|
212719
|
-
const character = sourceFile.getText()[
|
|
212718
|
+
function doChange26(changes, preferences, sourceFile, start3, useHtmlEntity) {
|
|
212719
|
+
const character = sourceFile.getText()[start3];
|
|
212720
212720
|
if (!isValidCharacter(character)) {
|
|
212721
212721
|
return;
|
|
212722
212722
|
}
|
|
212723
212723
|
const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`;
|
|
212724
|
-
changes.replaceRangeWithText(sourceFile, { pos:
|
|
212724
|
+
changes.replaceRangeWithText(sourceFile, { pos: start3, end: start3 + 1 }, replacement);
|
|
212725
212725
|
}
|
|
212726
212726
|
var deleteUnmatchedParameter = "deleteUnmatchedParameter";
|
|
212727
212727
|
var renameUnmatchedParameter = "renameUnmatchedParameter";
|
|
@@ -212745,8 +212745,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212745
212745
|
getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) {
|
|
212746
212746
|
const tagsToSignature = /* @__PURE__ */ new Map();
|
|
212747
212747
|
return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
|
|
212748
|
-
eachDiagnostic(context, errorCodes41, ({ file: file2, start:
|
|
212749
|
-
const info = getInfo14(file2,
|
|
212748
|
+
eachDiagnostic(context, errorCodes41, ({ file: file2, start: start3 }) => {
|
|
212749
|
+
const info = getInfo14(file2, start3);
|
|
212750
212750
|
if (info) {
|
|
212751
212751
|
tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag));
|
|
212752
212752
|
}
|
|
@@ -212826,8 +212826,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
212826
212826
|
},
|
|
212827
212827
|
fixIds: [fixId33]
|
|
212828
212828
|
});
|
|
212829
|
-
function getImportDeclaration(sourceFile, program2,
|
|
212830
|
-
const identifier = tryCast(getTokenAtPosition(sourceFile,
|
|
212829
|
+
function getImportDeclaration(sourceFile, program2, start3) {
|
|
212830
|
+
const identifier = tryCast(getTokenAtPosition(sourceFile, start3), isIdentifier);
|
|
212831
212831
|
if (!identifier || identifier.parent.kind !== 184) return;
|
|
212832
212832
|
const checker = program2.getTypeChecker();
|
|
212833
212833
|
const symbol2 = checker.getSymbolAtLocation(identifier);
|
|
@@ -213214,15 +213214,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213214
213214
|
fixIds: [fixId34],
|
|
213215
213215
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes44, (changes, diag2) => doChange27(changes, diag2.file, diag2.start, diag2.length, diag2.code))
|
|
213216
213216
|
});
|
|
213217
|
-
function doChange27(changes, sourceFile,
|
|
213218
|
-
const token = getTokenAtPosition(sourceFile,
|
|
213217
|
+
function doChange27(changes, sourceFile, start3, length2, errorCode) {
|
|
213218
|
+
const token = getTokenAtPosition(sourceFile, start3);
|
|
213219
213219
|
const statement = findAncestor(token, isStatement);
|
|
213220
213220
|
if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) {
|
|
213221
213221
|
const logData = JSON.stringify({
|
|
213222
213222
|
statementKind: Debug.formatSyntaxKind(statement.kind),
|
|
213223
213223
|
tokenKind: Debug.formatSyntaxKind(token.kind),
|
|
213224
213224
|
errorCode,
|
|
213225
|
-
start:
|
|
213225
|
+
start: start3,
|
|
213226
213226
|
length: length2
|
|
213227
213227
|
});
|
|
213228
213228
|
Debug.fail("Token and statement should start at the same point. " + logData);
|
|
@@ -213247,7 +213247,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213247
213247
|
}
|
|
213248
213248
|
}
|
|
213249
213249
|
if (isBlock(statement.parent)) {
|
|
213250
|
-
const end =
|
|
213250
|
+
const end = start3 + length2;
|
|
213251
213251
|
const lastStatement = Debug.checkDefined(lastWhere(sliceAfter(statement.parent.statements, statement), (s2) => s2.pos < end), "Some statement should be last");
|
|
213252
213252
|
changes.deleteNodeRange(sourceFile, statement, lastStatement);
|
|
213253
213253
|
} else {
|
|
@@ -213273,8 +213273,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213273
213273
|
fixIds: [fixId35],
|
|
213274
213274
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes45, (changes, diag2) => doChange28(changes, diag2.file, diag2.start))
|
|
213275
213275
|
});
|
|
213276
|
-
function doChange28(changes, sourceFile,
|
|
213277
|
-
const token = getTokenAtPosition(sourceFile,
|
|
213276
|
+
function doChange28(changes, sourceFile, start3) {
|
|
213277
|
+
const token = getTokenAtPosition(sourceFile, start3);
|
|
213278
213278
|
const labeledStatement = cast(token.parent, isLabeledStatement);
|
|
213279
213279
|
const pos = token.getStart(sourceFile);
|
|
213280
213280
|
const statementPos = labeledStatement.statement.getStart(sourceFile);
|
|
@@ -213400,8 +213400,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
213400
213400
|
function doChange30(changes, sourceFile, name2) {
|
|
213401
213401
|
changes.replaceNodeWithText(sourceFile, name2, `${name2.text}()`);
|
|
213402
213402
|
}
|
|
213403
|
-
function getCallName(sourceFile,
|
|
213404
|
-
const token = getTokenAtPosition(sourceFile,
|
|
213403
|
+
function getCallName(sourceFile, start3) {
|
|
213404
|
+
const token = getTokenAtPosition(sourceFile, start3);
|
|
213405
213405
|
if (isPropertyAccessExpression(token.parent)) {
|
|
213406
213406
|
let current = token.parent;
|
|
213407
213407
|
while (isPropertyAccessExpression(current.parent)) {
|
|
@@ -214423,8 +214423,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
214423
214423
|
return expr.parent.type.type;
|
|
214424
214424
|
}
|
|
214425
214425
|
}
|
|
214426
|
-
function getNodes3(sourceFile,
|
|
214427
|
-
const token = getTokenAtPosition(sourceFile,
|
|
214426
|
+
function getNodes3(sourceFile, start3) {
|
|
214427
|
+
const token = getTokenAtPosition(sourceFile, start3);
|
|
214428
214428
|
const containingFunction = getContainingFunction(token);
|
|
214429
214429
|
if (!containingFunction) {
|
|
214430
214430
|
return;
|
|
@@ -214482,15 +214482,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
214482
214482
|
}
|
|
214483
214483
|
})
|
|
214484
214484
|
});
|
|
214485
|
-
function doChange32(file2,
|
|
214485
|
+
function doChange32(file2, start3, length2, code, context) {
|
|
214486
214486
|
let startPosition;
|
|
214487
214487
|
let endPosition;
|
|
214488
214488
|
if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) {
|
|
214489
|
-
startPosition =
|
|
214490
|
-
endPosition =
|
|
214489
|
+
startPosition = start3;
|
|
214490
|
+
endPosition = start3 + length2;
|
|
214491
214491
|
} else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) {
|
|
214492
214492
|
const checker = context.program.getTypeChecker();
|
|
214493
|
-
const node = getTokenAtPosition(file2,
|
|
214493
|
+
const node = getTokenAtPosition(file2, start3).parent;
|
|
214494
214494
|
if (isComputedPropertyName(node)) {
|
|
214495
214495
|
return;
|
|
214496
214496
|
}
|
|
@@ -214550,8 +214550,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
214550
214550
|
registerCodeFix({
|
|
214551
214551
|
errorCodes: errorCodes51,
|
|
214552
214552
|
getCodeActions(context) {
|
|
214553
|
-
const { sourceFile, program: program2, span: { start:
|
|
214554
|
-
const token = getTokenAtPosition(sourceFile,
|
|
214553
|
+
const { sourceFile, program: program2, span: { start: start3 }, errorCode, cancellationToken, host, preferences } = context;
|
|
214554
|
+
const token = getTokenAtPosition(sourceFile, start3);
|
|
214555
214555
|
let declaration;
|
|
214556
214556
|
const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => {
|
|
214557
214557
|
declaration = doChange33(
|
|
@@ -216447,8 +216447,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
216447
216447
|
}
|
|
216448
216448
|
return token;
|
|
216449
216449
|
}
|
|
216450
|
-
function generateAccessorFromProperty(file2, program2,
|
|
216451
|
-
const fieldInfo = getAccessorConvertiblePropertyAtPosition(file2, program2,
|
|
216450
|
+
function generateAccessorFromProperty(file2, program2, start3, end, context, _actionName) {
|
|
216451
|
+
const fieldInfo = getAccessorConvertiblePropertyAtPosition(file2, program2, start3, end);
|
|
216452
216452
|
if (!fieldInfo || ts_refactor_exports.isRefactorErrorInfo(fieldInfo)) return void 0;
|
|
216453
216453
|
const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context);
|
|
216454
216454
|
const { isStatic: isStatic2, isReadonly, fieldName, accessorName, originalName, type, container, declaration } = fieldInfo;
|
|
@@ -216515,12 +216515,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
216515
216515
|
modifierFlags |= 2;
|
|
216516
216516
|
return modifierFlags;
|
|
216517
216517
|
}
|
|
216518
|
-
function getAccessorConvertiblePropertyAtPosition(file2, program2,
|
|
216519
|
-
const node = getTokenAtPosition(file2,
|
|
216520
|
-
const cursorRequest =
|
|
216518
|
+
function getAccessorConvertiblePropertyAtPosition(file2, program2, start3, end, considerEmptySpans = true) {
|
|
216519
|
+
const node = getTokenAtPosition(file2, start3);
|
|
216520
|
+
const cursorRequest = start3 === end && considerEmptySpans;
|
|
216521
216521
|
const declaration = findAncestor(node.parent, isAcceptedDeclaration);
|
|
216522
216522
|
const meaning = 7 | 256 | 8;
|
|
216523
|
-
if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file2,
|
|
216523
|
+
if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file2, start3, end) || cursorRequest)) {
|
|
216524
216524
|
return {
|
|
216525
216525
|
error: getLocaleSpecificMessage(Diagnostics.Could_not_find_property_for_which_to_generate_accessor)
|
|
216526
216526
|
};
|
|
@@ -216997,8 +216997,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
216997
216997
|
registerCodeFix({
|
|
216998
216998
|
errorCodes: errorCodes56,
|
|
216999
216999
|
getCodeActions(context) {
|
|
217000
|
-
const { sourceFile, span: { start:
|
|
217001
|
-
const info = getInfo19(sourceFile,
|
|
217000
|
+
const { sourceFile, span: { start: start3 } } = context;
|
|
217001
|
+
const info = getInfo19(sourceFile, start3);
|
|
217002
217002
|
if (!info) return void 0;
|
|
217003
217003
|
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t2) => doChange36(t2, sourceFile, info, context.preferences));
|
|
217004
217004
|
return [createCodeFixAction(fixId44, changes, Diagnostics.Convert_to_default_import, fixId44, Diagnostics.Convert_all_to_default_imports)];
|
|
@@ -217591,7 +217591,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
217591
217591
|
}
|
|
217592
217592
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program2, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
217593
217593
|
var _a2, _b, _c, _d;
|
|
217594
|
-
const
|
|
217594
|
+
const start3 = timestamp();
|
|
217595
217595
|
const needsFullResolution = isForImportStatementCompletion || getResolvePackageJsonExports(program2.getCompilerOptions()) || ((_a2 = preferences.autoImportSpecifierExcludeRegexes) == null ? void 0 : _a2.length);
|
|
217596
217596
|
let skippedAny = false;
|
|
217597
217597
|
let ambientCount = 0;
|
|
@@ -217607,7 +217607,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
217607
217607
|
const hitRateMessage = cacheAttemptCount ? ` (${(resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1)}% hit rate)` : "";
|
|
217608
217608
|
(_b = host.log) == null ? void 0 : _b.call(host, `${logPrefix}: resolved ${resolvedCount} module specifiers, plus ${ambientCount} ambient and ${resolvedFromCacheCount} from cache${hitRateMessage}`);
|
|
217609
217609
|
(_c = host.log) == null ? void 0 : _c.call(host, `${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`);
|
|
217610
|
-
(_d = host.log) == null ? void 0 : _d.call(host, `${logPrefix}: ${timestamp() -
|
|
217610
|
+
(_d = host.log) == null ? void 0 : _d.call(host, `${logPrefix}: ${timestamp() - start3}`);
|
|
217611
217611
|
return result;
|
|
217612
217612
|
function tryResolve(exportInfo, isFromAmbientModule) {
|
|
217613
217613
|
if (isFromAmbientModule) {
|
|
@@ -219002,10 +219002,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219002
219002
|
function escapingWrite(s2, write) {
|
|
219003
219003
|
const escaped = escapeSnippetText(s2);
|
|
219004
219004
|
if (escaped !== s2) {
|
|
219005
|
-
const
|
|
219005
|
+
const start3 = baseWriter.getTextPos();
|
|
219006
219006
|
write();
|
|
219007
219007
|
const end = baseWriter.getTextPos();
|
|
219008
|
-
escapes = append(escapes || (escapes = []), { newText: escaped, span: { start:
|
|
219008
|
+
escapes = append(escapes || (escapes = []), { newText: escaped, span: { start: start3, length: end - start3 } });
|
|
219009
219009
|
} else {
|
|
219010
219010
|
write();
|
|
219011
219011
|
}
|
|
@@ -219194,7 +219194,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219194
219194
|
}
|
|
219195
219195
|
}
|
|
219196
219196
|
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program2, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) {
|
|
219197
|
-
const
|
|
219197
|
+
const start3 = timestamp();
|
|
219198
219198
|
const closestSymbolDeclaration = getClosestSymbolDeclaration(contextToken, location);
|
|
219199
219199
|
const useSemicolons = probablyUsesSemicolons(sourceFile);
|
|
219200
219200
|
const typeChecker = program2.getTypeChecker();
|
|
@@ -219253,7 +219253,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219253
219253
|
true
|
|
219254
219254
|
);
|
|
219255
219255
|
}
|
|
219256
|
-
log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (timestamp() -
|
|
219256
|
+
log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (timestamp() - start3));
|
|
219257
219257
|
return {
|
|
219258
219258
|
has: (name2) => uniques.has(name2),
|
|
219259
219259
|
add: (name2) => uniques.set(name2, true)
|
|
@@ -219676,12 +219676,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219676
219676
|
function getCompletionData(program2, log, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) {
|
|
219677
219677
|
const typeChecker = program2.getTypeChecker();
|
|
219678
219678
|
const inCheckedFile = isCheckedFile(sourceFile, compilerOptions);
|
|
219679
|
-
let
|
|
219679
|
+
let start3 = timestamp();
|
|
219680
219680
|
let currentToken = getTokenAtPosition(sourceFile, position);
|
|
219681
|
-
log("getCompletionData: Get current token: " + (timestamp() -
|
|
219682
|
-
|
|
219681
|
+
log("getCompletionData: Get current token: " + (timestamp() - start3));
|
|
219682
|
+
start3 = timestamp();
|
|
219683
219683
|
const insideComment = isInComment(sourceFile, position, currentToken);
|
|
219684
|
-
log("getCompletionData: Is inside comment: " + (timestamp() -
|
|
219684
|
+
log("getCompletionData: Is inside comment: " + (timestamp() - start3));
|
|
219685
219685
|
let insideJsDocTagTypeExpression = false;
|
|
219686
219686
|
let insideJsDocImportTag = false;
|
|
219687
219687
|
let isInSnippetScope = false;
|
|
@@ -219730,12 +219730,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
219730
219730
|
return void 0;
|
|
219731
219731
|
}
|
|
219732
219732
|
}
|
|
219733
|
-
|
|
219733
|
+
start3 = timestamp();
|
|
219734
219734
|
const isJsOnlyLocation = !insideJsDocTagTypeExpression && !insideJsDocImportTag && isSourceFileJS(sourceFile);
|
|
219735
219735
|
const tokens = getRelevantTokens(position, sourceFile);
|
|
219736
219736
|
const previousToken = tokens.previousToken;
|
|
219737
219737
|
let contextToken = tokens.contextToken;
|
|
219738
|
-
log("getCompletionData: Get previous token: " + (timestamp() -
|
|
219738
|
+
log("getCompletionData: Get previous token: " + (timestamp() - start3));
|
|
219739
219739
|
let node = currentToken;
|
|
219740
219740
|
let propertyAccessToConvert;
|
|
219741
219741
|
let isRightOfDot = false;
|
|
@@ -222671,8 +222671,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
222671
222671
|
});
|
|
222672
222672
|
}
|
|
222673
222673
|
}
|
|
222674
|
-
function withoutStartAndEnd(s2,
|
|
222675
|
-
return startsWith(s2,
|
|
222674
|
+
function withoutStartAndEnd(s2, start3, end) {
|
|
222675
|
+
return startsWith(s2, start3) && endsWith(s2, end) ? s2.slice(start3.length, s2.length - end.length) : void 0;
|
|
222676
222676
|
}
|
|
222677
222677
|
function removeLeadingDirectorySeparator(path2) {
|
|
222678
222678
|
return path2[0] === directorySeparator ? path2.slice(1) : path2;
|
|
@@ -223822,17 +223822,17 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
223822
223822
|
return { fileName: documentSpan.fileName, span };
|
|
223823
223823
|
}
|
|
223824
223824
|
function getTextSpan(node, sourceFile, endNode2) {
|
|
223825
|
-
let
|
|
223825
|
+
let start3 = node.getStart(sourceFile);
|
|
223826
223826
|
let end = (endNode2 || node).getEnd();
|
|
223827
|
-
if (isStringLiteralLike(node) && end -
|
|
223827
|
+
if (isStringLiteralLike(node) && end - start3 > 2) {
|
|
223828
223828
|
Debug.assert(endNode2 === void 0);
|
|
223829
|
-
|
|
223829
|
+
start3 += 1;
|
|
223830
223830
|
end -= 1;
|
|
223831
223831
|
}
|
|
223832
223832
|
if ((endNode2 == null ? void 0 : endNode2.kind) === 270) {
|
|
223833
223833
|
end = endNode2.getFullStart();
|
|
223834
223834
|
}
|
|
223835
|
-
return createTextSpanFromBounds(
|
|
223835
|
+
return createTextSpanFromBounds(start3, end);
|
|
223836
223836
|
}
|
|
223837
223837
|
function getTextSpanOfEntry(entry) {
|
|
223838
223838
|
return entry.kind === 0 ? entry.textSpan : getTextSpan(entry.node, entry.node.getSourceFile());
|
|
@@ -227332,13 +227332,13 @@ ${content}
|
|
|
227332
227332
|
(block) => or(isBlock, isSourceFile)(block) && some(block.statements, (origStmt) => changes.some((newStmt) => matchNode(newStmt, origStmt)))
|
|
227333
227333
|
);
|
|
227334
227334
|
if (scope) {
|
|
227335
|
-
const
|
|
227336
|
-
if (
|
|
227335
|
+
const start3 = scope.statements.find((stmt) => changes.some((node) => matchNode(node, stmt)));
|
|
227336
|
+
if (start3) {
|
|
227337
227337
|
const end = findLast(scope.statements, (stmt) => changes.some((node) => matchNode(node, stmt)));
|
|
227338
227338
|
forEach(changes, wipeNode);
|
|
227339
227339
|
changeTracker.replaceNodeRangeWithNodes(
|
|
227340
227340
|
originalFile,
|
|
227341
|
-
|
|
227341
|
+
start3,
|
|
227342
227342
|
end,
|
|
227343
227343
|
changes
|
|
227344
227344
|
);
|
|
@@ -228617,13 +228617,13 @@ ${content}
|
|
|
228617
228617
|
return { canRename: false, localizedErrorMessage: getLocaleSpecificMessage(diagnostic) };
|
|
228618
228618
|
}
|
|
228619
228619
|
function createTriggerSpanForNode(node, sourceFile) {
|
|
228620
|
-
let
|
|
228620
|
+
let start3 = node.getStart(sourceFile);
|
|
228621
228621
|
let width = node.getWidth(sourceFile);
|
|
228622
228622
|
if (isStringLiteralLike(node)) {
|
|
228623
|
-
|
|
228623
|
+
start3 += 1;
|
|
228624
228624
|
width -= 2;
|
|
228625
228625
|
}
|
|
228626
|
-
return createTextSpan(
|
|
228626
|
+
return createTextSpan(start3, width);
|
|
228627
228627
|
}
|
|
228628
228628
|
function nodeIsEligibleForRename(node) {
|
|
228629
228629
|
switch (node.kind) {
|
|
@@ -229229,7 +229229,7 @@ ${content}
|
|
|
229229
229229
|
pushSelectionRange(start22, end2);
|
|
229230
229230
|
}
|
|
229231
229231
|
const isBetweenMultiLineBookends = isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) && !positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile);
|
|
229232
|
-
let
|
|
229232
|
+
let start3 = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart();
|
|
229233
229233
|
const end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node);
|
|
229234
229234
|
if (hasJSDocNodes(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.length)) {
|
|
229235
229235
|
pushSelectionRange(first2(node.jsDoc).getStart(), end);
|
|
@@ -229237,12 +229237,12 @@ ${content}
|
|
|
229237
229237
|
if (isSyntaxList(node)) {
|
|
229238
229238
|
const firstChild = node.getChildren()[0];
|
|
229239
229239
|
if (firstChild && hasJSDocNodes(firstChild) && ((_b = firstChild.jsDoc) == null ? void 0 : _b.length) && firstChild.getStart() !== node.pos) {
|
|
229240
|
-
|
|
229240
|
+
start3 = Math.min(start3, first2(firstChild.jsDoc).getStart());
|
|
229241
229241
|
}
|
|
229242
229242
|
}
|
|
229243
|
-
pushSelectionRange(
|
|
229243
|
+
pushSelectionRange(start3, end);
|
|
229244
229244
|
if (isStringLiteral(node) || isTemplateLiteral(node)) {
|
|
229245
|
-
pushSelectionRange(
|
|
229245
|
+
pushSelectionRange(start3 + 1, end - 1);
|
|
229246
229246
|
}
|
|
229247
229247
|
parentNode = node;
|
|
229248
229248
|
break;
|
|
@@ -229253,9 +229253,9 @@ ${content}
|
|
|
229253
229253
|
}
|
|
229254
229254
|
}
|
|
229255
229255
|
return selectionRange;
|
|
229256
|
-
function pushSelectionRange(
|
|
229257
|
-
if (
|
|
229258
|
-
const textSpan = createTextSpanFromBounds(
|
|
229256
|
+
function pushSelectionRange(start3, end) {
|
|
229257
|
+
if (start3 !== end) {
|
|
229258
|
+
const textSpan = createTextSpanFromBounds(start3, end);
|
|
229259
229259
|
if (!selectionRange || // Skip ranges that are identical to the parent
|
|
229260
229260
|
!textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don't contain the original position
|
|
229261
229261
|
textSpanIntersectsWithPosition(textSpan, pos)) {
|
|
@@ -229263,9 +229263,9 @@ ${content}
|
|
|
229263
229263
|
}
|
|
229264
229264
|
}
|
|
229265
229265
|
}
|
|
229266
|
-
function pushSelectionCommentRange(
|
|
229267
|
-
pushSelectionRange(
|
|
229268
|
-
let pos2 =
|
|
229266
|
+
function pushSelectionCommentRange(start3, end) {
|
|
229267
|
+
pushSelectionRange(start3, end);
|
|
229268
|
+
let pos2 = start3;
|
|
229269
229269
|
while (sourceFile.text.charCodeAt(pos2) === 47) {
|
|
229270
229270
|
pos2++;
|
|
229271
229271
|
}
|
|
@@ -230428,18 +230428,18 @@ ${content}
|
|
|
230428
230428
|
TrailingTriviaOption2[TrailingTriviaOption2["Include"] = 2] = "Include";
|
|
230429
230429
|
return TrailingTriviaOption2;
|
|
230430
230430
|
})(TrailingTriviaOption || {});
|
|
230431
|
-
function skipWhitespacesAndLineBreaks(text,
|
|
230431
|
+
function skipWhitespacesAndLineBreaks(text, start3) {
|
|
230432
230432
|
return skipTrivia(
|
|
230433
230433
|
text,
|
|
230434
|
-
|
|
230434
|
+
start3,
|
|
230435
230435
|
/*stopAfterLineBreak*/
|
|
230436
230436
|
false,
|
|
230437
230437
|
/*stopAtComments*/
|
|
230438
230438
|
true
|
|
230439
230439
|
);
|
|
230440
230440
|
}
|
|
230441
|
-
function hasCommentsBeforeLineBreak(text,
|
|
230442
|
-
let i2 =
|
|
230441
|
+
function hasCommentsBeforeLineBreak(text, start3) {
|
|
230442
|
+
let i2 = start3;
|
|
230443
230443
|
while (i2 < text.length) {
|
|
230444
230444
|
const ch = text.charCodeAt(i2);
|
|
230445
230445
|
if (isWhiteSpaceSingleLine(ch)) {
|
|
@@ -230476,14 +230476,14 @@ ${content}
|
|
|
230476
230476
|
}
|
|
230477
230477
|
}
|
|
230478
230478
|
const fullStart = node.getFullStart();
|
|
230479
|
-
const
|
|
230480
|
-
if (fullStart ===
|
|
230481
|
-
return
|
|
230479
|
+
const start3 = node.getStart(sourceFile);
|
|
230480
|
+
if (fullStart === start3) {
|
|
230481
|
+
return start3;
|
|
230482
230482
|
}
|
|
230483
230483
|
const fullStartLine = getLineStartPositionForPosition(fullStart, sourceFile);
|
|
230484
|
-
const startLine = getLineStartPositionForPosition(
|
|
230484
|
+
const startLine = getLineStartPositionForPosition(start3, sourceFile);
|
|
230485
230485
|
if (startLine === fullStartLine) {
|
|
230486
|
-
return leadingTriviaOption === 1 ? fullStart :
|
|
230486
|
+
return leadingTriviaOption === 1 ? fullStart : start3;
|
|
230487
230487
|
}
|
|
230488
230488
|
if (hasTrailingComment) {
|
|
230489
230489
|
const comment = ((_a2 = getLeadingCommentRanges(sourceFile.text, fullStart)) == null ? void 0 : _a2[0]) || ((_b = getTrailingCommentRanges(sourceFile.text, fullStart)) == null ? void 0 : _b[0]);
|
|
@@ -230804,13 +230804,13 @@ ${content}
|
|
|
230804
230804
|
return true;
|
|
230805
230805
|
}
|
|
230806
230806
|
tryInsertThisTypeAnnotation(sourceFile, node, type) {
|
|
230807
|
-
const
|
|
230807
|
+
const start3 = findChildOfKind(node, 21, sourceFile).getStart(sourceFile) + 1;
|
|
230808
230808
|
const suffix = node.parameters.length ? ", " : "";
|
|
230809
|
-
this.insertNodeAt(sourceFile,
|
|
230809
|
+
this.insertNodeAt(sourceFile, start3, type, { prefix: "this: ", suffix });
|
|
230810
230810
|
}
|
|
230811
230811
|
insertTypeParameters(sourceFile, node, typeParameters) {
|
|
230812
|
-
const
|
|
230813
|
-
this.insertNodesAt(sourceFile,
|
|
230812
|
+
const start3 = (findChildOfKind(node, 21, sourceFile) || first2(node.parameters)).getStart(sourceFile);
|
|
230813
|
+
this.insertNodesAt(sourceFile, start3, typeParameters, { prefix: "<", suffix: ">", joiner: ", " });
|
|
230814
230814
|
}
|
|
230815
230815
|
getOptionsForInsertNodeBefore(before, inserted, blankLineBetween) {
|
|
230816
230816
|
if (isStatement(before) || isClassElement(before)) {
|
|
@@ -231347,8 +231347,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
231347
231347
|
setTextRangePosEnd(newNode, getPos2(node), getEnd(node));
|
|
231348
231348
|
return newNode;
|
|
231349
231349
|
}
|
|
231350
|
-
function assignPositionsToNodeArray(nodes, visitor, test,
|
|
231351
|
-
const visited = visitNodes2(nodes, visitor, test,
|
|
231350
|
+
function assignPositionsToNodeArray(nodes, visitor, test, start3, count) {
|
|
231351
|
+
const visited = visitNodes2(nodes, visitor, test, start3, count);
|
|
231352
231352
|
if (!visited) {
|
|
231353
231353
|
return visited;
|
|
231354
231354
|
}
|
|
@@ -231718,7 +231718,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
231718
231718
|
if (!importClause.namedBindings) {
|
|
231719
231719
|
deleteNode(changes, sourceFile, importClause.parent);
|
|
231720
231720
|
} else {
|
|
231721
|
-
const
|
|
231721
|
+
const start3 = importClause.name.getStart(sourceFile);
|
|
231722
231722
|
const nextToken = getTokenAtPosition(sourceFile, importClause.name.end);
|
|
231723
231723
|
if (nextToken && nextToken.kind === 28) {
|
|
231724
231724
|
const end = skipTrivia(
|
|
@@ -231729,7 +231729,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
231729
231729
|
/*stopAtComments*/
|
|
231730
231730
|
true
|
|
231731
231731
|
);
|
|
231732
|
-
changes.deleteRange(sourceFile, { pos:
|
|
231732
|
+
changes.deleteRange(sourceFile, { pos: start3, end });
|
|
231733
231733
|
} else {
|
|
231734
231734
|
deleteNode(changes, sourceFile, importClause.name);
|
|
231735
231735
|
}
|
|
@@ -234194,9 +234194,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
234194
234194
|
/* FormatDocument */
|
|
234195
234195
|
);
|
|
234196
234196
|
}
|
|
234197
|
-
function formatSelection(
|
|
234197
|
+
function formatSelection(start3, end, sourceFile, formatContext) {
|
|
234198
234198
|
const span = {
|
|
234199
|
-
pos: getLineStartPositionForPosition(
|
|
234199
|
+
pos: getLineStartPositionForPosition(start3, sourceFile),
|
|
234200
234200
|
end
|
|
234201
234201
|
};
|
|
234202
234202
|
return formatSpan(
|
|
@@ -234277,9 +234277,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
234277
234277
|
}
|
|
234278
234278
|
}
|
|
234279
234279
|
function getScanStartPosition(enclosingNode, originalRange, sourceFile) {
|
|
234280
|
-
const
|
|
234281
|
-
if (
|
|
234282
|
-
return
|
|
234280
|
+
const start3 = enclosingNode.getStart(sourceFile);
|
|
234281
|
+
if (start3 === originalRange.pos && enclosingNode.end === originalRange.end) {
|
|
234282
|
+
return start3;
|
|
234283
234283
|
}
|
|
234284
234284
|
const precedingToken = findPrecedingToken(originalRange.pos, sourceFile);
|
|
234285
234285
|
if (!precedingToken) {
|
|
@@ -234963,9 +234963,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
234963
234963
|
}
|
|
234964
234964
|
}
|
|
234965
234965
|
}
|
|
234966
|
-
function getTrailingWhitespaceStartPosition(
|
|
234966
|
+
function getTrailingWhitespaceStartPosition(start3, end) {
|
|
234967
234967
|
let pos = end;
|
|
234968
|
-
while (pos >=
|
|
234968
|
+
while (pos >= start3 && isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) {
|
|
234969
234969
|
pos--;
|
|
234970
234970
|
}
|
|
234971
234971
|
if (pos !== end) {
|
|
@@ -234992,19 +234992,19 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
234992
234992
|
const endLine = sourceFile.getLineAndCharacterOfPosition(endPos).line;
|
|
234993
234993
|
trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange2);
|
|
234994
234994
|
}
|
|
234995
|
-
function recordDelete(
|
|
234995
|
+
function recordDelete(start3, len) {
|
|
234996
234996
|
if (len) {
|
|
234997
|
-
edits.push(createTextChangeFromStartLength(
|
|
234997
|
+
edits.push(createTextChangeFromStartLength(start3, len, ""));
|
|
234998
234998
|
}
|
|
234999
234999
|
}
|
|
235000
|
-
function recordReplace(
|
|
235000
|
+
function recordReplace(start3, len, newText) {
|
|
235001
235001
|
if (len || newText) {
|
|
235002
|
-
edits.push(createTextChangeFromStartLength(
|
|
235002
|
+
edits.push(createTextChangeFromStartLength(start3, len, newText));
|
|
235003
235003
|
}
|
|
235004
235004
|
}
|
|
235005
|
-
function recordInsert(
|
|
235005
|
+
function recordInsert(start3, text) {
|
|
235006
235006
|
if (text) {
|
|
235007
|
-
edits.push(createTextChangeFromStartLength(
|
|
235007
|
+
edits.push(createTextChangeFromStartLength(start3, 0, text));
|
|
235008
235008
|
}
|
|
235009
235009
|
}
|
|
235010
235010
|
function applyRuleEdits(rule2, previousRange2, previousStartLine, currentRange, currentStartLine) {
|
|
@@ -235299,10 +235299,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
235299
235299
|
return getBaseIndentation(options);
|
|
235300
235300
|
}
|
|
235301
235301
|
function getIndentationForNode(n, ignoreActualIndentationRange, sourceFile, options) {
|
|
235302
|
-
const
|
|
235302
|
+
const start3 = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile));
|
|
235303
235303
|
return getIndentationForNodeWorker(
|
|
235304
235304
|
n,
|
|
235305
|
-
|
|
235305
|
+
start3,
|
|
235306
235306
|
ignoreActualIndentationRange,
|
|
235307
235307
|
/*indentationDelta*/
|
|
235308
235308
|
0,
|
|
@@ -235323,8 +235323,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
235323
235323
|
while (parent2) {
|
|
235324
235324
|
let useActualIndentation = true;
|
|
235325
235325
|
if (ignoreActualIndentationRange) {
|
|
235326
|
-
const
|
|
235327
|
-
useActualIndentation =
|
|
235326
|
+
const start3 = current.getStart(sourceFile);
|
|
235327
|
+
useActualIndentation = start3 < ignoreActualIndentationRange.pos || start3 > ignoreActualIndentationRange.end;
|
|
235328
235328
|
}
|
|
235329
235329
|
const containingListOrParentStart = getContainingListOrParentStart(parent2, current, sourceFile);
|
|
235330
235330
|
const parentAndChildShareLine = containingListOrParentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent2, current, currentStart.line, sourceFile);
|
|
@@ -235448,7 +235448,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
235448
235448
|
function getListByPosition(pos, node, sourceFile) {
|
|
235449
235449
|
return node && getListByRange(pos, pos, node, sourceFile);
|
|
235450
235450
|
}
|
|
235451
|
-
function getListByRange(
|
|
235451
|
+
function getListByRange(start3, end, node, sourceFile) {
|
|
235452
235452
|
switch (node.kind) {
|
|
235453
235453
|
case 184:
|
|
235454
235454
|
return getList(node.typeArguments);
|
|
@@ -235489,7 +235489,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
235489
235489
|
return getList(node.elements);
|
|
235490
235490
|
}
|
|
235491
235491
|
function getList(list) {
|
|
235492
|
-
return list && rangeContainsStartEnd(getVisualListRange(node, list, sourceFile),
|
|
235492
|
+
return list && rangeContainsStartEnd(getVisualListRange(node, list, sourceFile), start3, end) ? list : void 0;
|
|
235493
235493
|
}
|
|
235494
235494
|
}
|
|
235495
235495
|
function getVisualListRange(node, list, sourceFile) {
|
|
@@ -239121,8 +239121,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
239121
239121
|
this.resetSourceMapInfo();
|
|
239122
239122
|
this.version++;
|
|
239123
239123
|
}
|
|
239124
|
-
edit(
|
|
239125
|
-
this.switchToScriptVersionCache().edit(
|
|
239124
|
+
edit(start3, end, newText) {
|
|
239125
|
+
this.switchToScriptVersionCache().edit(start3, end - start3, newText);
|
|
239126
239126
|
this.ownFileText = false;
|
|
239127
239127
|
this.text = void 0;
|
|
239128
239128
|
this.textSnapshot = void 0;
|
|
@@ -239204,9 +239204,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
239204
239204
|
const svc = this.tryUseScriptVersionCache();
|
|
239205
239205
|
if (svc) return svc.lineToTextSpan(line);
|
|
239206
239206
|
const lineMap = this.getLineMap();
|
|
239207
|
-
const
|
|
239207
|
+
const start3 = lineMap[line];
|
|
239208
239208
|
const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length;
|
|
239209
|
-
return createTextSpanFromBounds(
|
|
239209
|
+
return createTextSpanFromBounds(start3, end);
|
|
239210
239210
|
}
|
|
239211
239211
|
/**
|
|
239212
239212
|
* @param line 1 based index
|
|
@@ -239504,8 +239504,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
239504
239504
|
}
|
|
239505
239505
|
return false;
|
|
239506
239506
|
}
|
|
239507
|
-
editContent(
|
|
239508
|
-
this.textStorage.edit(
|
|
239507
|
+
editContent(start3, end, newText) {
|
|
239508
|
+
this.textStorage.edit(start3, end, newText);
|
|
239509
239509
|
this.markContainingProjectsAsDirty();
|
|
239510
239510
|
}
|
|
239511
239511
|
markContainingProjectsAsDirty() {
|
|
@@ -240678,7 +240678,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
240678
240678
|
Debug.assert(oldProgram === this.program);
|
|
240679
240679
|
Debug.assert(!this.isClosed(), "Called update graph worker of closed project");
|
|
240680
240680
|
this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`);
|
|
240681
|
-
const
|
|
240681
|
+
const start3 = timestamp();
|
|
240682
240682
|
const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = this.resolutionCache.createHasInvalidatedResolutions(returnFalse, returnFalse);
|
|
240683
240683
|
this.hasInvalidatedResolutions = hasInvalidatedResolutions;
|
|
240684
240684
|
this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions;
|
|
@@ -240784,7 +240784,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
240784
240784
|
},
|
|
240785
240785
|
(removed) => this.detachScriptInfoFromProject(removed)
|
|
240786
240786
|
);
|
|
240787
|
-
const elapsed = timestamp() -
|
|
240787
|
+
const elapsed = timestamp() - start3;
|
|
240788
240788
|
this.sendPerformanceEvent("UpdateGraph", elapsed);
|
|
240789
240789
|
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
|
|
240790
240790
|
if (this.projectService.logger.isTestLogger) {
|
|
@@ -241254,7 +241254,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
241254
241254
|
const dependencySelection = this.includePackageJsonAutoImports();
|
|
241255
241255
|
if (dependencySelection) {
|
|
241256
241256
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
|
|
241257
|
-
const
|
|
241257
|
+
const start3 = timestamp();
|
|
241258
241258
|
this.autoImportProviderHost = AutoImportProviderProject.create(
|
|
241259
241259
|
dependencySelection,
|
|
241260
241260
|
this,
|
|
@@ -241262,7 +241262,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
241262
241262
|
) ?? false;
|
|
241263
241263
|
if (this.autoImportProviderHost) {
|
|
241264
241264
|
updateProjectIfDirty(this.autoImportProviderHost);
|
|
241265
|
-
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() -
|
|
241265
|
+
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start3);
|
|
241266
241266
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
241267
241267
|
return this.autoImportProviderHost.getCurrentProgram();
|
|
241268
241268
|
}
|
|
@@ -241505,7 +241505,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
241505
241505
|
if (!program2) {
|
|
241506
241506
|
return emptyArray;
|
|
241507
241507
|
}
|
|
241508
|
-
const
|
|
241508
|
+
const start3 = timestamp();
|
|
241509
241509
|
let dependencyNames;
|
|
241510
241510
|
let rootNames;
|
|
241511
241511
|
const rootFileName = combinePaths(hostProject.currentDirectory, inferredTypesContainingFile);
|
|
@@ -241597,7 +241597,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
241597
241597
|
});
|
|
241598
241598
|
}
|
|
241599
241599
|
if (rootNames == null ? void 0 : rootNames.size) {
|
|
241600
|
-
hostProject.log(`AutoImportProviderProject: found ${rootNames.size} root files in ${dependenciesAdded} dependencies ${referencesAddded} referenced projects in ${timestamp() -
|
|
241600
|
+
hostProject.log(`AutoImportProviderProject: found ${rootNames.size} root files in ${dependenciesAdded} dependencies ${referencesAddded} referenced projects in ${timestamp() - start3} ms`);
|
|
241601
241601
|
}
|
|
241602
241602
|
return rootNames ? arrayFrom(rootNames.values()) : emptyArray;
|
|
241603
241603
|
function addRootNames(entrypoints) {
|
|
@@ -246176,13 +246176,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
246176
246176
|
return { line: lineAndCharacter.line + 1, offset: lineAndCharacter.character + 1 };
|
|
246177
246177
|
}
|
|
246178
246178
|
function formatDiagnosticToProtocol(diag2, includeFileName) {
|
|
246179
|
-
const
|
|
246179
|
+
const start3 = diag2.file && convertToLocation(getLineAndCharacterOfPosition(diag2.file, diag2.start));
|
|
246180
246180
|
const end = diag2.file && convertToLocation(getLineAndCharacterOfPosition(diag2.file, diag2.start + diag2.length));
|
|
246181
246181
|
const text = flattenDiagnosticMessageText(diag2.messageText, "\n");
|
|
246182
246182
|
const { code, source } = diag2;
|
|
246183
246183
|
const category = diagnosticCategoryName(diag2);
|
|
246184
246184
|
const common = {
|
|
246185
|
-
start:
|
|
246185
|
+
start: start3,
|
|
246186
246186
|
end,
|
|
246187
246187
|
text,
|
|
246188
246188
|
code,
|
|
@@ -246256,10 +246256,10 @@ ${json2}${newLine}`;
|
|
|
246256
246256
|
}
|
|
246257
246257
|
executeAction(action) {
|
|
246258
246258
|
var _a2, _b, _c, _d, _e, _f;
|
|
246259
|
-
let
|
|
246259
|
+
let stop2 = false;
|
|
246260
246260
|
try {
|
|
246261
246261
|
if (this.operationHost.isCancellationRequested()) {
|
|
246262
|
-
|
|
246262
|
+
stop2 = true;
|
|
246263
246263
|
(_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "stepCanceled", { seq: this.requestId, early: true });
|
|
246264
246264
|
} else {
|
|
246265
246265
|
(_b = tracing) == null ? void 0 : _b.push(tracing.Phase.Session, "stepAction", { seq: this.requestId });
|
|
@@ -246268,7 +246268,7 @@ ${json2}${newLine}`;
|
|
|
246268
246268
|
}
|
|
246269
246269
|
} catch (e2) {
|
|
246270
246270
|
(_d = tracing) == null ? void 0 : _d.popAll();
|
|
246271
|
-
|
|
246271
|
+
stop2 = true;
|
|
246272
246272
|
if (e2 instanceof OperationCanceledException) {
|
|
246273
246273
|
(_e = tracing) == null ? void 0 : _e.instant(tracing.Phase.Session, "stepCanceled", { seq: this.requestId });
|
|
246274
246274
|
} else {
|
|
@@ -246277,7 +246277,7 @@ ${json2}${newLine}`;
|
|
|
246277
246277
|
}
|
|
246278
246278
|
}
|
|
246279
246279
|
this.performanceData = this.operationHost.getPerformanceData();
|
|
246280
|
-
if (
|
|
246280
|
+
if (stop2 || !this.hasPendingWork()) {
|
|
246281
246281
|
this.complete();
|
|
246282
246282
|
}
|
|
246283
246283
|
}
|
|
@@ -246736,9 +246736,9 @@ ${json2}${newLine}`;
|
|
|
246736
246736
|
fileName: file2.fileName,
|
|
246737
246737
|
changes: mapDefinedIterator(arrayReverseIterator(file2.textChanges), (change) => {
|
|
246738
246738
|
const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file2.fileName));
|
|
246739
|
-
const
|
|
246739
|
+
const start3 = scriptInfo.lineOffsetToPosition(change.start.line, change.start.offset);
|
|
246740
246740
|
const end = scriptInfo.lineOffsetToPosition(change.end.line, change.end.offset);
|
|
246741
|
-
return
|
|
246741
|
+
return start3 >= 0 ? { span: { start: start3, length: end - start3 }, newText: change.newText } : void 0;
|
|
246742
246742
|
})
|
|
246743
246743
|
})),
|
|
246744
246744
|
request.arguments.closedFiles
|
|
@@ -248456,11 +248456,11 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248456
248456
|
}
|
|
248457
248457
|
toFileSpan(fileName, textSpan, project) {
|
|
248458
248458
|
const ls = project.getLanguageService();
|
|
248459
|
-
const
|
|
248459
|
+
const start3 = ls.toLineColumnOffset(fileName, textSpan.start);
|
|
248460
248460
|
const end = ls.toLineColumnOffset(fileName, textSpanEnd(textSpan));
|
|
248461
248461
|
return {
|
|
248462
248462
|
file: fileName,
|
|
248463
|
-
start: { line:
|
|
248463
|
+
start: { line: start3.line + 1, offset: start3.character + 1 },
|
|
248464
248464
|
end: { line: end.line + 1, offset: end.character + 1 }
|
|
248465
248465
|
};
|
|
248466
248466
|
}
|
|
@@ -248597,11 +248597,11 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
248597
248597
|
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file2);
|
|
248598
248598
|
const focusLocations = (_a2 = args.mapping.focusLocations) == null ? void 0 : _a2.map((spans) => {
|
|
248599
248599
|
return spans.map((loc) => {
|
|
248600
|
-
const
|
|
248600
|
+
const start3 = scriptInfo.lineOffsetToPosition(loc.start.line, loc.start.offset);
|
|
248601
248601
|
const end = scriptInfo.lineOffsetToPosition(loc.end.line, loc.end.offset);
|
|
248602
248602
|
return {
|
|
248603
|
-
start:
|
|
248604
|
-
length: end -
|
|
248603
|
+
start: start3,
|
|
248604
|
+
length: end - start3
|
|
248605
248605
|
};
|
|
248606
248606
|
});
|
|
248607
248607
|
});
|
|
@@ -249179,14 +249179,14 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
249179
249179
|
const scriptInfo = this.projectService.getScriptInfo(args.file);
|
|
249180
249180
|
Debug.assert(!!scriptInfo);
|
|
249181
249181
|
scriptInfo.textStorage.switchToScriptVersionCache();
|
|
249182
|
-
const
|
|
249182
|
+
const start3 = scriptInfo.lineOffsetToPosition(args.line, args.offset);
|
|
249183
249183
|
const end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset);
|
|
249184
|
-
if (
|
|
249184
|
+
if (start3 >= 0) {
|
|
249185
249185
|
this.changeSeq++;
|
|
249186
249186
|
this.projectService.applyChangesToFile(
|
|
249187
249187
|
scriptInfo,
|
|
249188
249188
|
singleIterator({
|
|
249189
|
-
span: { start:
|
|
249189
|
+
span: { start: start3, length: end - start3 },
|
|
249190
249190
|
newText: args.insertString
|
|
249191
249191
|
// TODO: GH#18217
|
|
249192
249192
|
})
|
|
@@ -249827,13 +249827,13 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
249827
249827
|
onMessage(message) {
|
|
249828
249828
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
249829
249829
|
this.gcTimer.scheduleCollect();
|
|
249830
|
-
let
|
|
249830
|
+
let start3;
|
|
249831
249831
|
const currentPerformanceData = this.performanceData;
|
|
249832
249832
|
if (this.logger.hasLevel(
|
|
249833
249833
|
2
|
|
249834
249834
|
/* requestTime */
|
|
249835
249835
|
)) {
|
|
249836
|
-
|
|
249836
|
+
start3 = this.hrtime();
|
|
249837
249837
|
if (this.logger.hasLevel(
|
|
249838
249838
|
3
|
|
249839
249839
|
/* verbose */
|
|
@@ -249860,7 +249860,7 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
249860
249860
|
2
|
|
249861
249861
|
/* requestTime */
|
|
249862
249862
|
)) {
|
|
249863
|
-
const elapsedTime = hrTimeToMilliseconds(this.hrtime(
|
|
249863
|
+
const elapsedTime = hrTimeToMilliseconds(this.hrtime(start3)).toFixed(4);
|
|
249864
249864
|
if (responseRequired) {
|
|
249865
249865
|
this.logger.perftrc(`${request.seq}::${request.command}: elapsed time (in milliseconds) ${elapsedTime}`);
|
|
249866
249866
|
} else {
|
|
@@ -249991,8 +249991,8 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
|
249991
249991
|
continue;
|
|
249992
249992
|
}
|
|
249993
249993
|
for (let i2 = textChanges2.length - 1; i2 >= 0; i2--) {
|
|
249994
|
-
const { newText, span: { start:
|
|
249995
|
-
text = text.slice(0,
|
|
249994
|
+
const { newText, span: { start: start3, length: length2 } } = textChanges2[i2];
|
|
249995
|
+
text = text.slice(0, start3) + newText + text.slice(start3 + length2);
|
|
249996
249996
|
}
|
|
249997
249997
|
}
|
|
249998
249998
|
return text;
|
|
@@ -251730,11 +251730,11 @@ function foldedBreaks(count) {
|
|
|
251730
251730
|
if (count === 1) return " ";
|
|
251731
251731
|
return "\n".repeat(count - 1);
|
|
251732
251732
|
}
|
|
251733
|
-
function getPlainValue(input,
|
|
251733
|
+
function getPlainValue(input, start3, end) {
|
|
251734
251734
|
let result = "";
|
|
251735
|
-
let position =
|
|
251736
|
-
let captureStart =
|
|
251737
|
-
let captureEnd =
|
|
251735
|
+
let position = start3;
|
|
251736
|
+
let captureStart = start3;
|
|
251737
|
+
let captureEnd = start3;
|
|
251738
251738
|
while (position < end) {
|
|
251739
251739
|
const ch = input.charCodeAt(position);
|
|
251740
251740
|
if (ch === 10 || ch === 13) {
|
|
@@ -251749,11 +251749,11 @@ function getPlainValue(input, start2, end) {
|
|
|
251749
251749
|
}
|
|
251750
251750
|
return result + input.slice(captureStart, captureEnd);
|
|
251751
251751
|
}
|
|
251752
|
-
function getSingleQuotedValue(input,
|
|
251752
|
+
function getSingleQuotedValue(input, start3, end) {
|
|
251753
251753
|
let result = "";
|
|
251754
|
-
let position =
|
|
251755
|
-
let captureStart =
|
|
251756
|
-
let captureEnd =
|
|
251754
|
+
let position = start3;
|
|
251755
|
+
let captureStart = start3;
|
|
251756
|
+
let captureEnd = start3;
|
|
251757
251757
|
while (position < end) {
|
|
251758
251758
|
const ch = input.charCodeAt(position);
|
|
251759
251759
|
if (ch === 39) {
|
|
@@ -251772,11 +251772,11 @@ function getSingleQuotedValue(input, start2, end) {
|
|
|
251772
251772
|
}
|
|
251773
251773
|
return result + input.slice(captureStart, end);
|
|
251774
251774
|
}
|
|
251775
|
-
function getDoubleQuotedValue(input,
|
|
251775
|
+
function getDoubleQuotedValue(input, start3, end) {
|
|
251776
251776
|
let result = "";
|
|
251777
|
-
let position =
|
|
251778
|
-
let captureStart =
|
|
251779
|
-
let captureEnd =
|
|
251777
|
+
let position = start3;
|
|
251778
|
+
let captureStart = start3;
|
|
251779
|
+
let captureEnd = start3;
|
|
251780
251780
|
while (position < end) {
|
|
251781
251781
|
const ch = input.charCodeAt(position);
|
|
251782
251782
|
if (ch === 92) {
|
|
@@ -251811,9 +251811,9 @@ function getDoubleQuotedValue(input, start2, end) {
|
|
|
251811
251811
|
}
|
|
251812
251812
|
return result + input.slice(captureStart, end);
|
|
251813
251813
|
}
|
|
251814
|
-
function getBlockValue(input,
|
|
251814
|
+
function getBlockValue(input, start3, end, indent, chomping, folded) {
|
|
251815
251815
|
const textIndent = indent < 0 ? 0 : indent;
|
|
251816
|
-
const region = input.slice(
|
|
251816
|
+
const region = input.slice(start3, end).replace(/\r\n?/g, "\n");
|
|
251817
251817
|
const lines = region === "" ? [] : (region.endsWith("\n") ? region.slice(0, -1) : region).split("\n");
|
|
251818
251818
|
let result = "";
|
|
251819
251819
|
let didReadContent = false;
|
|
@@ -252097,10 +252097,10 @@ function addDocumentEvent(state, explicitStart, explicitEnd) {
|
|
|
252097
252097
|
directives: state.directives
|
|
252098
252098
|
});
|
|
252099
252099
|
}
|
|
252100
|
-
function addSequenceEvent(state,
|
|
252100
|
+
function addSequenceEvent(state, start3, anchorStart, anchorEnd, tagStart, tagEnd, style) {
|
|
252101
252101
|
state.events.push({
|
|
252102
252102
|
type: 2,
|
|
252103
|
-
start:
|
|
252103
|
+
start: start3,
|
|
252104
252104
|
anchorStart,
|
|
252105
252105
|
anchorEnd,
|
|
252106
252106
|
tagStart,
|
|
@@ -252108,10 +252108,10 @@ function addSequenceEvent(state, start2, anchorStart, anchorEnd, tagStart, tagEn
|
|
|
252108
252108
|
style
|
|
252109
252109
|
});
|
|
252110
252110
|
}
|
|
252111
|
-
function addMappingEvent(state,
|
|
252111
|
+
function addMappingEvent(state, start3, anchorStart, anchorEnd, tagStart, tagEnd, style) {
|
|
252112
252112
|
state.events.push({
|
|
252113
252113
|
type: 3,
|
|
252114
|
-
start:
|
|
252114
|
+
start: start3,
|
|
252115
252115
|
anchorStart,
|
|
252116
252116
|
anchorEnd,
|
|
252117
252117
|
tagStart,
|
|
@@ -252257,13 +252257,13 @@ function skipUntilLineEnd(state) {
|
|
|
252257
252257
|
let ch = state.input.charCodeAt(state.position);
|
|
252258
252258
|
while (ch !== 0 && !isEol(ch)) ch = state.input.charCodeAt(++state.position);
|
|
252259
252259
|
}
|
|
252260
|
-
function checkPrintable(state,
|
|
252261
|
-
if (PATTERN_NON_PRINTABLE.test(state.input.slice(
|
|
252260
|
+
function checkPrintable(state, start3, end) {
|
|
252261
|
+
if (PATTERN_NON_PRINTABLE.test(state.input.slice(start3, end))) throwError3(state, "the stream contains non-printable characters");
|
|
252262
252262
|
}
|
|
252263
252263
|
function readTagProperty(state, props, inFlow) {
|
|
252264
252264
|
if (state.input.charCodeAt(state.position) !== 33) return false;
|
|
252265
252265
|
if (props.tagStart !== NO_RANGE$1) throwError3(state, "duplication of a tag property");
|
|
252266
|
-
const
|
|
252266
|
+
const start3 = state.position;
|
|
252267
252267
|
let isVerbatim = false;
|
|
252268
252268
|
let isNamed = false;
|
|
252269
252269
|
let tagHandle = "!";
|
|
@@ -252298,7 +252298,7 @@ function readTagProperty(state, props, inFlow) {
|
|
|
252298
252298
|
}
|
|
252299
252299
|
if (tagName && !(isVerbatim ? PATTERN_TAG_URI.test(tagName) : PATTERN_TAG_SUFFIX.test(tagName))) throwError3(state, `tag name cannot contain such characters: ${tagName}`);
|
|
252300
252300
|
if (!isVerbatim && tagHandle !== "!" && tagHandle !== "!!" && !HAS_OWN.call(state.tagHandlers, tagHandle)) throwError3(state, `undeclared tag handle "${tagHandle}"`);
|
|
252301
|
-
props.tagStart =
|
|
252301
|
+
props.tagStart = start3;
|
|
252302
252302
|
props.tagEnd = state.position;
|
|
252303
252303
|
return true;
|
|
252304
252304
|
}
|
|
@@ -252306,10 +252306,10 @@ function readAnchorProperty(state, props) {
|
|
|
252306
252306
|
if (state.input.charCodeAt(state.position) !== 38) return false;
|
|
252307
252307
|
if (props.anchorStart !== NO_RANGE$1) throwError3(state, "duplication of an anchor property");
|
|
252308
252308
|
state.position++;
|
|
252309
|
-
const
|
|
252309
|
+
const start3 = state.position;
|
|
252310
252310
|
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) state.position++;
|
|
252311
|
-
if (state.position ===
|
|
252312
|
-
props.anchorStart =
|
|
252311
|
+
if (state.position === start3) throwError3(state, "name of an anchor node must contain at least one character");
|
|
252312
|
+
props.anchorStart = start3;
|
|
252313
252313
|
props.anchorEnd = state.position;
|
|
252314
252314
|
return true;
|
|
252315
252315
|
}
|
|
@@ -252317,10 +252317,10 @@ function readAlias(state, props) {
|
|
|
252317
252317
|
if (state.input.charCodeAt(state.position) !== 42) return false;
|
|
252318
252318
|
if (props.anchorStart !== NO_RANGE$1 || props.tagStart !== NO_RANGE$1) throwError3(state, "alias node should not have any properties");
|
|
252319
252319
|
state.position++;
|
|
252320
|
-
const
|
|
252320
|
+
const start3 = state.position;
|
|
252321
252321
|
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position)) && !isFlowIndicator(state.input.charCodeAt(state.position))) state.position++;
|
|
252322
|
-
if (state.position ===
|
|
252323
|
-
addAliasEvent(state,
|
|
252322
|
+
if (state.position === start3) throwError3(state, "name of an alias node must contain at least one character");
|
|
252323
|
+
addAliasEvent(state, start3, state.position);
|
|
252324
252324
|
return true;
|
|
252325
252325
|
}
|
|
252326
252326
|
function readFlowScalarBreak(state, nodeIndent) {
|
|
@@ -252330,7 +252330,7 @@ function readFlowScalarBreak(state, nodeIndent) {
|
|
|
252330
252330
|
function readSingleQuotedScalar(state, nodeIndent, props) {
|
|
252331
252331
|
if (state.input.charCodeAt(state.position) !== 39) return false;
|
|
252332
252332
|
state.position++;
|
|
252333
|
-
const
|
|
252333
|
+
const start3 = state.position;
|
|
252334
252334
|
let simple = true;
|
|
252335
252335
|
while (state.input.charCodeAt(state.position) !== 0) {
|
|
252336
252336
|
const ch = state.input.charCodeAt(state.position);
|
|
@@ -252342,7 +252342,7 @@ function readSingleQuotedScalar(state, nodeIndent, props) {
|
|
|
252342
252342
|
}
|
|
252343
252343
|
const end = state.position;
|
|
252344
252344
|
state.position++;
|
|
252345
|
-
addScalarEvent(state,
|
|
252345
|
+
addScalarEvent(state, start3, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2, 1, -1, simple);
|
|
252346
252346
|
return true;
|
|
252347
252347
|
}
|
|
252348
252348
|
if (isEol(ch)) {
|
|
@@ -252357,14 +252357,14 @@ function readSingleQuotedScalar(state, nodeIndent, props) {
|
|
|
252357
252357
|
function readDoubleQuotedScalar(state, nodeIndent, props) {
|
|
252358
252358
|
if (state.input.charCodeAt(state.position) !== 34) return false;
|
|
252359
252359
|
state.position++;
|
|
252360
|
-
const
|
|
252360
|
+
const start3 = state.position;
|
|
252361
252361
|
let simple = true;
|
|
252362
252362
|
while (state.input.charCodeAt(state.position) !== 0) {
|
|
252363
252363
|
const ch = state.input.charCodeAt(state.position);
|
|
252364
252364
|
if (ch === 34) {
|
|
252365
252365
|
const end = state.position;
|
|
252366
252366
|
state.position++;
|
|
252367
|
-
addScalarEvent(state,
|
|
252367
|
+
addScalarEvent(state, start3, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 3, 1, -1, simple);
|
|
252368
252368
|
return true;
|
|
252369
252369
|
}
|
|
252370
252370
|
if (ch === 92) {
|
|
@@ -252483,7 +252483,7 @@ function canStartPlainScalar(state, nodeContext) {
|
|
|
252483
252483
|
}
|
|
252484
252484
|
function readPlainScalar(state, nodeIndent, nodeContext, props) {
|
|
252485
252485
|
if (!canStartPlainScalar(state, nodeContext)) return false;
|
|
252486
|
-
const
|
|
252486
|
+
const start3 = state.position;
|
|
252487
252487
|
let end = state.position;
|
|
252488
252488
|
let ch = state.input.charCodeAt(state.position);
|
|
252489
252489
|
const inFlow = nodeContext === CONTEXT_FLOW_IN;
|
|
@@ -252516,9 +252516,9 @@ function readPlainScalar(state, nodeIndent, nodeContext, props) {
|
|
|
252516
252516
|
if (!isWhiteSpace(ch)) end = state.position + 1;
|
|
252517
252517
|
ch = state.input.charCodeAt(++state.position);
|
|
252518
252518
|
}
|
|
252519
|
-
if (end ===
|
|
252520
|
-
checkPrintable(state,
|
|
252521
|
-
addScalarEvent(state,
|
|
252519
|
+
if (end === start3) return false;
|
|
252520
|
+
checkPrintable(state, start3, end);
|
|
252521
|
+
addScalarEvent(state, start3, end, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 1, 1, -1, !multiline);
|
|
252522
252522
|
return true;
|
|
252523
252523
|
}
|
|
252524
252524
|
function skipFlowSeparationSpace(state, nodeIndent) {
|
|
@@ -252529,12 +252529,12 @@ function skipFlowSeparationSpace(state, nodeIndent) {
|
|
|
252529
252529
|
function readFlowCollection(state, nodeIndent, props) {
|
|
252530
252530
|
const ch = state.input.charCodeAt(state.position);
|
|
252531
252531
|
const isMapping = ch === 123;
|
|
252532
|
-
const
|
|
252532
|
+
const start3 = state.position;
|
|
252533
252533
|
let readNext = true;
|
|
252534
252534
|
if (ch !== 91 && ch !== 123) return false;
|
|
252535
252535
|
const terminator = isMapping ? 125 : 93;
|
|
252536
|
-
if (isMapping) addMappingEvent(state,
|
|
252537
|
-
else addSequenceEvent(state,
|
|
252536
|
+
if (isMapping) addMappingEvent(state, start3, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2);
|
|
252537
|
+
else addSequenceEvent(state, start3, props.anchorStart, props.anchorEnd, props.tagStart, props.tagEnd, 2);
|
|
252538
252538
|
state.position++;
|
|
252539
252539
|
while (state.input.charCodeAt(state.position) !== 0) {
|
|
252540
252540
|
skipFlowSeparationSpace(state, nodeIndent);
|
|
@@ -252785,9 +252785,9 @@ function readDirective(state) {
|
|
|
252785
252785
|
while (state.input.charCodeAt(state.position) !== 0 && !isEol(state.input.charCodeAt(state.position))) {
|
|
252786
252786
|
while (isWhiteSpace(state.input.charCodeAt(state.position))) state.position++;
|
|
252787
252787
|
if (state.input.charCodeAt(state.position) === 35 || isEol(state.input.charCodeAt(state.position)) || state.input.charCodeAt(state.position) === 0) break;
|
|
252788
|
-
const
|
|
252788
|
+
const start3 = state.position;
|
|
252789
252789
|
while (state.input.charCodeAt(state.position) !== 0 && !isWsOrEol(state.input.charCodeAt(state.position))) state.position++;
|
|
252790
|
-
args.push(state.input.slice(
|
|
252790
|
+
args.push(state.input.slice(start3, state.position));
|
|
252791
252791
|
}
|
|
252792
252792
|
if (isEol(state.input.charCodeAt(state.position))) consumeLineBreak(state);
|
|
252793
252793
|
if (name2 === "YAML") {
|
|
@@ -268234,10 +268234,10 @@ var require_polyfills = __commonJS({
|
|
|
268234
268234
|
if (platform === "win32") {
|
|
268235
268235
|
fs3.rename = /* @__PURE__ */ (function(fs$rename) {
|
|
268236
268236
|
return function(from11, to, cb) {
|
|
268237
|
-
var
|
|
268237
|
+
var start3 = Date.now();
|
|
268238
268238
|
var backoff = 0;
|
|
268239
268239
|
fs$rename(from11, to, function CB(er) {
|
|
268240
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() -
|
|
268240
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start3 < 6e4) {
|
|
268241
268241
|
setTimeout(function() {
|
|
268242
268242
|
fs3.stat(to, function(stater, st) {
|
|
268243
268243
|
if (stater && stater.code === "ENOENT")
|
|
@@ -270950,19 +270950,19 @@ var require_lodash = __commonJS({
|
|
|
270950
270950
|
}
|
|
270951
270951
|
return result;
|
|
270952
270952
|
}
|
|
270953
|
-
function baseRest(func,
|
|
270954
|
-
|
|
270953
|
+
function baseRest(func, start3) {
|
|
270954
|
+
start3 = nativeMax(start3 === void 0 ? func.length - 1 : start3, 0);
|
|
270955
270955
|
return function() {
|
|
270956
|
-
var args = arguments, index = -1, length = nativeMax(args.length -
|
|
270956
|
+
var args = arguments, index = -1, length = nativeMax(args.length - start3, 0), array2 = Array(length);
|
|
270957
270957
|
while (++index < length) {
|
|
270958
|
-
array2[index] = args[
|
|
270958
|
+
array2[index] = args[start3 + index];
|
|
270959
270959
|
}
|
|
270960
270960
|
index = -1;
|
|
270961
|
-
var otherArgs = Array(
|
|
270962
|
-
while (++index <
|
|
270961
|
+
var otherArgs = Array(start3 + 1);
|
|
270962
|
+
while (++index < start3) {
|
|
270963
270963
|
otherArgs[index] = args[index];
|
|
270964
270964
|
}
|
|
270965
|
-
otherArgs[
|
|
270965
|
+
otherArgs[start3] = array2;
|
|
270966
270966
|
return apply(func, this, otherArgs);
|
|
270967
270967
|
};
|
|
270968
270968
|
}
|
|
@@ -271456,19 +271456,19 @@ var require_lodash3 = __commonJS({
|
|
|
271456
271456
|
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
271457
271457
|
return pattern.test(toSource(value));
|
|
271458
271458
|
}
|
|
271459
|
-
function baseRest(func,
|
|
271460
|
-
|
|
271459
|
+
function baseRest(func, start3) {
|
|
271460
|
+
start3 = nativeMax(start3 === void 0 ? func.length - 1 : start3, 0);
|
|
271461
271461
|
return function() {
|
|
271462
|
-
var args = arguments, index = -1, length = nativeMax(args.length -
|
|
271462
|
+
var args = arguments, index = -1, length = nativeMax(args.length - start3, 0), array2 = Array(length);
|
|
271463
271463
|
while (++index < length) {
|
|
271464
|
-
array2[index] = args[
|
|
271464
|
+
array2[index] = args[start3 + index];
|
|
271465
271465
|
}
|
|
271466
271466
|
index = -1;
|
|
271467
|
-
var otherArgs = Array(
|
|
271468
|
-
while (++index <
|
|
271467
|
+
var otherArgs = Array(start3 + 1);
|
|
271468
|
+
while (++index < start3) {
|
|
271469
271469
|
otherArgs[index] = args[index];
|
|
271470
271470
|
}
|
|
271471
|
-
otherArgs[
|
|
271471
|
+
otherArgs[start3] = array2;
|
|
271472
271472
|
return apply(func, this, otherArgs);
|
|
271473
271473
|
};
|
|
271474
271474
|
}
|
|
@@ -271818,19 +271818,19 @@ var require_lodash4 = __commonJS({
|
|
|
271818
271818
|
var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
271819
271819
|
return pattern.test(toSource(value));
|
|
271820
271820
|
}
|
|
271821
|
-
function baseRest(func,
|
|
271822
|
-
|
|
271821
|
+
function baseRest(func, start3) {
|
|
271822
|
+
start3 = nativeMax(start3 === void 0 ? func.length - 1 : start3, 0);
|
|
271823
271823
|
return function() {
|
|
271824
|
-
var args = arguments, index = -1, length = nativeMax(args.length -
|
|
271824
|
+
var args = arguments, index = -1, length = nativeMax(args.length - start3, 0), array2 = Array(length);
|
|
271825
271825
|
while (++index < length) {
|
|
271826
|
-
array2[index] = args[
|
|
271826
|
+
array2[index] = args[start3 + index];
|
|
271827
271827
|
}
|
|
271828
271828
|
index = -1;
|
|
271829
|
-
var otherArgs = Array(
|
|
271830
|
-
while (++index <
|
|
271829
|
+
var otherArgs = Array(start3 + 1);
|
|
271830
|
+
while (++index < start3) {
|
|
271831
271831
|
otherArgs[index] = args[index];
|
|
271832
271832
|
}
|
|
271833
|
-
otherArgs[
|
|
271833
|
+
otherArgs[start3] = array2;
|
|
271834
271834
|
return apply(func, this, otherArgs);
|
|
271835
271835
|
};
|
|
271836
271836
|
}
|
|
@@ -272050,8 +272050,8 @@ var require_old = __commonJS({
|
|
|
272050
272050
|
var current;
|
|
272051
272051
|
var base;
|
|
272052
272052
|
var previous;
|
|
272053
|
-
|
|
272054
|
-
function
|
|
272053
|
+
start3();
|
|
272054
|
+
function start3() {
|
|
272055
272055
|
var m2 = splitRootRe.exec(p);
|
|
272056
272056
|
pos = m2[0].length;
|
|
272057
272057
|
current = m2[0];
|
|
@@ -272098,7 +272098,7 @@ var require_old = __commonJS({
|
|
|
272098
272098
|
if (!isWindows) seenLinks[id] = linkTarget;
|
|
272099
272099
|
}
|
|
272100
272100
|
p = pathModule.resolve(resolvedLink, p.slice(pos));
|
|
272101
|
-
|
|
272101
|
+
start3();
|
|
272102
272102
|
}
|
|
272103
272103
|
if (cache) cache[original] = p;
|
|
272104
272104
|
return p;
|
|
@@ -272117,8 +272117,8 @@ var require_old = __commonJS({
|
|
|
272117
272117
|
var current;
|
|
272118
272118
|
var base;
|
|
272119
272119
|
var previous;
|
|
272120
|
-
|
|
272121
|
-
function
|
|
272120
|
+
start3();
|
|
272121
|
+
function start3() {
|
|
272122
272122
|
var m2 = splitRootRe.exec(p);
|
|
272123
272123
|
pos = m2[0].length;
|
|
272124
272124
|
current = m2[0];
|
|
@@ -272182,7 +272182,7 @@ var require_old = __commonJS({
|
|
|
272182
272182
|
}
|
|
272183
272183
|
function gotResolvedLink(resolvedLink) {
|
|
272184
272184
|
p = pathModule.resolve(resolvedLink, p.slice(pos));
|
|
272185
|
-
|
|
272185
|
+
start3();
|
|
272186
272186
|
}
|
|
272187
272187
|
};
|
|
272188
272188
|
}
|
|
@@ -274180,14 +274180,14 @@ var require_errors3 = __commonJS({
|
|
|
274180
274180
|
}
|
|
274181
274181
|
return str2.substring(this_len - search.length, this_len) === search;
|
|
274182
274182
|
}
|
|
274183
|
-
function includes(str2, search,
|
|
274184
|
-
if (typeof
|
|
274185
|
-
|
|
274183
|
+
function includes(str2, search, start3) {
|
|
274184
|
+
if (typeof start3 !== "number") {
|
|
274185
|
+
start3 = 0;
|
|
274186
274186
|
}
|
|
274187
|
-
if (
|
|
274187
|
+
if (start3 + search.length > str2.length) {
|
|
274188
274188
|
return false;
|
|
274189
274189
|
} else {
|
|
274190
|
-
return str2.indexOf(search,
|
|
274190
|
+
return str2.indexOf(search, start3) !== -1;
|
|
274191
274191
|
}
|
|
274192
274192
|
}
|
|
274193
274193
|
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
@@ -277522,14 +277522,14 @@ var require_errors4 = __commonJS({
|
|
|
277522
277522
|
}
|
|
277523
277523
|
return str2.substring(this_len - search.length, this_len) === search;
|
|
277524
277524
|
}
|
|
277525
|
-
function includes(str2, search,
|
|
277526
|
-
if (typeof
|
|
277527
|
-
|
|
277525
|
+
function includes(str2, search, start3) {
|
|
277526
|
+
if (typeof start3 !== "number") {
|
|
277527
|
+
start3 = 0;
|
|
277528
277528
|
}
|
|
277529
|
-
if (
|
|
277529
|
+
if (start3 + search.length > str2.length) {
|
|
277530
277530
|
return false;
|
|
277531
277531
|
} else {
|
|
277532
|
-
return str2.indexOf(search,
|
|
277532
|
+
return str2.indexOf(search, start3) !== -1;
|
|
277533
277533
|
}
|
|
277534
277534
|
}
|
|
277535
277535
|
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
@@ -280294,14 +280294,14 @@ var require_errors5 = __commonJS({
|
|
|
280294
280294
|
}
|
|
280295
280295
|
return str2.substring(this_len - search.length, this_len) === search;
|
|
280296
280296
|
}
|
|
280297
|
-
function includes(str2, search,
|
|
280298
|
-
if (typeof
|
|
280299
|
-
|
|
280297
|
+
function includes(str2, search, start3) {
|
|
280298
|
+
if (typeof start3 !== "number") {
|
|
280299
|
+
start3 = 0;
|
|
280300
280300
|
}
|
|
280301
|
-
if (
|
|
280301
|
+
if (start3 + search.length > str2.length) {
|
|
280302
280302
|
return false;
|
|
280303
280303
|
} else {
|
|
280304
|
-
return str2.indexOf(search,
|
|
280304
|
+
return str2.indexOf(search, start3) !== -1;
|
|
280305
280305
|
}
|
|
280306
280306
|
}
|
|
280307
280307
|
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
@@ -283531,14 +283531,14 @@ var require_errors6 = __commonJS({
|
|
|
283531
283531
|
}
|
|
283532
283532
|
return str2.substring(this_len - search.length, this_len) === search;
|
|
283533
283533
|
}
|
|
283534
|
-
function includes(str2, search,
|
|
283535
|
-
if (typeof
|
|
283536
|
-
|
|
283534
|
+
function includes(str2, search, start3) {
|
|
283535
|
+
if (typeof start3 !== "number") {
|
|
283536
|
+
start3 = 0;
|
|
283537
283537
|
}
|
|
283538
|
-
if (
|
|
283538
|
+
if (start3 + search.length > str2.length) {
|
|
283539
283539
|
return false;
|
|
283540
283540
|
} else {
|
|
283541
|
-
return str2.indexOf(search,
|
|
283541
|
+
return str2.indexOf(search, start3) !== -1;
|
|
283542
283542
|
}
|
|
283543
283543
|
}
|
|
283544
283544
|
createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
|
|
@@ -291163,9 +291163,9 @@ function nullish(input) {
|
|
|
291163
291163
|
return input === null || input === void 0;
|
|
291164
291164
|
}
|
|
291165
291165
|
function cleanRegex(source) {
|
|
291166
|
-
const
|
|
291166
|
+
const start3 = source.startsWith("^") ? 1 : 0;
|
|
291167
291167
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
291168
|
-
return source.slice(
|
|
291168
|
+
return source.slice(start3, end);
|
|
291169
291169
|
}
|
|
291170
291170
|
function floatSafeRemainder2(val, step) {
|
|
291171
291171
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
@@ -294585,9 +294585,9 @@ var init_schemas = __esm({
|
|
|
294585
294585
|
const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
|
|
294586
294586
|
if (!source)
|
|
294587
294587
|
throw new Error(`Invalid template literal part: ${part._zod.traits}`);
|
|
294588
|
-
const
|
|
294588
|
+
const start3 = source.startsWith("^") ? 1 : 0;
|
|
294589
294589
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
294590
|
-
regexParts.push(source.slice(
|
|
294590
|
+
regexParts.push(source.slice(start3, end));
|
|
294591
294591
|
} else if (part === null || primitiveTypes.has(typeof part)) {
|
|
294592
294592
|
regexParts.push(escapeRegex(`${part}`));
|
|
294593
294593
|
} else {
|
|
@@ -318774,6 +318774,35 @@ var init_daemon = __esm({
|
|
|
318774
318774
|
await this.systemctl("daemon-reload");
|
|
318775
318775
|
return path2;
|
|
318776
318776
|
}
|
|
318777
|
+
/** Whether `runner:daemon:install` wrote the unit. */
|
|
318778
|
+
installed() {
|
|
318779
|
+
return (0, import_fs7.existsSync)(unitPath(this.serviceName, this.home));
|
|
318780
|
+
}
|
|
318781
|
+
start() {
|
|
318782
|
+
return this.systemctl("start", this.unit);
|
|
318783
|
+
}
|
|
318784
|
+
stop() {
|
|
318785
|
+
return this.systemctl("stop", this.unit);
|
|
318786
|
+
}
|
|
318787
|
+
restart() {
|
|
318788
|
+
return this.systemctl("restart", this.unit);
|
|
318789
|
+
}
|
|
318790
|
+
/**
|
|
318791
|
+
* How the service is doing right after a start: `active`, or `failed`
|
|
318792
|
+
* with the runner's exit status (78 = Lambforge refused the token). A
|
|
318793
|
+
* refused runner exits within a second, so callers wait briefly first.
|
|
318794
|
+
*/
|
|
318795
|
+
async outcome() {
|
|
318796
|
+
const { stdout } = await this.systemctl(
|
|
318797
|
+
"show",
|
|
318798
|
+
this.unit,
|
|
318799
|
+
"--property=ActiveState",
|
|
318800
|
+
"--property=ExecMainStatus"
|
|
318801
|
+
).catch((e2) => ({ stdout: String(e2?.stdout ?? "") }));
|
|
318802
|
+
const active = /ActiveState=(active|activating|reloading)/.test(stdout);
|
|
318803
|
+
const status2 = /ExecMainStatus=(\d+)/.exec(stdout)?.[1];
|
|
318804
|
+
return { active, exitStatus: status2 ? Number(status2) : void 0 };
|
|
318805
|
+
}
|
|
318777
318806
|
async status() {
|
|
318778
318807
|
return this.systemctl("status", "--no-pager", "--lines=15", this.unit).then((r2) => r2.stdout).catch((e2) => e2.stdout || e2.message);
|
|
318779
318808
|
}
|
|
@@ -318890,10 +318919,14 @@ var daemon_commands_exports = {};
|
|
|
318890
318919
|
__export(daemon_commands_exports, {
|
|
318891
318920
|
install: () => install,
|
|
318892
318921
|
logs: () => logs,
|
|
318922
|
+
reportStarted: () => reportStarted,
|
|
318923
|
+
restart: () => restart,
|
|
318924
|
+
start: () => start,
|
|
318893
318925
|
status: () => status,
|
|
318926
|
+
stop: () => stop,
|
|
318894
318927
|
uninstall: () => uninstall
|
|
318895
318928
|
});
|
|
318896
|
-
var import_child_process3, install, uninstall, status, logs;
|
|
318929
|
+
var import_child_process3, install, uninstall, installedService, reportStarted, start, restart, stop, status, logs;
|
|
318897
318930
|
var init_daemon_commands = __esm({
|
|
318898
318931
|
"src/commands/runner/daemon-commands.ts"() {
|
|
318899
318932
|
import_child_process3 = require("child_process");
|
|
@@ -318959,6 +318992,50 @@ var init_daemon_commands = __esm({
|
|
|
318959
318992
|
`Stopped and removed ${serviceName} (${path2}). The runner itself is still registered - \`gcli runner:delete\` revokes it.`
|
|
318960
318993
|
);
|
|
318961
318994
|
};
|
|
318995
|
+
installedService = (cmd) => {
|
|
318996
|
+
assertSystemdAvailable();
|
|
318997
|
+
const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
|
|
318998
|
+
const systemd = new SystemdUserService(serviceName);
|
|
318999
|
+
if (!systemd.installed()) {
|
|
319000
|
+
throw new Error(
|
|
319001
|
+
`The ${serviceName} service is not installed - run \`gcli runner:daemon:install\` first.`
|
|
319002
|
+
);
|
|
319003
|
+
}
|
|
319004
|
+
return { serviceName, systemd };
|
|
319005
|
+
};
|
|
319006
|
+
reportStarted = async (serviceName, systemd, settleMs = 2e3) => {
|
|
319007
|
+
await new Promise((resolve2) => setTimeout(resolve2, settleMs));
|
|
319008
|
+
const { active, exitStatus } = await systemd.outcome();
|
|
319009
|
+
if (active) {
|
|
319010
|
+
Logger.log(`${serviceName} is running. Logs: gcli runner:daemon:logs`);
|
|
319011
|
+
return;
|
|
319012
|
+
}
|
|
319013
|
+
if (exitStatus === RUNNER_AUTH_EXIT_CODE) {
|
|
319014
|
+
throw new Error(
|
|
319015
|
+
`${serviceName} stopped: Lambforge refused this runner's token (deleted, or registered on another server - check ~/.graphql-server/url). Re-register it with \`gcli runner:daemon:install --reset\`.`
|
|
319016
|
+
);
|
|
319017
|
+
}
|
|
319018
|
+
throw new Error(
|
|
319019
|
+
`${serviceName} did not stay up (exit status ${exitStatus ?? "unknown"}). See \`gcli runner:daemon:logs\`.`
|
|
319020
|
+
);
|
|
319021
|
+
};
|
|
319022
|
+
start = async (cmd) => {
|
|
319023
|
+
const { serviceName, systemd } = installedService(cmd);
|
|
319024
|
+
await systemd.start();
|
|
319025
|
+
await reportStarted(serviceName, systemd);
|
|
319026
|
+
};
|
|
319027
|
+
restart = async (cmd) => {
|
|
319028
|
+
const { serviceName, systemd } = installedService(cmd);
|
|
319029
|
+
await systemd.restart();
|
|
319030
|
+
await reportStarted(serviceName, systemd);
|
|
319031
|
+
};
|
|
319032
|
+
stop = async (cmd) => {
|
|
319033
|
+
const { serviceName, systemd } = installedService(cmd);
|
|
319034
|
+
await systemd.stop();
|
|
319035
|
+
Logger.log(
|
|
319036
|
+
`${serviceName} stopped. It starts again with your next login (it stays enabled); \`gcli runner:daemon:uninstall\` removes it.`
|
|
319037
|
+
);
|
|
319038
|
+
};
|
|
318962
319039
|
status = async (cmd) => {
|
|
318963
319040
|
assertSystemdAvailable();
|
|
318964
319041
|
const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
|
|
@@ -319120,9 +319197,9 @@ var init_delete3 = __esm({
|
|
|
319120
319197
|
// src/commands/start/start.ts
|
|
319121
319198
|
var start_exports3 = {};
|
|
319122
319199
|
__export(start_exports3, {
|
|
319123
|
-
default: () =>
|
|
319200
|
+
default: () => start2
|
|
319124
319201
|
});
|
|
319125
|
-
async function
|
|
319202
|
+
async function start2(args) {
|
|
319126
319203
|
Logger.log("---------------------------------");
|
|
319127
319204
|
return (0, import_rxjs46.lastValueFrom)(
|
|
319128
319205
|
loadSpec().pipe(
|
|
@@ -321475,6 +321552,15 @@ function registerRunnerCommands(program2) {
|
|
|
321475
321552
|
"Ollama URL (default: $OLLAMA_HOST or http://127.0.0.1:11434)"
|
|
321476
321553
|
).option("--wsUrl <url>", "Lambforge subscriptions endpoint override").option("--reset", "Forget the saved runner and register a new one").option("--service <name>", "systemd unit name (default: lambforge-runner)").option("--dry-run", "Print the unit file instead of installing it").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.install)));
|
|
321477
321554
|
program2.command("runner:daemon:status").description("Show the runner service status (systemctl --user status)").option("--service <name>", "systemd unit name (default: lambforge-runner)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.status)));
|
|
321555
|
+
program2.command("runner:daemon:start").description(
|
|
321556
|
+
"Start the installed runner service, and report whether it stays up"
|
|
321557
|
+
).option("--service <name>", "systemd unit name (default: lambforge-runner)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.start)));
|
|
321558
|
+
program2.command("runner:daemon:stop").description(
|
|
321559
|
+
"Stop the runner service (it stays installed and starts at your next login)"
|
|
321560
|
+
).option("--service <name>", "systemd unit name (default: lambforge-runner)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.stop)));
|
|
321561
|
+
program2.command("runner:daemon:restart").description(
|
|
321562
|
+
"Restart the runner service (e.g. after `gcli login` to another server)"
|
|
321563
|
+
).option("--service <name>", "systemd unit name (default: lambforge-runner)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.restart)));
|
|
321478
321564
|
program2.command("runner:daemon:logs").description("Follow the runner service log (journalctl --user -f)").option("--service <name>", "systemd unit name (default: lambforge-runner)").option("--lines <n>", "Lines of history to show first (default 50)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.logs)));
|
|
321479
321565
|
program2.command("runner:daemon:uninstall").description(
|
|
321480
321566
|
"Stop and remove the runner service (the runner stays registered)"
|