@@ -44650,6 +44650,9 @@ var ts;
4465044650 // extra cost of calling `getParseTreeNode` when calling these functions from inside the
4465144651 // checker.
4465244652 var checker = {
44653+ setSymbolChainCache: function (cache) {
44654+ nodeBuilder.setSymbolChainCache(cache);
44655+ },
4465344656 getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); },
4465444657 getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); },
4465544658 getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; },
@@ -48372,7 +48375,9 @@ var ts;
4837248375 return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */));
4837348376 }
4837448377 function createNodeBuilder() {
48378+ var symbolChainCache;
4837548379 return {
48380+ setSymbolChainCache: function (cache) { symbolChainCache = cache; },
4837648381 typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) {
4837748382 return withContext(enclosingDeclaration, flags, tracker, function (context) { return typeToTypeNodeHelper(type, context); });
4837848383 },
@@ -48420,6 +48425,7 @@ var ts;
4842048425 fileExists: function (fileName) { return host.fileExists(fileName); },
4842148426 getFileIncludeReasons: function () { return host.getFileIncludeReasons(); },
4842248427 } : undefined },
48428+ cache: symbolChainCache,
4842348429 encounteredError: false,
4842448430 visitedTypes: undefined,
4842548431 symbolDepth: undefined,
@@ -49340,6 +49346,29 @@ var ts;
4934049346 return chain;
4934149347 /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */
4934249348 function getSymbolChain(symbol, meaning, endOfChain) {
49349+ var key;
49350+ var result;
49351+ if (context.cache) {
49352+ key = {
49353+ symbol: symbol,
49354+ enclosingDeclaration: context.enclosingDeclaration,
49355+ flags: context.flags,
49356+ meaning: meaning,
49357+ yieldModuleSymbol: yieldModuleSymbol,
49358+ endOfChain: endOfChain
49359+ };
49360+ result = context.cache.lookup(key);
49361+ if (result) {
49362+ return result;
49363+ }
49364+ }
49365+ result = doGetSymbolChain(symbol, meaning, endOfChain);
49366+ if (result && key && context.cache) {
49367+ context.cache.cache(key, result);
49368+ }
49369+ return result;
49370+ }
49371+ function doGetSymbolChain(symbol, meaning, endOfChain) {
4934349372 var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */));
4934449373 var parentSpecifiers;
4934549374 if (!accessibleSymbolChain ||
@@ -152926,10 +152955,11 @@ var ts;
152926152955 synchronizeHostData();
152927152956 return ts.Completions.getCompletionEntrySymbol(program, log, getValidSourceFile(fileName), position, { name: name, source: source }, host, preferences);
152928152957 }
152929- function getQuickInfoAtPosition(fileName, position ) {
152958+ function getQuickInfoAtPosition(arg0, arg1 ) {
152930152959 synchronizeHostData();
152931- var sourceFile = getValidSourceFile(fileName);
152932- var node = ts.getTouchingPropertyName(sourceFile, position);
152960+ var sourceFile = typeof arg0 === 'string' ? getValidSourceFile(arg0) : (arg1 !== undefined) ? arg1 : arg0.getSourceFile();
152961+ var node = typeof arg0 === 'string' ? ts.getTouchingPropertyName(sourceFile, arg1) : arg0;
152962+ var position = typeof arg1 === 'number' ? arg1 : node.getStart(sourceFile, false);
152933152963 if (node === sourceFile) {
152934152964 // Avoid giving quickInfo for the sourceFile as a whole.
152935152965 return undefined;
@@ -153178,9 +153208,9 @@ var ts;
153178153208 // doesn't use compiler - no need to synchronize with host
153179153209 return ts.getEncodedSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span);
153180153210 }
153181- function getOutliningSpans(fileName ) {
153211+ function getOutliningSpans(arg0 ) {
153182153212 // doesn't use compiler - no need to synchronize with host
153183- var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName) ;
153213+ var sourceFile = typeof arg0 === 'string' ? syntaxTreeCache.getCurrentSourceFile(arg0) : arg0 ;
153184153214 return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken);
153185153215 }
153186153216 var braceMatching = new ts.Map(ts.getEntries((_a = {},
@@ -154925,14 +154955,11 @@ var ts;
154925154955 return _this.realizeDiagnostics(diagnostics);
154926154956 });
154927154957 };
154928- /// QUICKINFO
154929- /**
154930- * Computes a string representation of the type at the requested position
154931- * in the active file.
154932- */
154933- LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
154958+ LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (arg0, arg1) {
154934154959 var _this = this;
154935- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
154960+ var fileName = typeof arg0 === "string" ? arg0 : arg1 !== undefined ? arg1.fileName : arg0.getSourceFile().fileName;
154961+ var position = typeof arg0 === "string" ? arg1 : arg0.getStart(arg1);
154962+ return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(arg0, arg1); });
154936154963 };
154937154964 /// NAMEORDOTTEDNAMESPAN
154938154965 /**
@@ -155107,9 +155134,10 @@ var ts;
155107155134 var _this = this;
155108155135 return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
155109155136 };
155110- LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName ) {
155137+ LanguageServiceShimObject.prototype.getOutliningSpans = function (arg0 ) {
155111155138 var _this = this;
155112- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
155139+ var fileName = typeof arg0 === "string" ? arg0 : arg0.fileName;
155140+ return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(arg0); });
155113155141 };
155114155142 LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
155115155143 var _this = this;
0 commit comments