@@ -2304,7 +2304,7 @@ module.exports = __toCommonJS(server_exports);
2304
2304
2305
2305
// src/compiler/corePublic.ts
2306
2306
var versionMajorMinor = "5.1";
2307
- var version = "5.1.4 ";
2307
+ var version = "5.1.5 ";
2308
2308
var Comparison = /* @__PURE__ */ ((Comparison3) => {
2309
2309
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2310
2310
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -65235,7 +65235,6 @@ function createTypeChecker(host) {
65235
65235
} else if (targetFlags & 8388608 /* IndexedAccess */) {
65236
65236
if (sourceFlags & 8388608 /* IndexedAccess */) {
65237
65237
if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
65238
- instantiateType(source2.objectType, reportUnreliableMapper);
65239
65238
result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
65240
65239
}
65241
65240
if (result2) {
@@ -156314,7 +156313,7 @@ function getSourceFromOrigin(origin) {
156314
156313
}
156315
156314
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) {
156316
156315
const start2 = timestamp();
156317
- const variableOrParameterDeclaration = getVariableOrParameterDeclaration(contextToken);
156316
+ const variableOrParameterDeclaration = getVariableOrParameterDeclaration(contextToken, location );
156318
156317
const useSemicolons = probablyUsesSemicolons(sourceFile);
156319
156318
const typeChecker = program.getTypeChecker();
156320
156319
const uniques = /* @__PURE__ */ new Map();
@@ -158493,11 +158492,12 @@ function isModuleSpecifierMissingOrEmpty(specifier) {
158493
158492
return true;
158494
158493
return !((_a = tryCast(isExternalModuleReference(specifier) ? specifier.expression : specifier, isStringLiteralLike)) == null ? void 0 : _a.text);
158495
158494
}
158496
- function getVariableOrParameterDeclaration(contextToken) {
158495
+ function getVariableOrParameterDeclaration(contextToken, location ) {
158497
158496
if (!contextToken)
158498
158497
return;
158499
- const declaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node) || (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent));
158500
- return declaration;
158498
+ const possiblyParameterDeclaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent));
158499
+ const possiblyVariableDeclaration = findAncestor(location, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node));
158500
+ return possiblyParameterDeclaration || possiblyVariableDeclaration;
158501
158501
}
158502
158502
function isArrowFunctionBody(node) {
158503
158503
return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/;
@@ -158739,7 +158739,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
158739
158739
case 290 /* JsxAttribute */:
158740
158740
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
158741
158741
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
158742
- return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
158742
+ return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */ );
158743
158743
}
158744
158744
case 271 /* ImportDeclaration */:
158745
158745
case 277 /* ExportDeclaration */:
0 commit comments