@typescript-deploys/pr-build 5.3.0-pr-53681-19 → 5.3.0-pr-55739-8
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 +58 -65
- package/lib/tsserver.js +82 -69
- package/lib/typescript.d.ts +16 -5
- package/lib/typescript.js +82 -70
- package/lib/typingsInstaller.js +31 -33
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -103,6 +103,7 @@ __export(server_exports, {
|
|
|
103
103
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
104
104
|
InternalSymbolName: () => InternalSymbolName,
|
|
105
105
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
106
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
106
107
|
JsDoc: () => ts_JsDoc_exports,
|
|
107
108
|
JsTyping: () => ts_JsTyping_exports,
|
|
108
109
|
JsxEmit: () => JsxEmit,
|
|
@@ -7422,6 +7423,12 @@ var commentPragmas = {
|
|
|
7422
7423
|
kind: 4 /* MultiLine */
|
|
7423
7424
|
}
|
|
7424
7425
|
};
|
|
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 || {});
|
|
7425
7432
|
|
|
7426
7433
|
// src/compiler/sys.ts
|
|
7427
7434
|
function generateDjb2Hash(data) {
|
|
@@ -11960,7 +11967,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11960
11967
|
var tokenFlags;
|
|
11961
11968
|
var commentDirectives;
|
|
11962
11969
|
var inJSDocType = 0;
|
|
11963
|
-
var
|
|
11970
|
+
var scriptKind = 0 /* Unknown */;
|
|
11971
|
+
var jsDocParsingMode = 0 /* KeepAll */;
|
|
11964
11972
|
setText(text, start2, length2);
|
|
11965
11973
|
var scanner2 = {
|
|
11966
11974
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -12004,14 +12012,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12004
12012
|
setText,
|
|
12005
12013
|
setScriptTarget,
|
|
12006
12014
|
setLanguageVariant,
|
|
12015
|
+
setScriptKind,
|
|
12016
|
+
setJSDocParsingMode,
|
|
12007
12017
|
setOnError,
|
|
12008
12018
|
resetTokenState,
|
|
12009
12019
|
setTextPos: resetTokenState,
|
|
12010
12020
|
setInJSDocType,
|
|
12011
12021
|
tryScan,
|
|
12012
12022
|
lookAhead,
|
|
12013
|
-
scanRange
|
|
12014
|
-
setSkipNonSemanticJSDoc
|
|
12023
|
+
scanRange
|
|
12015
12024
|
};
|
|
12016
12025
|
if (Debug.isDebugging) {
|
|
12017
12026
|
Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
|
|
@@ -12799,8 +12808,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12799
12808
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
12800
12809
|
}
|
|
12801
12810
|
}
|
|
12802
|
-
if (isJSDoc2
|
|
12803
|
-
|
|
12811
|
+
if (isJSDoc2) {
|
|
12812
|
+
const shouldParseJSDoc = jsDocParsingMode === 2 /* SkipAll */ ? false : jsDocParsingMode === 1 /* KeepSemanticOnly */ ? scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */ || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)) : true;
|
|
12813
|
+
if (shouldParseJSDoc) {
|
|
12814
|
+
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12815
|
+
}
|
|
12804
12816
|
}
|
|
12805
12817
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
12806
12818
|
if (!commentClosed) {
|
|
@@ -13472,8 +13484,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13472
13484
|
function setLanguageVariant(variant) {
|
|
13473
13485
|
languageVariant = variant;
|
|
13474
13486
|
}
|
|
13475
|
-
function
|
|
13476
|
-
|
|
13487
|
+
function setScriptKind(kind) {
|
|
13488
|
+
scriptKind = kind;
|
|
13489
|
+
}
|
|
13490
|
+
function setJSDocParsingMode(kind) {
|
|
13491
|
+
jsDocParsingMode = kind;
|
|
13477
13492
|
}
|
|
13478
13493
|
function resetTokenState(position) {
|
|
13479
13494
|
Debug.assert(position >= 0);
|
|
@@ -30668,7 +30683,7 @@ function gatherPossibleChildren(node) {
|
|
|
30668
30683
|
function setExternalModuleIndicator(sourceFile) {
|
|
30669
30684
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
30670
30685
|
}
|
|
30671
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind,
|
|
30686
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, jsDocParsingMode) {
|
|
30672
30687
|
var _a, _b, _c, _d;
|
|
30673
30688
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
30674
30689
|
tracing.Phase.Parse,
|
|
@@ -30695,7 +30710,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30695
30710
|
setParentNodes,
|
|
30696
30711
|
6 /* JSON */,
|
|
30697
30712
|
noop,
|
|
30698
|
-
|
|
30713
|
+
jsDocParsingMode
|
|
30699
30714
|
);
|
|
30700
30715
|
} else {
|
|
30701
30716
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -30711,7 +30726,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30711
30726
|
setParentNodes,
|
|
30712
30727
|
scriptKind,
|
|
30713
30728
|
setIndicator,
|
|
30714
|
-
|
|
30729
|
+
jsDocParsingMode
|
|
30715
30730
|
);
|
|
30716
30731
|
}
|
|
30717
30732
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -30845,7 +30860,7 @@ var Parser;
|
|
|
30845
30860
|
var contextFlags;
|
|
30846
30861
|
var topLevel = true;
|
|
30847
30862
|
var parseErrorBeforeNextFinishedNode = false;
|
|
30848
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
30863
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* KeepAll */) {
|
|
30849
30864
|
var _a;
|
|
30850
30865
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
30851
30866
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -30867,9 +30882,8 @@ var Parser;
|
|
|
30867
30882
|
result2.pragmas = emptyMap;
|
|
30868
30883
|
return result2;
|
|
30869
30884
|
}
|
|
30870
|
-
|
|
30871
|
-
|
|
30872
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
30885
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
30886
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
30873
30887
|
clearState();
|
|
30874
30888
|
return result;
|
|
30875
30889
|
}
|
|
@@ -30882,8 +30896,7 @@ var Parser;
|
|
|
30882
30896
|
/*syntaxCursor*/
|
|
30883
30897
|
void 0,
|
|
30884
30898
|
1 /* JS */,
|
|
30885
|
-
/*
|
|
30886
|
-
false
|
|
30899
|
+
0 /* KeepAll */
|
|
30887
30900
|
);
|
|
30888
30901
|
nextToken();
|
|
30889
30902
|
const entityName = parseEntityName(
|
|
@@ -30896,15 +30909,7 @@ var Parser;
|
|
|
30896
30909
|
}
|
|
30897
30910
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
30898
30911
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
30899
|
-
initializeState(
|
|
30900
|
-
fileName2,
|
|
30901
|
-
sourceText2,
|
|
30902
|
-
languageVersion2,
|
|
30903
|
-
syntaxCursor2,
|
|
30904
|
-
6 /* JSON */,
|
|
30905
|
-
/*skipNonSemanticJSDoc*/
|
|
30906
|
-
false
|
|
30907
|
-
);
|
|
30912
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* KeepAll */);
|
|
30908
30913
|
sourceFlags = contextFlags;
|
|
30909
30914
|
nextToken();
|
|
30910
30915
|
const pos = getNodePos();
|
|
@@ -30985,7 +30990,7 @@ var Parser;
|
|
|
30985
30990
|
return result;
|
|
30986
30991
|
}
|
|
30987
30992
|
Parser2.parseJsonText = parseJsonText2;
|
|
30988
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
30993
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
30989
30994
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
30990
30995
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
30991
30996
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -31021,13 +31026,15 @@ var Parser;
|
|
|
31021
31026
|
scanner2.setOnError(scanError);
|
|
31022
31027
|
scanner2.setScriptTarget(languageVersion);
|
|
31023
31028
|
scanner2.setLanguageVariant(languageVariant);
|
|
31024
|
-
scanner2.
|
|
31029
|
+
scanner2.setScriptKind(scriptKind);
|
|
31030
|
+
scanner2.setJSDocParsingMode(_jsDocParsingMode);
|
|
31025
31031
|
}
|
|
31026
31032
|
function clearState() {
|
|
31027
31033
|
scanner2.clearCommentDirectives();
|
|
31028
31034
|
scanner2.setText("");
|
|
31029
31035
|
scanner2.setOnError(void 0);
|
|
31030
|
-
scanner2.
|
|
31036
|
+
scanner2.setScriptKind(0 /* Unknown */);
|
|
31037
|
+
scanner2.setJSDocParsingMode(0 /* KeepAll */);
|
|
31031
31038
|
sourceText = void 0;
|
|
31032
31039
|
languageVersion = void 0;
|
|
31033
31040
|
syntaxCursor = void 0;
|
|
@@ -31041,7 +31048,7 @@ var Parser;
|
|
|
31041
31048
|
notParenthesizedArrow = void 0;
|
|
31042
31049
|
topLevel = true;
|
|
31043
31050
|
}
|
|
31044
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
31051
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
31045
31052
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
31046
31053
|
if (isDeclarationFile) {
|
|
31047
31054
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -31060,7 +31067,7 @@ var Parser;
|
|
|
31060
31067
|
sourceFile.identifierCount = identifierCount;
|
|
31061
31068
|
sourceFile.identifiers = identifiers;
|
|
31062
31069
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
31063
|
-
sourceFile.
|
|
31070
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
31064
31071
|
if (jsDocDiagnostics) {
|
|
31065
31072
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
31066
31073
|
}
|
|
@@ -36495,8 +36502,7 @@ var Parser;
|
|
|
36495
36502
|
/*syntaxCursor*/
|
|
36496
36503
|
void 0,
|
|
36497
36504
|
1 /* JS */,
|
|
36498
|
-
/*
|
|
36499
|
-
false
|
|
36505
|
+
0 /* KeepAll */
|
|
36500
36506
|
);
|
|
36501
36507
|
scanner2.setText(content, start2, length2);
|
|
36502
36508
|
currentToken = scanner2.scan();
|
|
@@ -36561,8 +36567,7 @@ var Parser;
|
|
|
36561
36567
|
/*syntaxCursor*/
|
|
36562
36568
|
void 0,
|
|
36563
36569
|
1 /* JS */,
|
|
36564
|
-
/*
|
|
36565
|
-
false
|
|
36570
|
+
0 /* KeepAll */
|
|
36566
36571
|
);
|
|
36567
36572
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start2, length2));
|
|
36568
36573
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -37519,7 +37524,7 @@ var IncrementalParser;
|
|
|
37519
37524
|
true,
|
|
37520
37525
|
sourceFile.scriptKind,
|
|
37521
37526
|
sourceFile.setExternalModuleIndicator,
|
|
37522
|
-
sourceFile.
|
|
37527
|
+
sourceFile.jsDocParsingMode
|
|
37523
37528
|
);
|
|
37524
37529
|
}
|
|
37525
37530
|
const incrementalSourceFile = sourceFile;
|
|
@@ -37544,7 +37549,7 @@ var IncrementalParser;
|
|
|
37544
37549
|
true,
|
|
37545
37550
|
sourceFile.scriptKind,
|
|
37546
37551
|
sourceFile.setExternalModuleIndicator,
|
|
37547
|
-
sourceFile.
|
|
37552
|
+
sourceFile.jsDocParsingMode
|
|
37548
37553
|
);
|
|
37549
37554
|
result.commentDirectives = getNewCommentDirectives(
|
|
37550
37555
|
sourceFile.commentDirectives,
|
|
@@ -44897,7 +44902,7 @@ function createBinder() {
|
|
|
44897
44902
|
}
|
|
44898
44903
|
function bindCaseBlock(node) {
|
|
44899
44904
|
const clauses = node.clauses;
|
|
44900
|
-
const isNarrowingSwitch =
|
|
44905
|
+
const isNarrowingSwitch = isNarrowingExpression(node.parent.expression);
|
|
44901
44906
|
let fallthroughFlow = unreachableFlow;
|
|
44902
44907
|
for (let i = 0; i < clauses.length; i++) {
|
|
44903
44908
|
const clauseStart = i;
|
|
@@ -70249,17 +70254,6 @@ function createTypeChecker(host) {
|
|
|
70249
70254
|
type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
70250
70255
|
} else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
|
|
70251
70256
|
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
|
-
}
|
|
70263
70257
|
} else {
|
|
70264
70258
|
if (strictNullChecks) {
|
|
70265
70259
|
if (optionalChainContainsReference(expr, reference)) {
|
|
@@ -119759,10 +119753,16 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
119759
119753
|
}
|
|
119760
119754
|
return getPathFromPathComponents(commonPathComponents);
|
|
119761
119755
|
}
|
|
119762
|
-
function createCompilerHost(options, setParentNodes) {
|
|
119763
|
-
return createCompilerHostWorker(
|
|
119756
|
+
function createCompilerHost(options, setParentNodes, jsDocParsingMode) {
|
|
119757
|
+
return createCompilerHostWorker(
|
|
119758
|
+
options,
|
|
119759
|
+
setParentNodes,
|
|
119760
|
+
/*system*/
|
|
119761
|
+
void 0,
|
|
119762
|
+
jsDocParsingMode
|
|
119763
|
+
);
|
|
119764
119764
|
}
|
|
119765
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes,
|
|
119765
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, jsDocParsingMode) {
|
|
119766
119766
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
119767
119767
|
let text;
|
|
119768
119768
|
try {
|
|
@@ -119783,7 +119783,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
119783
119783
|
setParentNodes,
|
|
119784
119784
|
/*scriptKind*/
|
|
119785
119785
|
void 0,
|
|
119786
|
-
|
|
119786
|
+
jsDocParsingMode
|
|
119787
119787
|
) : void 0;
|
|
119788
119788
|
};
|
|
119789
119789
|
}
|
|
@@ -119808,7 +119808,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
119808
119808
|
}
|
|
119809
119809
|
};
|
|
119810
119810
|
}
|
|
119811
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
119811
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys, jsDocParsingMode) {
|
|
119812
119812
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
119813
119813
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
119814
119814
|
function directoryExists(directoryPath) {
|
|
@@ -119827,7 +119827,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
119827
119827
|
const newLine = getNewLineCharacter(options);
|
|
119828
119828
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
119829
119829
|
const compilerHost = {
|
|
119830
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes,
|
|
119830
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, jsDocParsingMode),
|
|
119831
119831
|
getDefaultLibLocation,
|
|
119832
119832
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
119833
119833
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -126968,7 +126968,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126968
126968
|
getCompilerOptions,
|
|
126969
126969
|
/*setParentNodes*/
|
|
126970
126970
|
void 0,
|
|
126971
|
-
host.
|
|
126971
|
+
host.jsDocParsingMode
|
|
126972
126972
|
),
|
|
126973
126973
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
126974
126974
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -127154,13 +127154,13 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
127154
127154
|
return void 0;
|
|
127155
127155
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
127156
127156
|
}
|
|
127157
|
-
function createIncrementalCompilerHost(options, system = sys,
|
|
127157
|
+
function createIncrementalCompilerHost(options, system = sys, jsDocParsingMode) {
|
|
127158
127158
|
const host = createCompilerHostWorker(
|
|
127159
127159
|
options,
|
|
127160
127160
|
/*setParentNodes*/
|
|
127161
127161
|
void 0,
|
|
127162
|
-
|
|
127163
|
-
|
|
127162
|
+
system,
|
|
127163
|
+
jsDocParsingMode
|
|
127164
127164
|
);
|
|
127165
127165
|
host.createHash = maybeBind(system, system.createHash);
|
|
127166
127166
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
@@ -135083,10 +135083,10 @@ var DocumentHighlights;
|
|
|
135083
135083
|
function isDocumentRegistryEntry(entry) {
|
|
135084
135084
|
return !!entry.sourceFile;
|
|
135085
135085
|
}
|
|
135086
|
-
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
135087
|
-
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
135086
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) {
|
|
135087
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode);
|
|
135088
135088
|
}
|
|
135089
|
-
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
135089
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) {
|
|
135090
135090
|
const buckets = /* @__PURE__ */ new Map();
|
|
135091
135091
|
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
135092
135092
|
function reportStats() {
|
|
@@ -135206,7 +135206,8 @@ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirec
|
|
|
135206
135206
|
version2,
|
|
135207
135207
|
/*setNodeParents*/
|
|
135208
135208
|
false,
|
|
135209
|
-
scriptKind
|
|
135209
|
+
scriptKind,
|
|
135210
|
+
jsDocParsingMode
|
|
135210
135211
|
);
|
|
135211
135212
|
if (externalCache) {
|
|
135212
135213
|
externalCache.setDocument(keyWithMode, path, sourceFile);
|
|
@@ -136593,7 +136594,12 @@ function transpileModule(input, transpileOptions) {
|
|
|
136593
136594
|
options
|
|
136594
136595
|
),
|
|
136595
136596
|
setExternalModuleIndicator: getSetExternalModuleIndicator(options)
|
|
136596
|
-
}
|
|
136597
|
+
},
|
|
136598
|
+
/*setParentNodes*/
|
|
136599
|
+
void 0,
|
|
136600
|
+
/*scriptKind*/
|
|
136601
|
+
void 0,
|
|
136602
|
+
2 /* SkipAll */
|
|
136597
136603
|
);
|
|
136598
136604
|
if (transpileOptions.moduleName) {
|
|
136599
136605
|
sourceFile.moduleName = transpileOptions.moduleName;
|
|
@@ -143792,7 +143798,8 @@ var SyntaxTreeCache = class {
|
|
|
143792
143798
|
version2,
|
|
143793
143799
|
/*setNodeParents*/
|
|
143794
143800
|
true,
|
|
143795
|
-
scriptKind
|
|
143801
|
+
scriptKind,
|
|
143802
|
+
this.host.jsDocParsingMode
|
|
143796
143803
|
);
|
|
143797
143804
|
} else if (this.currentFileVersion !== version2) {
|
|
143798
143805
|
const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
|
|
@@ -143811,8 +143818,8 @@ function setSourceFileFields(sourceFile, scriptSnapshot, version2) {
|
|
|
143811
143818
|
sourceFile.version = version2;
|
|
143812
143819
|
sourceFile.scriptSnapshot = scriptSnapshot;
|
|
143813
143820
|
}
|
|
143814
|
-
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind) {
|
|
143815
|
-
const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind);
|
|
143821
|
+
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind, jsDocParsingMode) {
|
|
143822
|
+
const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind, jsDocParsingMode);
|
|
143816
143823
|
setSourceFileFields(sourceFile, scriptSnapshot, version2);
|
|
143817
143824
|
return sourceFile;
|
|
143818
143825
|
}
|
|
@@ -143852,7 +143859,8 @@ function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, t
|
|
|
143852
143859
|
version2,
|
|
143853
143860
|
/*setNodeParents*/
|
|
143854
143861
|
true,
|
|
143855
|
-
sourceFile.scriptKind
|
|
143862
|
+
sourceFile.scriptKind,
|
|
143863
|
+
sourceFile.jsDocParsingMode
|
|
143856
143864
|
);
|
|
143857
143865
|
}
|
|
143858
143866
|
var NoopCancellationToken = {
|
|
@@ -168987,7 +168995,8 @@ var changesToText;
|
|
|
168987
168995
|
99 /* ESNext */,
|
|
168988
168996
|
/*setParentNodes*/
|
|
168989
168997
|
true,
|
|
168990
|
-
scriptKind
|
|
168998
|
+
scriptKind,
|
|
168999
|
+
2 /* SkipAll */
|
|
168991
169000
|
);
|
|
168992
169001
|
const changes = ts_formatting_exports.formatDocument(sourceFile, formatContext);
|
|
168993
169002
|
return applyChanges(nonFormattedText, changes) + newLineCharacter;
|
|
@@ -172269,6 +172278,7 @@ __export(ts_exports2, {
|
|
|
172269
172278
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
172270
172279
|
InternalSymbolName: () => InternalSymbolName,
|
|
172271
172280
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
172281
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
172272
172282
|
JsDoc: () => ts_JsDoc_exports,
|
|
172273
172283
|
JsTyping: () => ts_JsTyping_exports,
|
|
172274
172284
|
JsxEmit: () => JsxEmit,
|
|
@@ -176237,6 +176247,7 @@ var Project3 = class _Project {
|
|
|
176237
176247
|
this.directoryStructureHost = directoryStructureHost;
|
|
176238
176248
|
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
|
|
176239
176249
|
this.getCanonicalFileName = this.projectService.toCanonicalFileName;
|
|
176250
|
+
this.jsDocParsingMode = this.projectService.jsDocParsingMode;
|
|
176240
176251
|
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
|
176241
176252
|
if (!this.compilerOptions) {
|
|
176242
176253
|
this.compilerOptions = getDefaultCompilerOptions2();
|
|
@@ -178795,6 +178806,7 @@ var _ProjectService = class _ProjectService {
|
|
|
178795
178806
|
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
|
|
178796
178807
|
this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
|
|
178797
178808
|
this.session = opts.session;
|
|
178809
|
+
this.jsDocParsingMode = opts.jsDocParsingMode;
|
|
178798
178810
|
if (opts.serverMode !== void 0) {
|
|
178799
178811
|
this.serverMode = opts.serverMode;
|
|
178800
178812
|
} else {
|
|
@@ -178820,7 +178832,7 @@ var _ProjectService = class _ProjectService {
|
|
|
178820
178832
|
hostInfo: "Unknown host",
|
|
178821
178833
|
extraFileExtensions: []
|
|
178822
178834
|
};
|
|
178823
|
-
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
|
|
178835
|
+
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
|
|
178824
178836
|
const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
|
|
178825
178837
|
const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
|
|
178826
178838
|
this.packageJsonCache = createPackageJsonCache(this);
|
|
@@ -186831,6 +186843,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
186831
186843
|
InternalEmitFlags,
|
|
186832
186844
|
InternalSymbolName,
|
|
186833
186845
|
InvalidatedProjectKind,
|
|
186846
|
+
JSDocParsingMode,
|
|
186834
186847
|
JsDoc,
|
|
186835
186848
|
JsTyping,
|
|
186836
186849
|
JsxEmit,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -3616,6 +3616,7 @@ declare namespace ts {
|
|
|
3616
3616
|
typesMapLocation?: string;
|
|
3617
3617
|
serverMode?: LanguageServiceMode;
|
|
3618
3618
|
session: Session<unknown> | undefined;
|
|
3619
|
+
jsDocParsingMode?: JSDocParsingMode;
|
|
3619
3620
|
}
|
|
3620
3621
|
interface WatchOptionsAndErrors {
|
|
3621
3622
|
watchOptions: WatchOptions;
|
|
@@ -3690,6 +3691,7 @@ declare namespace ts {
|
|
|
3690
3691
|
private performanceEventHandler?;
|
|
3691
3692
|
private pendingPluginEnablements?;
|
|
3692
3693
|
private currentPluginEnablementPromise?;
|
|
3694
|
+
readonly jsDocParsingMode: JSDocParsingMode | undefined;
|
|
3693
3695
|
constructor(opts: ProjectServiceOptions);
|
|
3694
3696
|
toPath(fileName: string): Path;
|
|
3695
3697
|
private loadTypesMap;
|
|
@@ -8607,6 +8609,11 @@ declare namespace ts {
|
|
|
8607
8609
|
IndexSignatureParameters = 8848,
|
|
8608
8610
|
JSDocComment = 33,
|
|
8609
8611
|
}
|
|
8612
|
+
enum JSDocParsingMode {
|
|
8613
|
+
KeepAll = 0,
|
|
8614
|
+
KeepSemanticOnly = 1,
|
|
8615
|
+
SkipAll = 2,
|
|
8616
|
+
}
|
|
8610
8617
|
interface UserPreferences {
|
|
8611
8618
|
readonly disableSuggestions?: boolean;
|
|
8612
8619
|
readonly quotePreference?: "auto" | "double" | "single";
|
|
@@ -8768,6 +8775,8 @@ declare namespace ts {
|
|
|
8768
8775
|
setOnError(onError: ErrorCallback | undefined): void;
|
|
8769
8776
|
setScriptTarget(scriptTarget: ScriptTarget): void;
|
|
8770
8777
|
setLanguageVariant(variant: LanguageVariant): void;
|
|
8778
|
+
setScriptKind(scriptKind: ScriptKind): void;
|
|
8779
|
+
setJSDocParsingMode(kind: JSDocParsingMode): void;
|
|
8771
8780
|
/** @deprecated use {@link resetTokenState} */
|
|
8772
8781
|
setTextPos(textPos: number): void;
|
|
8773
8782
|
resetTokenState(pos: number): void;
|
|
@@ -9413,7 +9422,7 @@ declare namespace ts {
|
|
|
9413
9422
|
* that they appear in the source code. The language service depends on this property to locate nodes by position.
|
|
9414
9423
|
*/
|
|
9415
9424
|
function forEachChild<T>(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined;
|
|
9416
|
-
function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
|
|
9425
|
+
function createSourceFile(fileName: string, sourceText: string, languageVersionOrOptions: ScriptTarget | CreateSourceFileOptions, setParentNodes?: boolean, scriptKind?: ScriptKind, jsDocParsingMode?: JSDocParsingMode): SourceFile;
|
|
9417
9426
|
function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
|
|
9418
9427
|
/**
|
|
9419
9428
|
* Parse json text into SyntaxTree and return node and parse errors if any
|
|
@@ -9718,7 +9727,7 @@ declare namespace ts {
|
|
|
9718
9727
|
function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer;
|
|
9719
9728
|
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined;
|
|
9720
9729
|
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
|
9721
|
-
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
|
9730
|
+
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean, jsDocParsingMode?: JSDocParsingMode): CompilerHost;
|
|
9722
9731
|
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[];
|
|
9723
9732
|
function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string;
|
|
9724
9733
|
function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
|
|
@@ -9930,7 +9939,7 @@ declare namespace ts {
|
|
|
9930
9939
|
emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult<EmitResult>;
|
|
9931
9940
|
}
|
|
9932
9941
|
function readBuilderProgram(compilerOptions: CompilerOptions, host: ReadBuildProgramHost): EmitAndSemanticDiagnosticsBuilderProgram | undefined;
|
|
9933
|
-
function createIncrementalCompilerHost(options: CompilerOptions, system?: System): CompilerHost;
|
|
9942
|
+
function createIncrementalCompilerHost(options: CompilerOptions, system?: System, jsDocParsingMode?: JSDocParsingMode): CompilerHost;
|
|
9934
9943
|
function createIncrementalProgram<T extends BuilderProgram = EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: IncrementalProgramOptions<T>): T;
|
|
9935
9944
|
/**
|
|
9936
9945
|
* Create the watch compiler host for either configFile or fileNames and its options
|
|
@@ -10027,6 +10036,7 @@ declare namespace ts {
|
|
|
10027
10036
|
* 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
|
|
10028
10037
|
*/
|
|
10029
10038
|
getModuleResolutionCache?(): ModuleResolutionCache | undefined;
|
|
10039
|
+
jsDocParsingMode?: JSDocParsingMode;
|
|
10030
10040
|
}
|
|
10031
10041
|
interface WatchCompilerHost<T extends BuilderProgram> extends ProgramHost<T>, WatchHost {
|
|
10032
10042
|
/** Instead of using output d.ts file from project reference, use its source file */
|
|
@@ -10277,6 +10287,7 @@ declare namespace ts {
|
|
|
10277
10287
|
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
|
10278
10288
|
writeFile?(fileName: string, content: string): void;
|
|
10279
10289
|
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
|
10290
|
+
jsDocParsingMode?: JSDocParsingMode;
|
|
10280
10291
|
}
|
|
10281
10292
|
type WithMetadata<T> = T & {
|
|
10282
10293
|
metadata?: unknown;
|
|
@@ -11374,7 +11385,7 @@ declare namespace ts {
|
|
|
11374
11385
|
fileName: string;
|
|
11375
11386
|
highlightSpans: HighlightSpan[];
|
|
11376
11387
|
}
|
|
11377
|
-
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry;
|
|
11388
|
+
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string, jsDocParsingMode?: JSDocParsingMode): DocumentRegistry;
|
|
11378
11389
|
/**
|
|
11379
11390
|
* The document registry represents a store of SourceFile objects that can be shared between
|
|
11380
11391
|
* multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
|
|
@@ -11482,7 +11493,7 @@ declare namespace ts {
|
|
|
11482
11493
|
function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string;
|
|
11483
11494
|
function getDefaultCompilerOptions(): CompilerOptions;
|
|
11484
11495
|
function getSupportedCodeFixes(): readonly string[];
|
|
11485
|
-
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile;
|
|
11496
|
+
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTargetOrOptions: ScriptTarget | CreateSourceFileOptions, version: string, setNodeParents: boolean, scriptKind?: ScriptKind, jsDocParsingMode?: JSDocParsingMode): SourceFile;
|
|
11486
11497
|
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile;
|
|
11487
11498
|
function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnlyOrLanguageServiceMode?: boolean | LanguageServiceMode): LanguageService;
|
|
11488
11499
|
/**
|