@typescript-deploys/pr-build 5.3.0-pr-55739-8 → 5.3.0-pr-53714-29
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/lib/tsc.js +77 -60
- package/lib/tsserver.js +87 -88
- package/lib/typescript.d.ts +5 -16
- package/lib/typescript.js +88 -88
- package/lib/typingsInstaller.js +34 -32
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -103,7 +103,6 @@ __export(server_exports, {
|
|
|
103
103
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
104
104
|
InternalSymbolName: () => InternalSymbolName,
|
|
105
105
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
106
|
-
JSDocParsingMode: () => JSDocParsingMode,
|
|
107
106
|
JsDoc: () => ts_JsDoc_exports,
|
|
108
107
|
JsTyping: () => ts_JsTyping_exports,
|
|
109
108
|
JsxEmit: () => JsxEmit,
|
|
@@ -2329,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2329
2328
|
|
|
2330
2329
|
// src/compiler/corePublic.ts
|
|
2331
2330
|
var versionMajorMinor = "5.3";
|
|
2332
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-insiders.20230918`;
|
|
2333
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2334
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2335
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7423,12 +7422,6 @@ var commentPragmas = {
|
|
|
7423
7422
|
kind: 4 /* MultiLine */
|
|
7424
7423
|
}
|
|
7425
7424
|
};
|
|
7426
|
-
var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode8) => {
|
|
7427
|
-
JSDocParsingMode8[JSDocParsingMode8["KeepAll"] = 0] = "KeepAll";
|
|
7428
|
-
JSDocParsingMode8[JSDocParsingMode8["KeepSemanticOnly"] = 1] = "KeepSemanticOnly";
|
|
7429
|
-
JSDocParsingMode8[JSDocParsingMode8["SkipAll"] = 2] = "SkipAll";
|
|
7430
|
-
return JSDocParsingMode8;
|
|
7431
|
-
})(JSDocParsingMode || {});
|
|
7432
7425
|
|
|
7433
7426
|
// src/compiler/sys.ts
|
|
7434
7427
|
function generateDjb2Hash(data) {
|
|
@@ -11967,8 +11960,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11967
11960
|
var tokenFlags;
|
|
11968
11961
|
var commentDirectives;
|
|
11969
11962
|
var inJSDocType = 0;
|
|
11970
|
-
var
|
|
11971
|
-
var jsDocParsingMode = 0 /* KeepAll */;
|
|
11963
|
+
var skipNonSemanticJSDoc = false;
|
|
11972
11964
|
setText(text, start2, length2);
|
|
11973
11965
|
var scanner2 = {
|
|
11974
11966
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -12012,15 +12004,14 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12012
12004
|
setText,
|
|
12013
12005
|
setScriptTarget,
|
|
12014
12006
|
setLanguageVariant,
|
|
12015
|
-
setScriptKind,
|
|
12016
|
-
setJSDocParsingMode,
|
|
12017
12007
|
setOnError,
|
|
12018
12008
|
resetTokenState,
|
|
12019
12009
|
setTextPos: resetTokenState,
|
|
12020
12010
|
setInJSDocType,
|
|
12021
12011
|
tryScan,
|
|
12022
12012
|
lookAhead,
|
|
12023
|
-
scanRange
|
|
12013
|
+
scanRange,
|
|
12014
|
+
setSkipNonSemanticJSDoc
|
|
12024
12015
|
};
|
|
12025
12016
|
if (Debug.isDebugging) {
|
|
12026
12017
|
Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
|
|
@@ -12808,11 +12799,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12808
12799
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
12809
12800
|
}
|
|
12810
12801
|
}
|
|
12811
|
-
if (isJSDoc2) {
|
|
12812
|
-
|
|
12813
|
-
if (shouldParseJSDoc) {
|
|
12814
|
-
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12815
|
-
}
|
|
12802
|
+
if (isJSDoc2 && (!skipNonSemanticJSDoc || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)))) {
|
|
12803
|
+
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12816
12804
|
}
|
|
12817
12805
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
12818
12806
|
if (!commentClosed) {
|
|
@@ -13484,11 +13472,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13484
13472
|
function setLanguageVariant(variant) {
|
|
13485
13473
|
languageVariant = variant;
|
|
13486
13474
|
}
|
|
13487
|
-
function
|
|
13488
|
-
|
|
13489
|
-
}
|
|
13490
|
-
function setJSDocParsingMode(kind) {
|
|
13491
|
-
jsDocParsingMode = kind;
|
|
13475
|
+
function setSkipNonSemanticJSDoc(skip) {
|
|
13476
|
+
skipNonSemanticJSDoc = skip;
|
|
13492
13477
|
}
|
|
13493
13478
|
function resetTokenState(position) {
|
|
13494
13479
|
Debug.assert(position >= 0);
|
|
@@ -30683,7 +30668,7 @@ function gatherPossibleChildren(node) {
|
|
|
30683
30668
|
function setExternalModuleIndicator(sourceFile) {
|
|
30684
30669
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
30685
30670
|
}
|
|
30686
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind,
|
|
30671
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, skipNonSemanticJSDoc) {
|
|
30687
30672
|
var _a, _b, _c, _d;
|
|
30688
30673
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
30689
30674
|
tracing.Phase.Parse,
|
|
@@ -30710,7 +30695,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30710
30695
|
setParentNodes,
|
|
30711
30696
|
6 /* JSON */,
|
|
30712
30697
|
noop,
|
|
30713
|
-
|
|
30698
|
+
skipNonSemanticJSDoc
|
|
30714
30699
|
);
|
|
30715
30700
|
} else {
|
|
30716
30701
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -30726,7 +30711,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30726
30711
|
setParentNodes,
|
|
30727
30712
|
scriptKind,
|
|
30728
30713
|
setIndicator,
|
|
30729
|
-
|
|
30714
|
+
skipNonSemanticJSDoc
|
|
30730
30715
|
);
|
|
30731
30716
|
}
|
|
30732
30717
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -30860,7 +30845,7 @@ var Parser;
|
|
|
30860
30845
|
var contextFlags;
|
|
30861
30846
|
var topLevel = true;
|
|
30862
30847
|
var parseErrorBeforeNextFinishedNode = false;
|
|
30863
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
30848
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, skipNonSemanticJSDoc) {
|
|
30864
30849
|
var _a;
|
|
30865
30850
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
30866
30851
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -30882,8 +30867,9 @@ var Parser;
|
|
|
30882
30867
|
result2.pragmas = emptyMap;
|
|
30883
30868
|
return result2;
|
|
30884
30869
|
}
|
|
30885
|
-
|
|
30886
|
-
|
|
30870
|
+
skipNonSemanticJSDoc = !!skipNonSemanticJSDoc && scriptKind2 !== 1 /* JS */ && scriptKind2 !== 2 /* JSX */;
|
|
30871
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, skipNonSemanticJSDoc);
|
|
30872
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
30887
30873
|
clearState();
|
|
30888
30874
|
return result;
|
|
30889
30875
|
}
|
|
@@ -30896,7 +30882,8 @@ var Parser;
|
|
|
30896
30882
|
/*syntaxCursor*/
|
|
30897
30883
|
void 0,
|
|
30898
30884
|
1 /* JS */,
|
|
30899
|
-
|
|
30885
|
+
/*skipNonSemanticJSDoc*/
|
|
30886
|
+
false
|
|
30900
30887
|
);
|
|
30901
30888
|
nextToken();
|
|
30902
30889
|
const entityName = parseEntityName(
|
|
@@ -30909,7 +30896,15 @@ var Parser;
|
|
|
30909
30896
|
}
|
|
30910
30897
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
30911
30898
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
30912
|
-
initializeState(
|
|
30899
|
+
initializeState(
|
|
30900
|
+
fileName2,
|
|
30901
|
+
sourceText2,
|
|
30902
|
+
languageVersion2,
|
|
30903
|
+
syntaxCursor2,
|
|
30904
|
+
6 /* JSON */,
|
|
30905
|
+
/*skipNonSemanticJSDoc*/
|
|
30906
|
+
false
|
|
30907
|
+
);
|
|
30913
30908
|
sourceFlags = contextFlags;
|
|
30914
30909
|
nextToken();
|
|
30915
30910
|
const pos = getNodePos();
|
|
@@ -30990,7 +30985,7 @@ var Parser;
|
|
|
30990
30985
|
return result;
|
|
30991
30986
|
}
|
|
30992
30987
|
Parser2.parseJsonText = parseJsonText2;
|
|
30993
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
30988
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _skipNonSemanticJSDoc) {
|
|
30994
30989
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
30995
30990
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
30996
30991
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -31026,15 +31021,13 @@ var Parser;
|
|
|
31026
31021
|
scanner2.setOnError(scanError);
|
|
31027
31022
|
scanner2.setScriptTarget(languageVersion);
|
|
31028
31023
|
scanner2.setLanguageVariant(languageVariant);
|
|
31029
|
-
scanner2.
|
|
31030
|
-
scanner2.setJSDocParsingMode(_jsDocParsingMode);
|
|
31024
|
+
scanner2.setSkipNonSemanticJSDoc(_skipNonSemanticJSDoc);
|
|
31031
31025
|
}
|
|
31032
31026
|
function clearState() {
|
|
31033
31027
|
scanner2.clearCommentDirectives();
|
|
31034
31028
|
scanner2.setText("");
|
|
31035
31029
|
scanner2.setOnError(void 0);
|
|
31036
|
-
scanner2.
|
|
31037
|
-
scanner2.setJSDocParsingMode(0 /* KeepAll */);
|
|
31030
|
+
scanner2.setSkipNonSemanticJSDoc(false);
|
|
31038
31031
|
sourceText = void 0;
|
|
31039
31032
|
languageVersion = void 0;
|
|
31040
31033
|
syntaxCursor = void 0;
|
|
@@ -31048,7 +31041,7 @@ var Parser;
|
|
|
31048
31041
|
notParenthesizedArrow = void 0;
|
|
31049
31042
|
topLevel = true;
|
|
31050
31043
|
}
|
|
31051
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
31044
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, skipNonSemanticJSDoc) {
|
|
31052
31045
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
31053
31046
|
if (isDeclarationFile) {
|
|
31054
31047
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -31067,7 +31060,7 @@ var Parser;
|
|
|
31067
31060
|
sourceFile.identifierCount = identifierCount;
|
|
31068
31061
|
sourceFile.identifiers = identifiers;
|
|
31069
31062
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
31070
|
-
sourceFile.
|
|
31063
|
+
sourceFile.skipNonSemanticJSDoc = skipNonSemanticJSDoc;
|
|
31071
31064
|
if (jsDocDiagnostics) {
|
|
31072
31065
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
31073
31066
|
}
|
|
@@ -36502,7 +36495,8 @@ var Parser;
|
|
|
36502
36495
|
/*syntaxCursor*/
|
|
36503
36496
|
void 0,
|
|
36504
36497
|
1 /* JS */,
|
|
36505
|
-
|
|
36498
|
+
/*skipNonSemanticJSDoc*/
|
|
36499
|
+
false
|
|
36506
36500
|
);
|
|
36507
36501
|
scanner2.setText(content, start2, length2);
|
|
36508
36502
|
currentToken = scanner2.scan();
|
|
@@ -36567,7 +36561,8 @@ var Parser;
|
|
|
36567
36561
|
/*syntaxCursor*/
|
|
36568
36562
|
void 0,
|
|
36569
36563
|
1 /* JS */,
|
|
36570
|
-
|
|
36564
|
+
/*skipNonSemanticJSDoc*/
|
|
36565
|
+
false
|
|
36571
36566
|
);
|
|
36572
36567
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start2, length2));
|
|
36573
36568
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -37524,7 +37519,7 @@ var IncrementalParser;
|
|
|
37524
37519
|
true,
|
|
37525
37520
|
sourceFile.scriptKind,
|
|
37526
37521
|
sourceFile.setExternalModuleIndicator,
|
|
37527
|
-
sourceFile.
|
|
37522
|
+
sourceFile.skipNonSemanticJSDoc
|
|
37528
37523
|
);
|
|
37529
37524
|
}
|
|
37530
37525
|
const incrementalSourceFile = sourceFile;
|
|
@@ -37549,7 +37544,7 @@ var IncrementalParser;
|
|
|
37549
37544
|
true,
|
|
37550
37545
|
sourceFile.scriptKind,
|
|
37551
37546
|
sourceFile.setExternalModuleIndicator,
|
|
37552
|
-
sourceFile.
|
|
37547
|
+
sourceFile.skipNonSemanticJSDoc
|
|
37553
37548
|
);
|
|
37554
37549
|
result.commentDirectives = getNewCommentDirectives(
|
|
37555
37550
|
sourceFile.commentDirectives,
|
|
@@ -44582,7 +44577,7 @@ function createBinder() {
|
|
|
44582
44577
|
case 36 /* ExclamationEqualsToken */:
|
|
44583
44578
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
44584
44579
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
44585
|
-
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
|
|
44580
|
+
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
|
|
44586
44581
|
case 104 /* InstanceOfKeyword */:
|
|
44587
44582
|
return isNarrowableOperand(expr.left);
|
|
44588
44583
|
case 103 /* InKeyword */:
|
|
@@ -44902,7 +44897,7 @@ function createBinder() {
|
|
|
44902
44897
|
}
|
|
44903
44898
|
function bindCaseBlock(node) {
|
|
44904
44899
|
const clauses = node.clauses;
|
|
44905
|
-
const isNarrowingSwitch = isNarrowingExpression(node.parent.expression);
|
|
44900
|
+
const isNarrowingSwitch = node.parent.expression.kind === 112 /* TrueKeyword */ || isNarrowingExpression(node.parent.expression);
|
|
44906
44901
|
let fallthroughFlow = unreachableFlow;
|
|
44907
44902
|
for (let i = 0; i < clauses.length; i++) {
|
|
44908
44903
|
const clauseStart = i;
|
|
@@ -70254,6 +70249,17 @@ function createTypeChecker(host) {
|
|
|
70254
70249
|
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
70255
70250
|
} else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
|
|
70256
70251
|
type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
70252
|
+
} else if (expr.kind === 112 /* TrueKeyword */) {
|
|
70253
|
+
const clause = flow.switchStatement.caseBlock.clauses.find((_, index) => index === flow.clauseStart);
|
|
70254
|
+
const clauseExpression = clause && clause.kind === 296 /* CaseClause */ ? clause.expression : void 0;
|
|
70255
|
+
if (clauseExpression) {
|
|
70256
|
+
type = narrowType(
|
|
70257
|
+
type,
|
|
70258
|
+
clauseExpression,
|
|
70259
|
+
/*assumeTrue*/
|
|
70260
|
+
true
|
|
70261
|
+
);
|
|
70262
|
+
}
|
|
70257
70263
|
} else {
|
|
70258
70264
|
if (strictNullChecks) {
|
|
70259
70265
|
if (optionalChainContainsReference(expr, reference)) {
|
|
@@ -70501,6 +70507,10 @@ function createTypeChecker(host) {
|
|
|
70501
70507
|
}
|
|
70502
70508
|
return type;
|
|
70503
70509
|
}
|
|
70510
|
+
function narrowTypeByBooleanComparison(type, expr, bool, operator, assumeTrue) {
|
|
70511
|
+
assumeTrue = assumeTrue !== (bool.kind === 112 /* TrueKeyword */) !== (operator !== 38 /* ExclamationEqualsEqualsToken */ && operator !== 36 /* ExclamationEqualsToken */);
|
|
70512
|
+
return narrowType(type, expr, assumeTrue);
|
|
70513
|
+
}
|
|
70504
70514
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
70505
70515
|
switch (expr.operatorToken.kind) {
|
|
70506
70516
|
case 64 /* EqualsToken */:
|
|
@@ -70548,6 +70558,12 @@ function createTypeChecker(host) {
|
|
|
70548
70558
|
if (isMatchingConstructorReference(right)) {
|
|
70549
70559
|
return narrowTypeByConstructor(type, operator, left, assumeTrue);
|
|
70550
70560
|
}
|
|
70561
|
+
if (isBooleanLiteral(right)) {
|
|
70562
|
+
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
|
|
70563
|
+
}
|
|
70564
|
+
if (isBooleanLiteral(left)) {
|
|
70565
|
+
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
|
|
70566
|
+
}
|
|
70551
70567
|
break;
|
|
70552
70568
|
case 104 /* InstanceOfKeyword */:
|
|
70553
70569
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
@@ -119753,16 +119769,10 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
119753
119769
|
}
|
|
119754
119770
|
return getPathFromPathComponents(commonPathComponents);
|
|
119755
119771
|
}
|
|
119756
|
-
function createCompilerHost(options, setParentNodes
|
|
119757
|
-
return createCompilerHostWorker(
|
|
119758
|
-
options,
|
|
119759
|
-
setParentNodes,
|
|
119760
|
-
/*system*/
|
|
119761
|
-
void 0,
|
|
119762
|
-
jsDocParsingMode
|
|
119763
|
-
);
|
|
119772
|
+
function createCompilerHost(options, setParentNodes) {
|
|
119773
|
+
return createCompilerHostWorker(options, setParentNodes);
|
|
119764
119774
|
}
|
|
119765
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes,
|
|
119775
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipNonSemanticJSDocParsing) {
|
|
119766
119776
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
119767
119777
|
let text;
|
|
119768
119778
|
try {
|
|
@@ -119783,7 +119793,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, jsDoc
|
|
|
119783
119793
|
setParentNodes,
|
|
119784
119794
|
/*scriptKind*/
|
|
119785
119795
|
void 0,
|
|
119786
|
-
|
|
119796
|
+
skipNonSemanticJSDocParsing
|
|
119787
119797
|
) : void 0;
|
|
119788
119798
|
};
|
|
119789
119799
|
}
|
|
@@ -119808,7 +119818,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
119808
119818
|
}
|
|
119809
119819
|
};
|
|
119810
119820
|
}
|
|
119811
|
-
function createCompilerHostWorker(options, setParentNodes, system = sys
|
|
119821
|
+
function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocParsing, system = sys) {
|
|
119812
119822
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
119813
119823
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
119814
119824
|
function directoryExists(directoryPath) {
|
|
@@ -119827,7 +119837,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys, jsDocPa
|
|
|
119827
119837
|
const newLine = getNewLineCharacter(options);
|
|
119828
119838
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
119829
119839
|
const compilerHost = {
|
|
119830
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes,
|
|
119840
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, skipNonSemanticJSDocParsing),
|
|
119831
119841
|
getDefaultLibLocation,
|
|
119832
119842
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
119833
119843
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -126968,7 +126978,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126968
126978
|
getCompilerOptions,
|
|
126969
126979
|
/*setParentNodes*/
|
|
126970
126980
|
void 0,
|
|
126971
|
-
host.
|
|
126981
|
+
host.skipNonSemanticJSDocParsing
|
|
126972
126982
|
),
|
|
126973
126983
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
126974
126984
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -127154,13 +127164,13 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
127154
127164
|
return void 0;
|
|
127155
127165
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
127156
127166
|
}
|
|
127157
|
-
function createIncrementalCompilerHost(options, system = sys,
|
|
127167
|
+
function createIncrementalCompilerHost(options, system = sys, skipNonSemanticJSDocParsing) {
|
|
127158
127168
|
const host = createCompilerHostWorker(
|
|
127159
127169
|
options,
|
|
127160
127170
|
/*setParentNodes*/
|
|
127161
127171
|
void 0,
|
|
127162
|
-
|
|
127163
|
-
|
|
127172
|
+
skipNonSemanticJSDocParsing,
|
|
127173
|
+
system
|
|
127164
127174
|
);
|
|
127165
127175
|
host.createHash = maybeBind(system, system.createHash);
|
|
127166
127176
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
@@ -135083,10 +135093,10 @@ var DocumentHighlights;
|
|
|
135083
135093
|
function isDocumentRegistryEntry(entry) {
|
|
135084
135094
|
return !!entry.sourceFile;
|
|
135085
135095
|
}
|
|
135086
|
-
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory
|
|
135087
|
-
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory
|
|
135096
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
135097
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
135088
135098
|
}
|
|
135089
|
-
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "",
|
|
135099
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
135090
135100
|
const buckets = /* @__PURE__ */ new Map();
|
|
135091
135101
|
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
135092
135102
|
function reportStats() {
|
|
@@ -135206,8 +135216,7 @@ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirec
|
|
|
135206
135216
|
version2,
|
|
135207
135217
|
/*setNodeParents*/
|
|
135208
135218
|
false,
|
|
135209
|
-
scriptKind
|
|
135210
|
-
jsDocParsingMode
|
|
135219
|
+
scriptKind
|
|
135211
135220
|
);
|
|
135212
135221
|
if (externalCache) {
|
|
135213
135222
|
externalCache.setDocument(keyWithMode, path, sourceFile);
|
|
@@ -136594,12 +136603,7 @@ function transpileModule(input, transpileOptions) {
|
|
|
136594
136603
|
options
|
|
136595
136604
|
),
|
|
136596
136605
|
setExternalModuleIndicator: getSetExternalModuleIndicator(options)
|
|
136597
|
-
}
|
|
136598
|
-
/*setParentNodes*/
|
|
136599
|
-
void 0,
|
|
136600
|
-
/*scriptKind*/
|
|
136601
|
-
void 0,
|
|
136602
|
-
2 /* SkipAll */
|
|
136606
|
+
}
|
|
136603
136607
|
);
|
|
136604
136608
|
if (transpileOptions.moduleName) {
|
|
136605
136609
|
sourceFile.moduleName = transpileOptions.moduleName;
|
|
@@ -143798,8 +143802,7 @@ var SyntaxTreeCache = class {
|
|
|
143798
143802
|
version2,
|
|
143799
143803
|
/*setNodeParents*/
|
|
143800
143804
|
true,
|
|
143801
|
-
scriptKind
|
|
143802
|
-
this.host.jsDocParsingMode
|
|
143805
|
+
scriptKind
|
|
143803
143806
|
);
|
|
143804
143807
|
} else if (this.currentFileVersion !== version2) {
|
|
143805
143808
|
const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
|
|
@@ -143818,8 +143821,8 @@ function setSourceFileFields(sourceFile, scriptSnapshot, version2) {
|
|
|
143818
143821
|
sourceFile.version = version2;
|
|
143819
143822
|
sourceFile.scriptSnapshot = scriptSnapshot;
|
|
143820
143823
|
}
|
|
143821
|
-
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind
|
|
143822
|
-
const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind
|
|
143824
|
+
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind) {
|
|
143825
|
+
const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind);
|
|
143823
143826
|
setSourceFileFields(sourceFile, scriptSnapshot, version2);
|
|
143824
143827
|
return sourceFile;
|
|
143825
143828
|
}
|
|
@@ -143859,8 +143862,7 @@ function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, t
|
|
|
143859
143862
|
version2,
|
|
143860
143863
|
/*setNodeParents*/
|
|
143861
143864
|
true,
|
|
143862
|
-
sourceFile.scriptKind
|
|
143863
|
-
sourceFile.jsDocParsingMode
|
|
143865
|
+
sourceFile.scriptKind
|
|
143864
143866
|
);
|
|
143865
143867
|
}
|
|
143866
143868
|
var NoopCancellationToken = {
|
|
@@ -151117,7 +151119,6 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
|
|
|
151117
151119
|
if (aliasDeclaration.isTypeOnly) {
|
|
151118
151120
|
const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements, preferences);
|
|
151119
151121
|
if (aliasDeclaration.parent.elements.length > 1 && sortKind) {
|
|
151120
|
-
changes.delete(sourceFile, aliasDeclaration);
|
|
151121
151122
|
const newSpecifier = factory.updateImportSpecifier(
|
|
151122
151123
|
aliasDeclaration,
|
|
151123
151124
|
/*isTypeOnly*/
|
|
@@ -151127,10 +151128,13 @@ function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceF
|
|
|
151127
151128
|
);
|
|
151128
151129
|
const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, sortKind === 2 /* CaseInsensitive */);
|
|
151129
151130
|
const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer);
|
|
151130
|
-
|
|
151131
|
-
|
|
151132
|
-
|
|
151131
|
+
if (aliasDeclaration.parent.elements.indexOf(aliasDeclaration) !== insertionIndex) {
|
|
151132
|
+
changes.delete(sourceFile, aliasDeclaration);
|
|
151133
|
+
changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex);
|
|
151134
|
+
return aliasDeclaration;
|
|
151135
|
+
}
|
|
151133
151136
|
}
|
|
151137
|
+
changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken());
|
|
151134
151138
|
return aliasDeclaration;
|
|
151135
151139
|
} else {
|
|
151136
151140
|
Debug.assert(aliasDeclaration.parent.parent.isTypeOnly);
|
|
@@ -168995,8 +168999,7 @@ var changesToText;
|
|
|
168995
168999
|
99 /* ESNext */,
|
|
168996
169000
|
/*setParentNodes*/
|
|
168997
169001
|
true,
|
|
168998
|
-
scriptKind
|
|
168999
|
-
2 /* SkipAll */
|
|
169002
|
+
scriptKind
|
|
169000
169003
|
);
|
|
169001
169004
|
const changes = ts_formatting_exports.formatDocument(sourceFile, formatContext);
|
|
169002
169005
|
return applyChanges(nonFormattedText, changes) + newLineCharacter;
|
|
@@ -172278,7 +172281,6 @@ __export(ts_exports2, {
|
|
|
172278
172281
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
172279
172282
|
InternalSymbolName: () => InternalSymbolName,
|
|
172280
172283
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
172281
|
-
JSDocParsingMode: () => JSDocParsingMode,
|
|
172282
172284
|
JsDoc: () => ts_JsDoc_exports,
|
|
172283
172285
|
JsTyping: () => ts_JsTyping_exports,
|
|
172284
172286
|
JsxEmit: () => JsxEmit,
|
|
@@ -176247,7 +176249,6 @@ var Project3 = class _Project {
|
|
|
176247
176249
|
this.directoryStructureHost = directoryStructureHost;
|
|
176248
176250
|
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
|
|
176249
176251
|
this.getCanonicalFileName = this.projectService.toCanonicalFileName;
|
|
176250
|
-
this.jsDocParsingMode = this.projectService.jsDocParsingMode;
|
|
176251
176252
|
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
|
176252
176253
|
if (!this.compilerOptions) {
|
|
176253
176254
|
this.compilerOptions = getDefaultCompilerOptions2();
|
|
@@ -178806,7 +178807,6 @@ var _ProjectService = class _ProjectService {
|
|
|
178806
178807
|
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
|
|
178807
178808
|
this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
|
|
178808
178809
|
this.session = opts.session;
|
|
178809
|
-
this.jsDocParsingMode = opts.jsDocParsingMode;
|
|
178810
178810
|
if (opts.serverMode !== void 0) {
|
|
178811
178811
|
this.serverMode = opts.serverMode;
|
|
178812
178812
|
} else {
|
|
@@ -178832,7 +178832,7 @@ var _ProjectService = class _ProjectService {
|
|
|
178832
178832
|
hostInfo: "Unknown host",
|
|
178833
178833
|
extraFileExtensions: []
|
|
178834
178834
|
};
|
|
178835
|
-
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this
|
|
178835
|
+
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
|
|
178836
178836
|
const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
|
|
178837
178837
|
const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
|
|
178838
178838
|
this.packageJsonCache = createPackageJsonCache(this);
|
|
@@ -186843,7 +186843,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
186843
186843
|
InternalEmitFlags,
|
|
186844
186844
|
InternalSymbolName,
|
|
186845
186845
|
InvalidatedProjectKind,
|
|
186846
|
-
JSDocParsingMode,
|
|
186847
186846
|
JsDoc,
|
|
186848
186847
|
JsTyping,
|
|
186849
186848
|
JsxEmit,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -3616,7 +3616,6 @@ declare namespace ts {
|
|
|
3616
3616
|
typesMapLocation?: string;
|
|
3617
3617
|
serverMode?: LanguageServiceMode;
|
|
3618
3618
|
session: Session<unknown> | undefined;
|
|
3619
|
-
jsDocParsingMode?: JSDocParsingMode;
|
|
3620
3619
|
}
|
|
3621
3620
|
interface WatchOptionsAndErrors {
|
|
3622
3621
|
watchOptions: WatchOptions;
|
|
@@ -3691,7 +3690,6 @@ declare namespace ts {
|
|
|
3691
3690
|
private performanceEventHandler?;
|
|
3692
3691
|
private pendingPluginEnablements?;
|
|
3693
3692
|
private currentPluginEnablementPromise?;
|
|
3694
|
-
readonly jsDocParsingMode: JSDocParsingMode | undefined;
|
|
3695
3693
|
constructor(opts: ProjectServiceOptions);
|
|
3696
3694
|
toPath(fileName: string): Path;
|
|
3697
3695
|
private loadTypesMap;
|
|
@@ -8609,11 +8607,6 @@ declare namespace ts {
|
|
|
8609
8607
|
IndexSignatureParameters = 8848,
|
|
8610
8608
|
JSDocComment = 33,
|
|
8611
8609
|
}
|
|
8612
|
-
enum JSDocParsingMode {
|
|
8613
|
-
KeepAll = 0,
|
|
8614
|
-
KeepSemanticOnly = 1,
|
|
8615
|
-
SkipAll = 2,
|
|
8616
|
-
}
|
|
8617
8610
|
interface UserPreferences {
|
|
8618
8611
|
readonly disableSuggestions?: boolean;
|
|
8619
8612
|
readonly quotePreference?: "auto" | "double" | "single";
|
|
@@ -8775,8 +8768,6 @@ declare namespace ts {
|
|
|
8775
8768
|
setOnError(onError: ErrorCallback | undefined): void;
|
|
8776
8769
|
setScriptTarget(scriptTarget: ScriptTarget): void;
|
|
8777
8770
|
setLanguageVariant(variant: LanguageVariant): void;
|
|
8778
|
-
setScriptKind(scriptKind: ScriptKind): void;
|
|
8779
|
-
setJSDocParsingMode(kind: JSDocParsingMode): void;
|
|
8780
8771
|
/** @deprecated use {@link resetTokenState} */
|
|
8781
8772
|
setTextPos(textPos: number): void;
|
|
8782
8773
|
resetTokenState(pos: number): void;
|
|
@@ -9422,7 +9413,7 @@ declare namespace ts {
|
|
|
9422
9413
|
* that they appear in the source code. The language service depends on this property to locate nodes by position.
|
|
9423
9414
|
*/
|
|
9424
9415
|
function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
|
|
9425
|
-
function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind
|
|
9416
|
+
function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
|
|
9426
9417
|
function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
|
|
9427
9418
|
/**
|
|
9428
9419
|
* Parse json text into SyntaxTree and return node and parse errors if any
|
|
@@ -9727,7 +9718,7 @@ declare namespace ts {
|
|
|
9727
9718
|
function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
|
|
9728
9719
|
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
|
|
9729
9720
|
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
|
9730
|
-
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean
|
|
9721
|
+
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
|
9731
9722
|
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
|
|
9732
9723
|
function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
|
|
9733
9724
|
function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
|
|
@@ -9939,7 +9930,7 @@ declare namespace ts {
|
|
|
9939
9930
|
emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
|
|
9940
9931
|
}
|
|
9941
9932
|
function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
|
|
9942
|
-
function createIncrementalCompilerHost(options: CompilerOptions, system?: System
|
|
9933
|
+
function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
|
|
9943
9934
|
function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
|
|
9944
9935
|
/**
|
|
9945
9936
|
* Create the watch compiler host for either configFile or fileNames and its options
|
|
@@ -10036,7 +10027,6 @@ declare namespace ts {
|
|
|
10036
10027
|
* Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
|
|
10037
10028
|
*/
|
|
10038
10029
|
getModuleResolutionCache?(): ModuleResolutionCache | undefined;
|
|
10039
|
-
jsDocParsingMode?: JSDocParsingMode;
|
|
10040
10030
|
}
|
|
10041
10031
|
interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
|
|
10042
10032
|
/** Instead of using output d.ts file from project reference, use its source file */
|
|
@@ -10287,7 +10277,6 @@ declare namespace ts {
|
|
|
10287
10277
|
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
|
10288
10278
|
writeFile?(fileName: string, content: string): void;
|
|
10289
10279
|
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
|
10290
|
-
jsDocParsingMode?: JSDocParsingMode;
|
|
10291
10280
|
}
|
|
10292
10281
|
type WithMetadata<T> = T & {
|
|
10293
10282
|
metadata?: unknown;
|
|
@@ -11385,7 +11374,7 @@ declare namespace ts {
|
|
|
11385
11374
|
fileName: string;
|
|
11386
11375
|
highlightSpans: HighlightSpan[];
|
|
11387
11376
|
}
|
|
11388
|
-
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string
|
|
11377
|
+
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
|
|
11389
11378
|
/**
|
|
11390
11379
|
* The document registry represents a store of SourceFile objects that can be shared between
|
|
11391
11380
|
* multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
|
|
@@ -11493,7 +11482,7 @@ declare namespace ts {
|
|
|
11493
11482
|
function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
|
|
11494
11483
|
function getDefaultCompilerOptions(): CompilerOptions;
|
|
11495
11484
|
function getSupportedCodeFixes(): readonly string[];
|
|
11496
|
-
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind
|
|
11485
|
+
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
|
|
11497
11486
|
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
|
|
11498
11487
|
function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
|
|
11499
11488
|
/**
|