typescript 5.3.0-dev.20230928 → 5.3.0-dev.20230929
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 +1 -1
- package/lib/tsserver.js +20 -952
- package/lib/typescript.js +20 -956
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -61,7 +61,6 @@ __export(server_exports, {
|
|
|
61
61
|
ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
|
|
62
62
|
ContainerFlags: () => ContainerFlags,
|
|
63
63
|
ContextFlags: () => ContextFlags,
|
|
64
|
-
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
65
64
|
Debug: () => Debug,
|
|
66
65
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
67
66
|
Diagnostics: () => Diagnostics,
|
|
@@ -110,7 +109,6 @@ __export(server_exports, {
|
|
|
110
109
|
JsxFlags: () => JsxFlags,
|
|
111
110
|
JsxReferenceKind: () => JsxReferenceKind,
|
|
112
111
|
LanguageServiceMode: () => LanguageServiceMode,
|
|
113
|
-
LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter,
|
|
114
112
|
LanguageVariant: () => LanguageVariant,
|
|
115
113
|
LexicalEnvironmentFlags: () => LexicalEnvironmentFlags,
|
|
116
114
|
ListFormat: () => ListFormat,
|
|
@@ -184,7 +182,6 @@ __export(server_exports, {
|
|
|
184
182
|
TypeMapKind: () => TypeMapKind,
|
|
185
183
|
TypePredicateKind: () => TypePredicateKind,
|
|
186
184
|
TypeReferenceSerializationKind: () => TypeReferenceSerializationKind,
|
|
187
|
-
TypeScriptServicesFactory: () => TypeScriptServicesFactory,
|
|
188
185
|
UnionReduction: () => UnionReduction,
|
|
189
186
|
UpToDateStatusType: () => UpToDateStatusType,
|
|
190
187
|
VarianceFlags: () => VarianceFlags,
|
|
@@ -2028,7 +2025,6 @@ __export(server_exports, {
|
|
|
2028
2025
|
readJson: () => readJson,
|
|
2029
2026
|
readJsonConfigFile: () => readJsonConfigFile,
|
|
2030
2027
|
readJsonOrUndefined: () => readJsonOrUndefined,
|
|
2031
|
-
realizeDiagnostics: () => realizeDiagnostics,
|
|
2032
2028
|
reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange,
|
|
2033
2029
|
reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange,
|
|
2034
2030
|
reduceLeft: () => reduceLeft,
|
|
@@ -2330,7 +2326,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2330
2326
|
|
|
2331
2327
|
// src/compiler/corePublic.ts
|
|
2332
2328
|
var versionMajorMinor = "5.3";
|
|
2333
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2329
|
+
var version = `${versionMajorMinor}.0-dev.20230929`;
|
|
2334
2330
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2335
2331
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2336
2332
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7427,12 +7423,12 @@ var commentPragmas = {
|
|
|
7427
7423
|
kind: 4 /* MultiLine */
|
|
7428
7424
|
}
|
|
7429
7425
|
};
|
|
7430
|
-
var JSDocParsingMode = /* @__PURE__ */ ((
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
return
|
|
7426
|
+
var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode6) => {
|
|
7427
|
+
JSDocParsingMode6[JSDocParsingMode6["ParseAll"] = 0] = "ParseAll";
|
|
7428
|
+
JSDocParsingMode6[JSDocParsingMode6["ParseNone"] = 1] = "ParseNone";
|
|
7429
|
+
JSDocParsingMode6[JSDocParsingMode6["ParseForTypeErrors"] = 2] = "ParseForTypeErrors";
|
|
7430
|
+
JSDocParsingMode6[JSDocParsingMode6["ParseForTypeInfo"] = 3] = "ParseForTypeInfo";
|
|
7431
|
+
return JSDocParsingMode6;
|
|
7436
7432
|
})(JSDocParsingMode || {});
|
|
7437
7433
|
|
|
7438
7434
|
// src/compiler/sys.ts
|
|
@@ -130495,10 +130491,10 @@ var LanguageServiceMode = /* @__PURE__ */ ((LanguageServiceMode2) => {
|
|
|
130495
130491
|
return LanguageServiceMode2;
|
|
130496
130492
|
})(LanguageServiceMode || {});
|
|
130497
130493
|
var emptyOptions = {};
|
|
130498
|
-
var SemanticClassificationFormat = /* @__PURE__ */ ((
|
|
130499
|
-
|
|
130500
|
-
|
|
130501
|
-
return
|
|
130494
|
+
var SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat2) => {
|
|
130495
|
+
SemanticClassificationFormat2["Original"] = "original";
|
|
130496
|
+
SemanticClassificationFormat2["TwentyTwenty"] = "2020";
|
|
130497
|
+
return SemanticClassificationFormat2;
|
|
130502
130498
|
})(SemanticClassificationFormat || {});
|
|
130503
130499
|
var OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode3) => {
|
|
130504
130500
|
OrganizeImportsMode3["All"] = "All";
|
|
@@ -130615,15 +130611,15 @@ var OutputFileType = /* @__PURE__ */ ((OutputFileType2) => {
|
|
|
130615
130611
|
OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration";
|
|
130616
130612
|
return OutputFileType2;
|
|
130617
130613
|
})(OutputFileType || {});
|
|
130618
|
-
var EndOfLineState = /* @__PURE__ */ ((
|
|
130619
|
-
|
|
130620
|
-
|
|
130621
|
-
|
|
130622
|
-
|
|
130623
|
-
|
|
130624
|
-
|
|
130625
|
-
|
|
130626
|
-
return
|
|
130614
|
+
var EndOfLineState = /* @__PURE__ */ ((EndOfLineState2) => {
|
|
130615
|
+
EndOfLineState2[EndOfLineState2["None"] = 0] = "None";
|
|
130616
|
+
EndOfLineState2[EndOfLineState2["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia";
|
|
130617
|
+
EndOfLineState2[EndOfLineState2["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral";
|
|
130618
|
+
EndOfLineState2[EndOfLineState2["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral";
|
|
130619
|
+
EndOfLineState2[EndOfLineState2["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate";
|
|
130620
|
+
EndOfLineState2[EndOfLineState2["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail";
|
|
130621
|
+
EndOfLineState2[EndOfLineState2["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition";
|
|
130622
|
+
return EndOfLineState2;
|
|
130627
130623
|
})(EndOfLineState || {});
|
|
130628
130624
|
var TokenClass = /* @__PURE__ */ ((TokenClass2) => {
|
|
130629
130625
|
TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation";
|
|
@@ -145432,926 +145428,6 @@ function transform(source, transformers, compilerOptions) {
|
|
|
145432
145428
|
return result;
|
|
145433
145429
|
}
|
|
145434
145430
|
|
|
145435
|
-
// src/services/shims.ts
|
|
145436
|
-
var debugObjectHost = function() {
|
|
145437
|
-
return this;
|
|
145438
|
-
}();
|
|
145439
|
-
function logInternalError(logger, err) {
|
|
145440
|
-
if (logger) {
|
|
145441
|
-
logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message);
|
|
145442
|
-
}
|
|
145443
|
-
}
|
|
145444
|
-
var ScriptSnapshotShimAdapter = class {
|
|
145445
|
-
constructor(scriptSnapshotShim) {
|
|
145446
|
-
this.scriptSnapshotShim = scriptSnapshotShim;
|
|
145447
|
-
}
|
|
145448
|
-
getText(start2, end) {
|
|
145449
|
-
return this.scriptSnapshotShim.getText(start2, end);
|
|
145450
|
-
}
|
|
145451
|
-
getLength() {
|
|
145452
|
-
return this.scriptSnapshotShim.getLength();
|
|
145453
|
-
}
|
|
145454
|
-
getChangeRange(oldSnapshot) {
|
|
145455
|
-
const oldSnapshotShim = oldSnapshot;
|
|
145456
|
-
const encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
|
|
145457
|
-
if (encoded === null) {
|
|
145458
|
-
return null;
|
|
145459
|
-
}
|
|
145460
|
-
const decoded = JSON.parse(encoded);
|
|
145461
|
-
return createTextChangeRange(
|
|
145462
|
-
createTextSpan(decoded.span.start, decoded.span.length),
|
|
145463
|
-
decoded.newLength
|
|
145464
|
-
);
|
|
145465
|
-
}
|
|
145466
|
-
dispose() {
|
|
145467
|
-
if ("dispose" in this.scriptSnapshotShim) {
|
|
145468
|
-
this.scriptSnapshotShim.dispose();
|
|
145469
|
-
}
|
|
145470
|
-
}
|
|
145471
|
-
};
|
|
145472
|
-
var LanguageServiceShimHostAdapter = class {
|
|
145473
|
-
constructor(shimHost) {
|
|
145474
|
-
this.shimHost = shimHost;
|
|
145475
|
-
this.loggingEnabled = false;
|
|
145476
|
-
this.tracingEnabled = false;
|
|
145477
|
-
if ("getModuleResolutionsForFile" in this.shimHost) {
|
|
145478
|
-
this.resolveModuleNames = (moduleNames, containingFile) => {
|
|
145479
|
-
const resolutionsInFile = JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile));
|
|
145480
|
-
return map(moduleNames, (name) => {
|
|
145481
|
-
const result = getProperty(resolutionsInFile, name);
|
|
145482
|
-
return result ? { resolvedFileName: result, extension: extensionFromPath(result), isExternalLibraryImport: false } : void 0;
|
|
145483
|
-
});
|
|
145484
|
-
};
|
|
145485
|
-
}
|
|
145486
|
-
if ("directoryExists" in this.shimHost) {
|
|
145487
|
-
this.directoryExists = (directoryName) => this.shimHost.directoryExists(directoryName);
|
|
145488
|
-
}
|
|
145489
|
-
if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) {
|
|
145490
|
-
this.resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile) => {
|
|
145491
|
-
const typeDirectivesForFile = JSON.parse(this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile));
|
|
145492
|
-
return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName)));
|
|
145493
|
-
};
|
|
145494
|
-
}
|
|
145495
|
-
if ("jsDocParsingMode" in this.shimHost) {
|
|
145496
|
-
this.jsDocParsingMode = this.shimHost.jsDocParsingMode;
|
|
145497
|
-
}
|
|
145498
|
-
}
|
|
145499
|
-
log(s) {
|
|
145500
|
-
if (this.loggingEnabled) {
|
|
145501
|
-
this.shimHost.log(s);
|
|
145502
|
-
}
|
|
145503
|
-
}
|
|
145504
|
-
trace(s) {
|
|
145505
|
-
if (this.tracingEnabled) {
|
|
145506
|
-
this.shimHost.trace(s);
|
|
145507
|
-
}
|
|
145508
|
-
}
|
|
145509
|
-
error(s) {
|
|
145510
|
-
this.shimHost.error(s);
|
|
145511
|
-
}
|
|
145512
|
-
getProjectVersion() {
|
|
145513
|
-
if (!this.shimHost.getProjectVersion) {
|
|
145514
|
-
return void 0;
|
|
145515
|
-
}
|
|
145516
|
-
return this.shimHost.getProjectVersion();
|
|
145517
|
-
}
|
|
145518
|
-
getTypeRootsVersion() {
|
|
145519
|
-
if (!this.shimHost.getTypeRootsVersion) {
|
|
145520
|
-
return 0;
|
|
145521
|
-
}
|
|
145522
|
-
return this.shimHost.getTypeRootsVersion();
|
|
145523
|
-
}
|
|
145524
|
-
useCaseSensitiveFileNames() {
|
|
145525
|
-
return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
|
|
145526
|
-
}
|
|
145527
|
-
getCompilationSettings() {
|
|
145528
|
-
const settingsJson = this.shimHost.getCompilationSettings();
|
|
145529
|
-
if (settingsJson === null || settingsJson === "") {
|
|
145530
|
-
throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
|
|
145531
|
-
}
|
|
145532
|
-
const compilerOptions = JSON.parse(settingsJson);
|
|
145533
|
-
compilerOptions.allowNonTsExtensions = true;
|
|
145534
|
-
return compilerOptions;
|
|
145535
|
-
}
|
|
145536
|
-
getScriptFileNames() {
|
|
145537
|
-
const encoded = this.shimHost.getScriptFileNames();
|
|
145538
|
-
return JSON.parse(encoded);
|
|
145539
|
-
}
|
|
145540
|
-
getScriptSnapshot(fileName) {
|
|
145541
|
-
const scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
|
|
145542
|
-
return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
|
|
145543
|
-
}
|
|
145544
|
-
getScriptKind(fileName) {
|
|
145545
|
-
if ("getScriptKind" in this.shimHost) {
|
|
145546
|
-
return this.shimHost.getScriptKind(fileName);
|
|
145547
|
-
} else {
|
|
145548
|
-
return 0 /* Unknown */;
|
|
145549
|
-
}
|
|
145550
|
-
}
|
|
145551
|
-
getScriptVersion(fileName) {
|
|
145552
|
-
return this.shimHost.getScriptVersion(fileName);
|
|
145553
|
-
}
|
|
145554
|
-
getLocalizedDiagnosticMessages() {
|
|
145555
|
-
const diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
|
|
145556
|
-
if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") {
|
|
145557
|
-
return null;
|
|
145558
|
-
}
|
|
145559
|
-
try {
|
|
145560
|
-
return JSON.parse(diagnosticMessagesJson);
|
|
145561
|
-
} catch (e) {
|
|
145562
|
-
this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format");
|
|
145563
|
-
return null;
|
|
145564
|
-
}
|
|
145565
|
-
}
|
|
145566
|
-
getCancellationToken() {
|
|
145567
|
-
const hostCancellationToken = this.shimHost.getCancellationToken();
|
|
145568
|
-
return new ThrottledCancellationToken(hostCancellationToken);
|
|
145569
|
-
}
|
|
145570
|
-
getCurrentDirectory() {
|
|
145571
|
-
return this.shimHost.getCurrentDirectory();
|
|
145572
|
-
}
|
|
145573
|
-
getDirectories(path) {
|
|
145574
|
-
return JSON.parse(this.shimHost.getDirectories(path));
|
|
145575
|
-
}
|
|
145576
|
-
getDefaultLibFileName(options) {
|
|
145577
|
-
return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
|
|
145578
|
-
}
|
|
145579
|
-
readDirectory(path, extensions, exclude, include, depth) {
|
|
145580
|
-
const pattern = getFileMatcherPatterns(path, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
|
|
145581
|
-
return JSON.parse(this.shimHost.readDirectory(
|
|
145582
|
-
path,
|
|
145583
|
-
JSON.stringify(extensions),
|
|
145584
|
-
JSON.stringify(pattern.basePaths),
|
|
145585
|
-
pattern.excludePattern,
|
|
145586
|
-
pattern.includeFilePattern,
|
|
145587
|
-
pattern.includeDirectoryPattern,
|
|
145588
|
-
depth
|
|
145589
|
-
));
|
|
145590
|
-
}
|
|
145591
|
-
readFile(path, encoding) {
|
|
145592
|
-
return this.shimHost.readFile(path, encoding);
|
|
145593
|
-
}
|
|
145594
|
-
fileExists(path) {
|
|
145595
|
-
return this.shimHost.fileExists(path);
|
|
145596
|
-
}
|
|
145597
|
-
};
|
|
145598
|
-
var CoreServicesShimHostAdapter = class {
|
|
145599
|
-
constructor(shimHost) {
|
|
145600
|
-
this.shimHost = shimHost;
|
|
145601
|
-
this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false;
|
|
145602
|
-
if ("directoryExists" in this.shimHost) {
|
|
145603
|
-
this.directoryExists = (directoryName) => this.shimHost.directoryExists(directoryName);
|
|
145604
|
-
} else {
|
|
145605
|
-
this.directoryExists = void 0;
|
|
145606
|
-
}
|
|
145607
|
-
if ("realpath" in this.shimHost) {
|
|
145608
|
-
this.realpath = (path) => this.shimHost.realpath(path);
|
|
145609
|
-
} else {
|
|
145610
|
-
this.realpath = void 0;
|
|
145611
|
-
}
|
|
145612
|
-
}
|
|
145613
|
-
readDirectory(rootDir, extensions, exclude, include, depth) {
|
|
145614
|
-
const pattern = getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory());
|
|
145615
|
-
return JSON.parse(this.shimHost.readDirectory(
|
|
145616
|
-
rootDir,
|
|
145617
|
-
JSON.stringify(extensions),
|
|
145618
|
-
JSON.stringify(pattern.basePaths),
|
|
145619
|
-
pattern.excludePattern,
|
|
145620
|
-
pattern.includeFilePattern,
|
|
145621
|
-
pattern.includeDirectoryPattern,
|
|
145622
|
-
depth
|
|
145623
|
-
));
|
|
145624
|
-
}
|
|
145625
|
-
fileExists(fileName) {
|
|
145626
|
-
return this.shimHost.fileExists(fileName);
|
|
145627
|
-
}
|
|
145628
|
-
readFile(fileName) {
|
|
145629
|
-
return this.shimHost.readFile(fileName);
|
|
145630
|
-
}
|
|
145631
|
-
getDirectories(path) {
|
|
145632
|
-
return JSON.parse(this.shimHost.getDirectories(path));
|
|
145633
|
-
}
|
|
145634
|
-
};
|
|
145635
|
-
function simpleForwardCall(logger, actionDescription2, action, logPerformance) {
|
|
145636
|
-
let start2;
|
|
145637
|
-
if (logPerformance) {
|
|
145638
|
-
logger.log(actionDescription2);
|
|
145639
|
-
start2 = timestamp();
|
|
145640
|
-
}
|
|
145641
|
-
const result = action();
|
|
145642
|
-
if (logPerformance) {
|
|
145643
|
-
const end = timestamp();
|
|
145644
|
-
logger.log(`${actionDescription2} completed in ${end - start2} msec`);
|
|
145645
|
-
if (isString(result)) {
|
|
145646
|
-
let str = result;
|
|
145647
|
-
if (str.length > 128) {
|
|
145648
|
-
str = str.substring(0, 128) + "...";
|
|
145649
|
-
}
|
|
145650
|
-
logger.log(` result.length=${str.length}, result='${JSON.stringify(str)}'`);
|
|
145651
|
-
}
|
|
145652
|
-
}
|
|
145653
|
-
return result;
|
|
145654
|
-
}
|
|
145655
|
-
function forwardJSONCall(logger, actionDescription2, action, logPerformance) {
|
|
145656
|
-
return forwardCall(
|
|
145657
|
-
logger,
|
|
145658
|
-
actionDescription2,
|
|
145659
|
-
/*returnJson*/
|
|
145660
|
-
true,
|
|
145661
|
-
action,
|
|
145662
|
-
logPerformance
|
|
145663
|
-
);
|
|
145664
|
-
}
|
|
145665
|
-
function forwardCall(logger, actionDescription2, returnJson, action, logPerformance) {
|
|
145666
|
-
try {
|
|
145667
|
-
const result = simpleForwardCall(logger, actionDescription2, action, logPerformance);
|
|
145668
|
-
return returnJson ? JSON.stringify({ result }) : result;
|
|
145669
|
-
} catch (err) {
|
|
145670
|
-
if (err instanceof OperationCanceledException) {
|
|
145671
|
-
return JSON.stringify({ canceled: true });
|
|
145672
|
-
}
|
|
145673
|
-
logInternalError(logger, err);
|
|
145674
|
-
err.description = actionDescription2;
|
|
145675
|
-
return JSON.stringify({ error: err });
|
|
145676
|
-
}
|
|
145677
|
-
}
|
|
145678
|
-
var ShimBase = class {
|
|
145679
|
-
constructor(factory2) {
|
|
145680
|
-
this.factory = factory2;
|
|
145681
|
-
factory2.registerShim(this);
|
|
145682
|
-
}
|
|
145683
|
-
dispose(_dummy) {
|
|
145684
|
-
this.factory.unregisterShim(this);
|
|
145685
|
-
}
|
|
145686
|
-
};
|
|
145687
|
-
function realizeDiagnostics(diagnostics, newLine) {
|
|
145688
|
-
return diagnostics.map((d) => realizeDiagnostic(d, newLine));
|
|
145689
|
-
}
|
|
145690
|
-
function realizeDiagnostic(diagnostic, newLine) {
|
|
145691
|
-
return {
|
|
145692
|
-
message: flattenDiagnosticMessageText(diagnostic.messageText, newLine),
|
|
145693
|
-
start: diagnostic.start,
|
|
145694
|
-
// TODO: GH#18217
|
|
145695
|
-
length: diagnostic.length,
|
|
145696
|
-
// TODO: GH#18217
|
|
145697
|
-
category: diagnosticCategoryName(diagnostic),
|
|
145698
|
-
code: diagnostic.code,
|
|
145699
|
-
reportsUnnecessary: diagnostic.reportsUnnecessary,
|
|
145700
|
-
reportsDeprecated: diagnostic.reportsDeprecated
|
|
145701
|
-
};
|
|
145702
|
-
}
|
|
145703
|
-
var LanguageServiceShimObject = class extends ShimBase {
|
|
145704
|
-
constructor(factory2, host, languageService) {
|
|
145705
|
-
super(factory2);
|
|
145706
|
-
this.host = host;
|
|
145707
|
-
this.languageService = languageService;
|
|
145708
|
-
this.logPerformance = false;
|
|
145709
|
-
this.logger = this.host;
|
|
145710
|
-
}
|
|
145711
|
-
forwardJSONCall(actionDescription2, action) {
|
|
145712
|
-
return forwardJSONCall(this.logger, actionDescription2, action, this.logPerformance);
|
|
145713
|
-
}
|
|
145714
|
-
/// DISPOSE
|
|
145715
|
-
/**
|
|
145716
|
-
* Ensure (almost) deterministic release of internal Javascript resources when
|
|
145717
|
-
* some external native objects holds onto us (e.g. Com/Interop).
|
|
145718
|
-
*/
|
|
145719
|
-
dispose(dummy) {
|
|
145720
|
-
this.logger.log("dispose()");
|
|
145721
|
-
this.languageService.dispose();
|
|
145722
|
-
this.languageService = null;
|
|
145723
|
-
if (debugObjectHost && debugObjectHost.CollectGarbage) {
|
|
145724
|
-
debugObjectHost.CollectGarbage();
|
|
145725
|
-
this.logger.log("CollectGarbage()");
|
|
145726
|
-
}
|
|
145727
|
-
this.logger = null;
|
|
145728
|
-
super.dispose(dummy);
|
|
145729
|
-
}
|
|
145730
|
-
/// REFRESH
|
|
145731
|
-
/**
|
|
145732
|
-
* Update the list of scripts known to the compiler
|
|
145733
|
-
*/
|
|
145734
|
-
refresh(throwOnError) {
|
|
145735
|
-
this.forwardJSONCall(
|
|
145736
|
-
`refresh(${throwOnError})`,
|
|
145737
|
-
() => null
|
|
145738
|
-
// eslint-disable-line no-null/no-null
|
|
145739
|
-
);
|
|
145740
|
-
}
|
|
145741
|
-
cleanupSemanticCache() {
|
|
145742
|
-
this.forwardJSONCall(
|
|
145743
|
-
"cleanupSemanticCache()",
|
|
145744
|
-
() => {
|
|
145745
|
-
this.languageService.cleanupSemanticCache();
|
|
145746
|
-
return null;
|
|
145747
|
-
}
|
|
145748
|
-
);
|
|
145749
|
-
}
|
|
145750
|
-
realizeDiagnostics(diagnostics) {
|
|
145751
|
-
const newLine = getNewLineOrDefaultFromHost(
|
|
145752
|
-
this.host,
|
|
145753
|
-
/*formatSettings*/
|
|
145754
|
-
void 0
|
|
145755
|
-
);
|
|
145756
|
-
return realizeDiagnostics(diagnostics, newLine);
|
|
145757
|
-
}
|
|
145758
|
-
getSyntacticClassifications(fileName, start2, length2) {
|
|
145759
|
-
return this.forwardJSONCall(
|
|
145760
|
-
`getSyntacticClassifications('${fileName}', ${start2}, ${length2})`,
|
|
145761
|
-
() => this.languageService.getSyntacticClassifications(fileName, createTextSpan(start2, length2))
|
|
145762
|
-
);
|
|
145763
|
-
}
|
|
145764
|
-
getSemanticClassifications(fileName, start2, length2) {
|
|
145765
|
-
return this.forwardJSONCall(
|
|
145766
|
-
`getSemanticClassifications('${fileName}', ${start2}, ${length2})`,
|
|
145767
|
-
() => this.languageService.getSemanticClassifications(fileName, createTextSpan(start2, length2))
|
|
145768
|
-
);
|
|
145769
|
-
}
|
|
145770
|
-
getEncodedSyntacticClassifications(fileName, start2, length2) {
|
|
145771
|
-
return this.forwardJSONCall(
|
|
145772
|
-
`getEncodedSyntacticClassifications('${fileName}', ${start2}, ${length2})`,
|
|
145773
|
-
// directly serialize the spans out to a string. This is much faster to decode
|
|
145774
|
-
// on the managed side versus a full JSON array.
|
|
145775
|
-
() => convertClassifications(this.languageService.getEncodedSyntacticClassifications(fileName, createTextSpan(start2, length2)))
|
|
145776
|
-
);
|
|
145777
|
-
}
|
|
145778
|
-
getEncodedSemanticClassifications(fileName, start2, length2) {
|
|
145779
|
-
return this.forwardJSONCall(
|
|
145780
|
-
`getEncodedSemanticClassifications('${fileName}', ${start2}, ${length2})`,
|
|
145781
|
-
// directly serialize the spans out to a string. This is much faster to decode
|
|
145782
|
-
// on the managed side versus a full JSON array.
|
|
145783
|
-
() => convertClassifications(this.languageService.getEncodedSemanticClassifications(fileName, createTextSpan(start2, length2)))
|
|
145784
|
-
);
|
|
145785
|
-
}
|
|
145786
|
-
getSyntacticDiagnostics(fileName) {
|
|
145787
|
-
return this.forwardJSONCall(
|
|
145788
|
-
`getSyntacticDiagnostics('${fileName}')`,
|
|
145789
|
-
() => {
|
|
145790
|
-
const diagnostics = this.languageService.getSyntacticDiagnostics(fileName);
|
|
145791
|
-
return this.realizeDiagnostics(diagnostics);
|
|
145792
|
-
}
|
|
145793
|
-
);
|
|
145794
|
-
}
|
|
145795
|
-
getSemanticDiagnostics(fileName) {
|
|
145796
|
-
return this.forwardJSONCall(
|
|
145797
|
-
`getSemanticDiagnostics('${fileName}')`,
|
|
145798
|
-
() => {
|
|
145799
|
-
const diagnostics = this.languageService.getSemanticDiagnostics(fileName);
|
|
145800
|
-
return this.realizeDiagnostics(diagnostics);
|
|
145801
|
-
}
|
|
145802
|
-
);
|
|
145803
|
-
}
|
|
145804
|
-
getSuggestionDiagnostics(fileName) {
|
|
145805
|
-
return this.forwardJSONCall(`getSuggestionDiagnostics('${fileName}')`, () => this.realizeDiagnostics(this.languageService.getSuggestionDiagnostics(fileName)));
|
|
145806
|
-
}
|
|
145807
|
-
getCompilerOptionsDiagnostics() {
|
|
145808
|
-
return this.forwardJSONCall(
|
|
145809
|
-
"getCompilerOptionsDiagnostics()",
|
|
145810
|
-
() => {
|
|
145811
|
-
const diagnostics = this.languageService.getCompilerOptionsDiagnostics();
|
|
145812
|
-
return this.realizeDiagnostics(diagnostics);
|
|
145813
|
-
}
|
|
145814
|
-
);
|
|
145815
|
-
}
|
|
145816
|
-
/// QUICKINFO
|
|
145817
|
-
/**
|
|
145818
|
-
* Computes a string representation of the type at the requested position
|
|
145819
|
-
* in the active file.
|
|
145820
|
-
*/
|
|
145821
|
-
getQuickInfoAtPosition(fileName, position) {
|
|
145822
|
-
return this.forwardJSONCall(
|
|
145823
|
-
`getQuickInfoAtPosition('${fileName}', ${position})`,
|
|
145824
|
-
() => this.languageService.getQuickInfoAtPosition(fileName, position)
|
|
145825
|
-
);
|
|
145826
|
-
}
|
|
145827
|
-
/// NAMEORDOTTEDNAMESPAN
|
|
145828
|
-
/**
|
|
145829
|
-
* Computes span information of the name or dotted name at the requested position
|
|
145830
|
-
* in the active file.
|
|
145831
|
-
*/
|
|
145832
|
-
getNameOrDottedNameSpan(fileName, startPos, endPos) {
|
|
145833
|
-
return this.forwardJSONCall(
|
|
145834
|
-
`getNameOrDottedNameSpan('${fileName}', ${startPos}, ${endPos})`,
|
|
145835
|
-
() => this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos)
|
|
145836
|
-
);
|
|
145837
|
-
}
|
|
145838
|
-
/**
|
|
145839
|
-
* STATEMENTSPAN
|
|
145840
|
-
* Computes span information of statement at the requested position in the active file.
|
|
145841
|
-
*/
|
|
145842
|
-
getBreakpointStatementAtPosition(fileName, position) {
|
|
145843
|
-
return this.forwardJSONCall(
|
|
145844
|
-
`getBreakpointStatementAtPosition('${fileName}', ${position})`,
|
|
145845
|
-
() => this.languageService.getBreakpointStatementAtPosition(fileName, position)
|
|
145846
|
-
);
|
|
145847
|
-
}
|
|
145848
|
-
/// SIGNATUREHELP
|
|
145849
|
-
getSignatureHelpItems(fileName, position, options) {
|
|
145850
|
-
return this.forwardJSONCall(
|
|
145851
|
-
`getSignatureHelpItems('${fileName}', ${position})`,
|
|
145852
|
-
() => this.languageService.getSignatureHelpItems(fileName, position, options)
|
|
145853
|
-
);
|
|
145854
|
-
}
|
|
145855
|
-
/// GOTO DEFINITION
|
|
145856
|
-
/**
|
|
145857
|
-
* Computes the definition location and file for the symbol
|
|
145858
|
-
* at the requested position.
|
|
145859
|
-
*/
|
|
145860
|
-
getDefinitionAtPosition(fileName, position) {
|
|
145861
|
-
return this.forwardJSONCall(
|
|
145862
|
-
`getDefinitionAtPosition('${fileName}', ${position})`,
|
|
145863
|
-
() => this.languageService.getDefinitionAtPosition(fileName, position)
|
|
145864
|
-
);
|
|
145865
|
-
}
|
|
145866
|
-
/**
|
|
145867
|
-
* Computes the definition location and file for the symbol
|
|
145868
|
-
* at the requested position.
|
|
145869
|
-
*/
|
|
145870
|
-
getDefinitionAndBoundSpan(fileName, position) {
|
|
145871
|
-
return this.forwardJSONCall(
|
|
145872
|
-
`getDefinitionAndBoundSpan('${fileName}', ${position})`,
|
|
145873
|
-
() => this.languageService.getDefinitionAndBoundSpan(fileName, position)
|
|
145874
|
-
);
|
|
145875
|
-
}
|
|
145876
|
-
/// GOTO Type
|
|
145877
|
-
/**
|
|
145878
|
-
* Computes the definition location of the type of the symbol
|
|
145879
|
-
* at the requested position.
|
|
145880
|
-
*/
|
|
145881
|
-
getTypeDefinitionAtPosition(fileName, position) {
|
|
145882
|
-
return this.forwardJSONCall(
|
|
145883
|
-
`getTypeDefinitionAtPosition('${fileName}', ${position})`,
|
|
145884
|
-
() => this.languageService.getTypeDefinitionAtPosition(fileName, position)
|
|
145885
|
-
);
|
|
145886
|
-
}
|
|
145887
|
-
/// GOTO Implementation
|
|
145888
|
-
/**
|
|
145889
|
-
* Computes the implementation location of the symbol
|
|
145890
|
-
* at the requested position.
|
|
145891
|
-
*/
|
|
145892
|
-
getImplementationAtPosition(fileName, position) {
|
|
145893
|
-
return this.forwardJSONCall(
|
|
145894
|
-
`getImplementationAtPosition('${fileName}', ${position})`,
|
|
145895
|
-
() => this.languageService.getImplementationAtPosition(fileName, position)
|
|
145896
|
-
);
|
|
145897
|
-
}
|
|
145898
|
-
getRenameInfo(fileName, position, preferences) {
|
|
145899
|
-
return this.forwardJSONCall(
|
|
145900
|
-
`getRenameInfo('${fileName}', ${position})`,
|
|
145901
|
-
() => this.languageService.getRenameInfo(fileName, position, preferences)
|
|
145902
|
-
);
|
|
145903
|
-
}
|
|
145904
|
-
getSmartSelectionRange(fileName, position) {
|
|
145905
|
-
return this.forwardJSONCall(
|
|
145906
|
-
`getSmartSelectionRange('${fileName}', ${position})`,
|
|
145907
|
-
() => this.languageService.getSmartSelectionRange(fileName, position)
|
|
145908
|
-
);
|
|
145909
|
-
}
|
|
145910
|
-
findRenameLocations(fileName, position, findInStrings, findInComments, preferences) {
|
|
145911
|
-
return this.forwardJSONCall(
|
|
145912
|
-
`findRenameLocations('${fileName}', ${position}, ${findInStrings}, ${findInComments})`,
|
|
145913
|
-
() => this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, preferences)
|
|
145914
|
-
);
|
|
145915
|
-
}
|
|
145916
|
-
/// GET BRACE MATCHING
|
|
145917
|
-
getBraceMatchingAtPosition(fileName, position) {
|
|
145918
|
-
return this.forwardJSONCall(
|
|
145919
|
-
`getBraceMatchingAtPosition('${fileName}', ${position})`,
|
|
145920
|
-
() => this.languageService.getBraceMatchingAtPosition(fileName, position)
|
|
145921
|
-
);
|
|
145922
|
-
}
|
|
145923
|
-
isValidBraceCompletionAtPosition(fileName, position, openingBrace) {
|
|
145924
|
-
return this.forwardJSONCall(
|
|
145925
|
-
`isValidBraceCompletionAtPosition('${fileName}', ${position}, ${openingBrace})`,
|
|
145926
|
-
() => this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace)
|
|
145927
|
-
);
|
|
145928
|
-
}
|
|
145929
|
-
getSpanOfEnclosingComment(fileName, position, onlyMultiLine) {
|
|
145930
|
-
return this.forwardJSONCall(
|
|
145931
|
-
`getSpanOfEnclosingComment('${fileName}', ${position})`,
|
|
145932
|
-
() => this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine)
|
|
145933
|
-
);
|
|
145934
|
-
}
|
|
145935
|
-
/// GET SMART INDENT
|
|
145936
|
-
getIndentationAtPosition(fileName, position, options) {
|
|
145937
|
-
return this.forwardJSONCall(
|
|
145938
|
-
`getIndentationAtPosition('${fileName}', ${position})`,
|
|
145939
|
-
() => {
|
|
145940
|
-
const localOptions = JSON.parse(options);
|
|
145941
|
-
return this.languageService.getIndentationAtPosition(fileName, position, localOptions);
|
|
145942
|
-
}
|
|
145943
|
-
);
|
|
145944
|
-
}
|
|
145945
|
-
/// GET REFERENCES
|
|
145946
|
-
getReferencesAtPosition(fileName, position) {
|
|
145947
|
-
return this.forwardJSONCall(
|
|
145948
|
-
`getReferencesAtPosition('${fileName}', ${position})`,
|
|
145949
|
-
() => this.languageService.getReferencesAtPosition(fileName, position)
|
|
145950
|
-
);
|
|
145951
|
-
}
|
|
145952
|
-
findReferences(fileName, position) {
|
|
145953
|
-
return this.forwardJSONCall(
|
|
145954
|
-
`findReferences('${fileName}', ${position})`,
|
|
145955
|
-
() => this.languageService.findReferences(fileName, position)
|
|
145956
|
-
);
|
|
145957
|
-
}
|
|
145958
|
-
getFileReferences(fileName) {
|
|
145959
|
-
return this.forwardJSONCall(
|
|
145960
|
-
`getFileReferences('${fileName})`,
|
|
145961
|
-
() => this.languageService.getFileReferences(fileName)
|
|
145962
|
-
);
|
|
145963
|
-
}
|
|
145964
|
-
getDocumentHighlights(fileName, position, filesToSearch) {
|
|
145965
|
-
return this.forwardJSONCall(
|
|
145966
|
-
`getDocumentHighlights('${fileName}', ${position})`,
|
|
145967
|
-
() => {
|
|
145968
|
-
const results = this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
|
|
145969
|
-
const normalizedName = toFileNameLowerCase(normalizeSlashes(fileName));
|
|
145970
|
-
return filter(results, (r) => toFileNameLowerCase(normalizeSlashes(r.fileName)) === normalizedName);
|
|
145971
|
-
}
|
|
145972
|
-
);
|
|
145973
|
-
}
|
|
145974
|
-
/// COMPLETION LISTS
|
|
145975
|
-
/**
|
|
145976
|
-
* Get a string based representation of the completions
|
|
145977
|
-
* to provide at the given source position and providing a member completion
|
|
145978
|
-
* list if requested.
|
|
145979
|
-
*/
|
|
145980
|
-
getCompletionsAtPosition(fileName, position, preferences, formattingSettings) {
|
|
145981
|
-
return this.forwardJSONCall(
|
|
145982
|
-
`getCompletionsAtPosition('${fileName}', ${position}, ${preferences}, ${formattingSettings})`,
|
|
145983
|
-
() => this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings)
|
|
145984
|
-
);
|
|
145985
|
-
}
|
|
145986
|
-
/** Get a string based representation of a completion list entry details */
|
|
145987
|
-
getCompletionEntryDetails(fileName, position, entryName, formatOptions, source, preferences, data) {
|
|
145988
|
-
return this.forwardJSONCall(
|
|
145989
|
-
`getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`,
|
|
145990
|
-
() => {
|
|
145991
|
-
const localOptions = formatOptions === void 0 ? void 0 : JSON.parse(formatOptions);
|
|
145992
|
-
return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
|
|
145993
|
-
}
|
|
145994
|
-
);
|
|
145995
|
-
}
|
|
145996
|
-
getFormattingEditsForRange(fileName, start2, end, options) {
|
|
145997
|
-
return this.forwardJSONCall(
|
|
145998
|
-
`getFormattingEditsForRange('${fileName}', ${start2}, ${end})`,
|
|
145999
|
-
() => {
|
|
146000
|
-
const localOptions = JSON.parse(options);
|
|
146001
|
-
return this.languageService.getFormattingEditsForRange(fileName, start2, end, localOptions);
|
|
146002
|
-
}
|
|
146003
|
-
);
|
|
146004
|
-
}
|
|
146005
|
-
getFormattingEditsForDocument(fileName, options) {
|
|
146006
|
-
return this.forwardJSONCall(
|
|
146007
|
-
`getFormattingEditsForDocument('${fileName}')`,
|
|
146008
|
-
() => {
|
|
146009
|
-
const localOptions = JSON.parse(options);
|
|
146010
|
-
return this.languageService.getFormattingEditsForDocument(fileName, localOptions);
|
|
146011
|
-
}
|
|
146012
|
-
);
|
|
146013
|
-
}
|
|
146014
|
-
getFormattingEditsAfterKeystroke(fileName, position, key, options) {
|
|
146015
|
-
return this.forwardJSONCall(
|
|
146016
|
-
`getFormattingEditsAfterKeystroke('${fileName}', ${position}, '${key}')`,
|
|
146017
|
-
() => {
|
|
146018
|
-
const localOptions = JSON.parse(options);
|
|
146019
|
-
return this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
|
|
146020
|
-
}
|
|
146021
|
-
);
|
|
146022
|
-
}
|
|
146023
|
-
getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) {
|
|
146024
|
-
return this.forwardJSONCall(
|
|
146025
|
-
`getDocCommentTemplateAtPosition('${fileName}', ${position})`,
|
|
146026
|
-
() => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions)
|
|
146027
|
-
);
|
|
146028
|
-
}
|
|
146029
|
-
/// NAVIGATE TO
|
|
146030
|
-
/** Return a list of symbols that are interesting to navigate to */
|
|
146031
|
-
getNavigateToItems(searchValue, maxResultCount, fileName) {
|
|
146032
|
-
return this.forwardJSONCall(
|
|
146033
|
-
`getNavigateToItems('${searchValue}', ${maxResultCount}, ${fileName})`,
|
|
146034
|
-
() => this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName)
|
|
146035
|
-
);
|
|
146036
|
-
}
|
|
146037
|
-
getNavigationBarItems(fileName) {
|
|
146038
|
-
return this.forwardJSONCall(
|
|
146039
|
-
`getNavigationBarItems('${fileName}')`,
|
|
146040
|
-
() => this.languageService.getNavigationBarItems(fileName)
|
|
146041
|
-
);
|
|
146042
|
-
}
|
|
146043
|
-
getNavigationTree(fileName) {
|
|
146044
|
-
return this.forwardJSONCall(
|
|
146045
|
-
`getNavigationTree('${fileName}')`,
|
|
146046
|
-
() => this.languageService.getNavigationTree(fileName)
|
|
146047
|
-
);
|
|
146048
|
-
}
|
|
146049
|
-
getOutliningSpans(fileName) {
|
|
146050
|
-
return this.forwardJSONCall(
|
|
146051
|
-
`getOutliningSpans('${fileName}')`,
|
|
146052
|
-
() => this.languageService.getOutliningSpans(fileName)
|
|
146053
|
-
);
|
|
146054
|
-
}
|
|
146055
|
-
getTodoComments(fileName, descriptors) {
|
|
146056
|
-
return this.forwardJSONCall(
|
|
146057
|
-
`getTodoComments('${fileName}')`,
|
|
146058
|
-
() => this.languageService.getTodoComments(fileName, JSON.parse(descriptors))
|
|
146059
|
-
);
|
|
146060
|
-
}
|
|
146061
|
-
/// CALL HIERARCHY
|
|
146062
|
-
prepareCallHierarchy(fileName, position) {
|
|
146063
|
-
return this.forwardJSONCall(
|
|
146064
|
-
`prepareCallHierarchy('${fileName}', ${position})`,
|
|
146065
|
-
() => this.languageService.prepareCallHierarchy(fileName, position)
|
|
146066
|
-
);
|
|
146067
|
-
}
|
|
146068
|
-
provideCallHierarchyIncomingCalls(fileName, position) {
|
|
146069
|
-
return this.forwardJSONCall(
|
|
146070
|
-
`provideCallHierarchyIncomingCalls('${fileName}', ${position})`,
|
|
146071
|
-
() => this.languageService.provideCallHierarchyIncomingCalls(fileName, position)
|
|
146072
|
-
);
|
|
146073
|
-
}
|
|
146074
|
-
provideCallHierarchyOutgoingCalls(fileName, position) {
|
|
146075
|
-
return this.forwardJSONCall(
|
|
146076
|
-
`provideCallHierarchyOutgoingCalls('${fileName}', ${position})`,
|
|
146077
|
-
() => this.languageService.provideCallHierarchyOutgoingCalls(fileName, position)
|
|
146078
|
-
);
|
|
146079
|
-
}
|
|
146080
|
-
provideInlayHints(fileName, span, preference) {
|
|
146081
|
-
return this.forwardJSONCall(
|
|
146082
|
-
`provideInlayHints('${fileName}', '${JSON.stringify(span)}', ${JSON.stringify(preference)})`,
|
|
146083
|
-
() => this.languageService.provideInlayHints(fileName, span, preference)
|
|
146084
|
-
);
|
|
146085
|
-
}
|
|
146086
|
-
/// Emit
|
|
146087
|
-
getEmitOutput(fileName) {
|
|
146088
|
-
return this.forwardJSONCall(
|
|
146089
|
-
`getEmitOutput('${fileName}')`,
|
|
146090
|
-
() => {
|
|
146091
|
-
const { diagnostics, ...rest } = this.languageService.getEmitOutput(fileName);
|
|
146092
|
-
return { ...rest, diagnostics: this.realizeDiagnostics(diagnostics) };
|
|
146093
|
-
}
|
|
146094
|
-
);
|
|
146095
|
-
}
|
|
146096
|
-
getEmitOutputObject(fileName) {
|
|
146097
|
-
return forwardCall(
|
|
146098
|
-
this.logger,
|
|
146099
|
-
`getEmitOutput('${fileName}')`,
|
|
146100
|
-
/*returnJson*/
|
|
146101
|
-
false,
|
|
146102
|
-
() => this.languageService.getEmitOutput(fileName),
|
|
146103
|
-
this.logPerformance
|
|
146104
|
-
);
|
|
146105
|
-
}
|
|
146106
|
-
toggleLineComment(fileName, textRange) {
|
|
146107
|
-
return this.forwardJSONCall(
|
|
146108
|
-
`toggleLineComment('${fileName}', '${JSON.stringify(textRange)}')`,
|
|
146109
|
-
() => this.languageService.toggleLineComment(fileName, textRange)
|
|
146110
|
-
);
|
|
146111
|
-
}
|
|
146112
|
-
toggleMultilineComment(fileName, textRange) {
|
|
146113
|
-
return this.forwardJSONCall(
|
|
146114
|
-
`toggleMultilineComment('${fileName}', '${JSON.stringify(textRange)}')`,
|
|
146115
|
-
() => this.languageService.toggleMultilineComment(fileName, textRange)
|
|
146116
|
-
);
|
|
146117
|
-
}
|
|
146118
|
-
commentSelection(fileName, textRange) {
|
|
146119
|
-
return this.forwardJSONCall(
|
|
146120
|
-
`commentSelection('${fileName}', '${JSON.stringify(textRange)}')`,
|
|
146121
|
-
() => this.languageService.commentSelection(fileName, textRange)
|
|
146122
|
-
);
|
|
146123
|
-
}
|
|
146124
|
-
uncommentSelection(fileName, textRange) {
|
|
146125
|
-
return this.forwardJSONCall(
|
|
146126
|
-
`uncommentSelection('${fileName}', '${JSON.stringify(textRange)}')`,
|
|
146127
|
-
() => this.languageService.uncommentSelection(fileName, textRange)
|
|
146128
|
-
);
|
|
146129
|
-
}
|
|
146130
|
-
};
|
|
146131
|
-
function convertClassifications(classifications) {
|
|
146132
|
-
return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState };
|
|
146133
|
-
}
|
|
146134
|
-
var ClassifierShimObject = class extends ShimBase {
|
|
146135
|
-
constructor(factory2, logger) {
|
|
146136
|
-
super(factory2);
|
|
146137
|
-
this.logger = logger;
|
|
146138
|
-
this.logPerformance = false;
|
|
146139
|
-
this.classifier = createClassifier();
|
|
146140
|
-
}
|
|
146141
|
-
getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent = false) {
|
|
146142
|
-
return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", () => convertClassifications(this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)), this.logPerformance);
|
|
146143
|
-
}
|
|
146144
|
-
/// COLORIZATION
|
|
146145
|
-
getClassificationsForLine(text, lexState, classifyKeywordsInGenerics = false) {
|
|
146146
|
-
const classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
|
|
146147
|
-
let result = "";
|
|
146148
|
-
for (const item of classification.entries) {
|
|
146149
|
-
result += item.length + "\n";
|
|
146150
|
-
result += item.classification + "\n";
|
|
146151
|
-
}
|
|
146152
|
-
result += classification.finalLexState;
|
|
146153
|
-
return result;
|
|
146154
|
-
}
|
|
146155
|
-
};
|
|
146156
|
-
var CoreServicesShimObject = class extends ShimBase {
|
|
146157
|
-
constructor(factory2, logger, host) {
|
|
146158
|
-
super(factory2);
|
|
146159
|
-
this.logger = logger;
|
|
146160
|
-
this.host = host;
|
|
146161
|
-
this.logPerformance = false;
|
|
146162
|
-
}
|
|
146163
|
-
forwardJSONCall(actionDescription2, action) {
|
|
146164
|
-
return forwardJSONCall(this.logger, actionDescription2, action, this.logPerformance);
|
|
146165
|
-
}
|
|
146166
|
-
resolveModuleName(fileName, moduleName, compilerOptionsJson) {
|
|
146167
|
-
return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => {
|
|
146168
|
-
const compilerOptions = JSON.parse(compilerOptionsJson);
|
|
146169
|
-
const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host);
|
|
146170
|
-
let resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : void 0;
|
|
146171
|
-
if (result.resolvedModule && result.resolvedModule.extension !== ".ts" /* Ts */ && result.resolvedModule.extension !== ".tsx" /* Tsx */ && result.resolvedModule.extension !== ".d.ts" /* Dts */) {
|
|
146172
|
-
resolvedFileName = void 0;
|
|
146173
|
-
}
|
|
146174
|
-
return {
|
|
146175
|
-
resolvedFileName,
|
|
146176
|
-
failedLookupLocations: result.failedLookupLocations,
|
|
146177
|
-
affectingLocations: result.affectingLocations
|
|
146178
|
-
};
|
|
146179
|
-
});
|
|
146180
|
-
}
|
|
146181
|
-
resolveTypeReferenceDirective(fileName, typeReferenceDirective, compilerOptionsJson) {
|
|
146182
|
-
return this.forwardJSONCall(`resolveTypeReferenceDirective(${fileName})`, () => {
|
|
146183
|
-
const compilerOptions = JSON.parse(compilerOptionsJson);
|
|
146184
|
-
const result = resolveTypeReferenceDirective(typeReferenceDirective, normalizeSlashes(fileName), compilerOptions, this.host);
|
|
146185
|
-
return {
|
|
146186
|
-
resolvedFileName: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.resolvedFileName : void 0,
|
|
146187
|
-
primary: result.resolvedTypeReferenceDirective ? result.resolvedTypeReferenceDirective.primary : true,
|
|
146188
|
-
failedLookupLocations: result.failedLookupLocations
|
|
146189
|
-
};
|
|
146190
|
-
});
|
|
146191
|
-
}
|
|
146192
|
-
getPreProcessedFileInfo(fileName, sourceTextSnapshot) {
|
|
146193
|
-
return this.forwardJSONCall(
|
|
146194
|
-
`getPreProcessedFileInfo('${fileName}')`,
|
|
146195
|
-
() => {
|
|
146196
|
-
const result = preProcessFile(
|
|
146197
|
-
getSnapshotText(sourceTextSnapshot),
|
|
146198
|
-
/*readImportFiles*/
|
|
146199
|
-
true,
|
|
146200
|
-
/*detectJavaScriptImports*/
|
|
146201
|
-
true
|
|
146202
|
-
);
|
|
146203
|
-
return {
|
|
146204
|
-
referencedFiles: this.convertFileReferences(result.referencedFiles),
|
|
146205
|
-
importedFiles: this.convertFileReferences(result.importedFiles),
|
|
146206
|
-
ambientExternalModules: result.ambientExternalModules,
|
|
146207
|
-
isLibFile: result.isLibFile,
|
|
146208
|
-
typeReferenceDirectives: this.convertFileReferences(result.typeReferenceDirectives),
|
|
146209
|
-
libReferenceDirectives: this.convertFileReferences(result.libReferenceDirectives)
|
|
146210
|
-
};
|
|
146211
|
-
}
|
|
146212
|
-
);
|
|
146213
|
-
}
|
|
146214
|
-
getAutomaticTypeDirectiveNames(compilerOptionsJson) {
|
|
146215
|
-
return this.forwardJSONCall(
|
|
146216
|
-
`getAutomaticTypeDirectiveNames('${compilerOptionsJson}')`,
|
|
146217
|
-
() => {
|
|
146218
|
-
const compilerOptions = JSON.parse(compilerOptionsJson);
|
|
146219
|
-
return getAutomaticTypeDirectiveNames(compilerOptions, this.host);
|
|
146220
|
-
}
|
|
146221
|
-
);
|
|
146222
|
-
}
|
|
146223
|
-
convertFileReferences(refs) {
|
|
146224
|
-
if (!refs) {
|
|
146225
|
-
return void 0;
|
|
146226
|
-
}
|
|
146227
|
-
const result = [];
|
|
146228
|
-
for (const ref of refs) {
|
|
146229
|
-
result.push({
|
|
146230
|
-
path: normalizeSlashes(ref.fileName),
|
|
146231
|
-
position: ref.pos,
|
|
146232
|
-
length: ref.end - ref.pos
|
|
146233
|
-
});
|
|
146234
|
-
}
|
|
146235
|
-
return result;
|
|
146236
|
-
}
|
|
146237
|
-
getTSConfigFileInfo(fileName, sourceTextSnapshot) {
|
|
146238
|
-
return this.forwardJSONCall(
|
|
146239
|
-
`getTSConfigFileInfo('${fileName}')`,
|
|
146240
|
-
() => {
|
|
146241
|
-
const result = parseJsonText(fileName, getSnapshotText(sourceTextSnapshot));
|
|
146242
|
-
const normalizedFileName = normalizeSlashes(fileName);
|
|
146243
|
-
const configFile = parseJsonSourceFileConfigFileContent(
|
|
146244
|
-
result,
|
|
146245
|
-
this.host,
|
|
146246
|
-
getDirectoryPath(normalizedFileName),
|
|
146247
|
-
/*existingOptions*/
|
|
146248
|
-
{},
|
|
146249
|
-
normalizedFileName
|
|
146250
|
-
);
|
|
146251
|
-
return {
|
|
146252
|
-
options: configFile.options,
|
|
146253
|
-
typeAcquisition: configFile.typeAcquisition,
|
|
146254
|
-
files: configFile.fileNames,
|
|
146255
|
-
raw: configFile.raw,
|
|
146256
|
-
errors: realizeDiagnostics([...result.parseDiagnostics, ...configFile.errors], "\r\n")
|
|
146257
|
-
};
|
|
146258
|
-
}
|
|
146259
|
-
);
|
|
146260
|
-
}
|
|
146261
|
-
getDefaultCompilationSettings() {
|
|
146262
|
-
return this.forwardJSONCall(
|
|
146263
|
-
"getDefaultCompilationSettings()",
|
|
146264
|
-
() => getDefaultCompilerOptions2()
|
|
146265
|
-
);
|
|
146266
|
-
}
|
|
146267
|
-
discoverTypings(discoverTypingsJson) {
|
|
146268
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
146269
|
-
/*useCaseSensitiveFileNames*/
|
|
146270
|
-
false
|
|
146271
|
-
);
|
|
146272
|
-
return this.forwardJSONCall("discoverTypings()", () => {
|
|
146273
|
-
const info = JSON.parse(discoverTypingsJson);
|
|
146274
|
-
if (this.safeList === void 0) {
|
|
146275
|
-
this.safeList = ts_JsTyping_exports.loadSafeList(this.host, toPath(info.safeListPath, info.safeListPath, getCanonicalFileName));
|
|
146276
|
-
}
|
|
146277
|
-
return ts_JsTyping_exports.discoverTypings(
|
|
146278
|
-
this.host,
|
|
146279
|
-
(msg) => this.logger.log(msg),
|
|
146280
|
-
info.fileNames,
|
|
146281
|
-
toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName),
|
|
146282
|
-
this.safeList,
|
|
146283
|
-
info.packageNameToTypingLocation,
|
|
146284
|
-
info.typeAcquisition,
|
|
146285
|
-
info.unresolvedImports,
|
|
146286
|
-
info.typesRegistry,
|
|
146287
|
-
emptyOptions
|
|
146288
|
-
);
|
|
146289
|
-
});
|
|
146290
|
-
}
|
|
146291
|
-
};
|
|
146292
|
-
var TypeScriptServicesFactory = class {
|
|
146293
|
-
constructor() {
|
|
146294
|
-
this._shims = [];
|
|
146295
|
-
}
|
|
146296
|
-
/*
|
|
146297
|
-
* Returns script API version.
|
|
146298
|
-
*/
|
|
146299
|
-
getServicesVersion() {
|
|
146300
|
-
return servicesVersion;
|
|
146301
|
-
}
|
|
146302
|
-
createLanguageServiceShim(host) {
|
|
146303
|
-
try {
|
|
146304
|
-
if (this.documentRegistry === void 0) {
|
|
146305
|
-
this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory());
|
|
146306
|
-
}
|
|
146307
|
-
const hostAdapter = new LanguageServiceShimHostAdapter(host);
|
|
146308
|
-
const languageService = createLanguageService(
|
|
146309
|
-
hostAdapter,
|
|
146310
|
-
this.documentRegistry,
|
|
146311
|
-
/*syntaxOnlyOrLanguageServiceMode*/
|
|
146312
|
-
false
|
|
146313
|
-
);
|
|
146314
|
-
return new LanguageServiceShimObject(this, host, languageService);
|
|
146315
|
-
} catch (err) {
|
|
146316
|
-
logInternalError(host, err);
|
|
146317
|
-
throw err;
|
|
146318
|
-
}
|
|
146319
|
-
}
|
|
146320
|
-
createClassifierShim(logger) {
|
|
146321
|
-
try {
|
|
146322
|
-
return new ClassifierShimObject(this, logger);
|
|
146323
|
-
} catch (err) {
|
|
146324
|
-
logInternalError(logger, err);
|
|
146325
|
-
throw err;
|
|
146326
|
-
}
|
|
146327
|
-
}
|
|
146328
|
-
createCoreServicesShim(host) {
|
|
146329
|
-
try {
|
|
146330
|
-
const adapter = new CoreServicesShimHostAdapter(host);
|
|
146331
|
-
return new CoreServicesShimObject(this, host, adapter);
|
|
146332
|
-
} catch (err) {
|
|
146333
|
-
logInternalError(host, err);
|
|
146334
|
-
throw err;
|
|
146335
|
-
}
|
|
146336
|
-
}
|
|
146337
|
-
close() {
|
|
146338
|
-
clear(this._shims);
|
|
146339
|
-
this.documentRegistry = void 0;
|
|
146340
|
-
}
|
|
146341
|
-
registerShim(shim) {
|
|
146342
|
-
this._shims.push(shim);
|
|
146343
|
-
}
|
|
146344
|
-
unregisterShim(shim) {
|
|
146345
|
-
for (let i = 0; i < this._shims.length; i++) {
|
|
146346
|
-
if (this._shims[i] === shim) {
|
|
146347
|
-
delete this._shims[i];
|
|
146348
|
-
return;
|
|
146349
|
-
}
|
|
146350
|
-
}
|
|
146351
|
-
throw new Error("Invalid operation");
|
|
146352
|
-
}
|
|
146353
|
-
};
|
|
146354
|
-
|
|
146355
145431
|
// src/services/_namespaces/ts.BreakpointResolver.ts
|
|
146356
145432
|
var ts_BreakpointResolver_exports = {};
|
|
146357
145433
|
__export(ts_BreakpointResolver_exports, {
|
|
@@ -172750,7 +171826,6 @@ __export(ts_exports2, {
|
|
|
172750
171826
|
ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
|
|
172751
171827
|
ContainerFlags: () => ContainerFlags,
|
|
172752
171828
|
ContextFlags: () => ContextFlags,
|
|
172753
|
-
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
172754
171829
|
Debug: () => Debug,
|
|
172755
171830
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
172756
171831
|
Diagnostics: () => Diagnostics,
|
|
@@ -172799,7 +171874,6 @@ __export(ts_exports2, {
|
|
|
172799
171874
|
JsxFlags: () => JsxFlags,
|
|
172800
171875
|
JsxReferenceKind: () => JsxReferenceKind,
|
|
172801
171876
|
LanguageServiceMode: () => LanguageServiceMode,
|
|
172802
|
-
LanguageServiceShimHostAdapter: () => LanguageServiceShimHostAdapter,
|
|
172803
171877
|
LanguageVariant: () => LanguageVariant,
|
|
172804
171878
|
LexicalEnvironmentFlags: () => LexicalEnvironmentFlags,
|
|
172805
171879
|
ListFormat: () => ListFormat,
|
|
@@ -172873,7 +171947,6 @@ __export(ts_exports2, {
|
|
|
172873
171947
|
TypeMapKind: () => TypeMapKind,
|
|
172874
171948
|
TypePredicateKind: () => TypePredicateKind,
|
|
172875
171949
|
TypeReferenceSerializationKind: () => TypeReferenceSerializationKind,
|
|
172876
|
-
TypeScriptServicesFactory: () => TypeScriptServicesFactory,
|
|
172877
171950
|
UnionReduction: () => UnionReduction,
|
|
172878
171951
|
UpToDateStatusType: () => UpToDateStatusType,
|
|
172879
171952
|
VarianceFlags: () => VarianceFlags,
|
|
@@ -174717,7 +173790,6 @@ __export(ts_exports2, {
|
|
|
174717
173790
|
readJson: () => readJson,
|
|
174718
173791
|
readJsonConfigFile: () => readJsonConfigFile,
|
|
174719
173792
|
readJsonOrUndefined: () => readJsonOrUndefined,
|
|
174720
|
-
realizeDiagnostics: () => realizeDiagnostics,
|
|
174721
173793
|
reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange,
|
|
174722
173794
|
reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange,
|
|
174723
173795
|
reduceLeft: () => reduceLeft,
|
|
@@ -187431,7 +186503,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187431
186503
|
ConfigFileProgramReloadLevel,
|
|
187432
186504
|
ContainerFlags,
|
|
187433
186505
|
ContextFlags,
|
|
187434
|
-
CoreServicesShimHostAdapter,
|
|
187435
186506
|
Debug,
|
|
187436
186507
|
DiagnosticCategory,
|
|
187437
186508
|
Diagnostics,
|
|
@@ -187480,7 +186551,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187480
186551
|
JsxFlags,
|
|
187481
186552
|
JsxReferenceKind,
|
|
187482
186553
|
LanguageServiceMode,
|
|
187483
|
-
LanguageServiceShimHostAdapter,
|
|
187484
186554
|
LanguageVariant,
|
|
187485
186555
|
LexicalEnvironmentFlags,
|
|
187486
186556
|
ListFormat,
|
|
@@ -187554,7 +186624,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187554
186624
|
TypeMapKind,
|
|
187555
186625
|
TypePredicateKind,
|
|
187556
186626
|
TypeReferenceSerializationKind,
|
|
187557
|
-
TypeScriptServicesFactory,
|
|
187558
186627
|
UnionReduction,
|
|
187559
186628
|
UpToDateStatusType,
|
|
187560
186629
|
VarianceFlags,
|
|
@@ -189398,7 +188467,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
189398
188467
|
readJson,
|
|
189399
188468
|
readJsonConfigFile,
|
|
189400
188469
|
readJsonOrUndefined,
|
|
189401
|
-
realizeDiagnostics,
|
|
189402
188470
|
reduceEachLeadingCommentRange,
|
|
189403
188471
|
reduceEachTrailingCommentRange,
|
|
189404
188472
|
reduceLeft,
|