@@ -100,7 +100,7 @@ var ts;
100
100
// The following is baselined as a literal template type without intervention
101
101
/** The version of the TypeScript compiler release */
102
102
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = "4.6.3 ";
103
+ ts.version = "4.6.4 ";
104
104
/* @internal */
105
105
var Comparison;
106
106
(function (Comparison) {
@@ -124964,12 +124964,8 @@ var ts;
124964
124964
}
124965
124965
}
124966
124966
ts.findNextToken = findNextToken;
124967
- /**
124968
- * Finds the rightmost token satisfying `token.end <= position`,
124969
- * excluding `JsxText` tokens containing only whitespace.
124970
- */
124971
124967
function findPrecedingToken(position, sourceFile, startNode, excludeJsdoc) {
124972
- var result = find(startNode || sourceFile);
124968
+ var result = find(( startNode || sourceFile) );
124973
124969
ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result)));
124974
124970
return result;
124975
124971
function find(n) {
@@ -144061,6 +144057,7 @@ var ts;
144061
144057
return formatting.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end, function (scanner) { return formatSpanWorker(originalRange, enclosingNode, formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, formatContext.options), getOwnOrInheritedDelta(enclosingNode, formatContext.options, sourceFile), scanner, formatContext, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); });
144062
144058
}
144063
144059
function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, _a, requestKind, rangeContainsError, sourceFile) {
144060
+ var _b;
144064
144061
var options = _a.options, getRules = _a.getRules, host = _a.host;
144065
144062
// formatting context is used by rules provider
144066
144063
var formattingContext = new formatting.FormattingContext(sourceFile, requestKind, options);
@@ -144092,11 +144089,12 @@ var ts;
144092
144089
}
144093
144090
}
144094
144091
if (previousRange && formattingScanner.getStartPos() >= originalRange.end) {
144095
- var token = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() :
144092
+ var tokenInfo = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() :
144096
144093
formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token :
144097
144094
undefined;
144098
- if (token) {
144099
- processPair(token, sourceFile.getLineAndCharacterOfPosition(token.pos).line, enclosingNode, previousRange, previousRangeStartLine, previousParent, enclosingNode,
144095
+ if (tokenInfo) {
144096
+ var parent = ((_b = ts.findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)) === null || _b === void 0 ? void 0 : _b.parent) || previousParent;
144097
+ processPair(tokenInfo, sourceFile.getLineAndCharacterOfPosition(tokenInfo.pos).line, parent, previousRange, previousRangeStartLine, previousParent, parent,
144100
144098
/*dynamicIndentation*/ undefined);
144101
144099
}
144102
144100
}
0 commit comments