@@ -164108,11 +164108,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164108
164108
function isSignatureSupportingReturnAnnotation(node) {
164109
164109
return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node);
164110
164110
}
164111
- function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile ) {
164111
+ function addParameterHints(text, parameter, position, isFirstVariadicArgument) {
164112
164112
let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
164113
164113
let displayParts;
164114
164114
if (shouldUseInteractiveInlayHints(preferences)) {
164115
- displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile ), { text: ":" }];
164115
+ displayParts = [getNodeDisplayPart(hintText, parameter), { text: ":" }];
164116
164116
hintText = "";
164117
164117
} else {
164118
164118
hintText += ":";
@@ -164185,7 +164185,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164185
164185
return;
164186
164186
}
164187
164187
let signatureParamPos = 0;
164188
- const sourceFile = shouldUseInteractiveInlayHints(preferences) ? expr.getSourceFile() : void 0;
164189
164188
for (const originalArg of args) {
164190
164189
const arg = skipParentheses(originalArg);
164191
164190
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
@@ -164218,7 +164217,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164218
164217
if (leadingCommentsContainsParameterName(arg, name)) {
164219
164218
continue;
164220
164219
}
164221
- addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument, sourceFile );
164220
+ addParameterHints(name, parameter, originalArg.getStart(), isFirstVariadicArgument);
164222
164221
}
164223
164222
}
164224
164223
}
@@ -164354,7 +164353,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164354
164353
}
164355
164354
return true;
164356
164355
}
164357
- function getNodeDisplayPart(text, node, sourceFile) {
164356
+ function getNodeDisplayPart(text, node) {
164357
+ const sourceFile = node.getSourceFile();
164358
164358
return {
164359
164359
text,
164360
164360
span: createTextSpanFromNode(node, sourceFile),
@@ -181073,14 +181073,22 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
181073
181073
return {
181074
181074
...hint,
181075
181075
position: scriptInfo.positionToLineOffset(position),
181076
- displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => ({
181077
- text,
181078
- span: span && {
181079
- start: scriptInfo.positionToLineOffset(span.start),
181080
- end: scriptInfo.positionToLineOffset(span.start + span.length),
181081
- file: file2
181076
+ displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => {
181077
+ if (span) {
181078
+ Debug.assertIsDefined(file2, "Target file should be defined together with its span.");
181079
+ const scriptInfo2 = this.projectService.getScriptInfo(file2);
181080
+ return {
181081
+ text,
181082
+ span: {
181083
+ start: scriptInfo2.positionToLineOffset(span.start),
181084
+ end: scriptInfo2.positionToLineOffset(span.start + span.length),
181085
+ file: file2
181086
+ }
181087
+ };
181088
+ } else {
181089
+ return { text };
181082
181090
}
181083
- }))
181091
+ })
181084
181092
};
181085
181093
});
181086
181094
}
0 commit comments