(context)
| 144277 | return preferences.includeInlayParameterNameHints === "literals"; |
| 144278 | } |
| 144279 | function provideInlayHints(context) { |
| 144280 | var file = context.file, program = context.program, span = context.span, cancellationToken = context.cancellationToken, preferences = context.preferences; |
| 144281 | var sourceFileText = file.text; |
| 144282 | var compilerOptions = program.getCompilerOptions(); |
| 144283 | var checker = program.getTypeChecker(); |
| 144284 | var result = []; |
| 144285 | visitor(file); |
| 144286 | return result; |
| 144287 | function visitor(node) { |
| 144288 | if (!node || node.getFullWidth() === 0) { |
| 144289 | return; |
| 144290 | } |
| 144291 | switch (node.kind) { |
| 144292 | case 261 /* SyntaxKind.ModuleDeclaration */: |
| 144293 | case 257 /* SyntaxKind.ClassDeclaration */: |
| 144294 | case 258 /* SyntaxKind.InterfaceDeclaration */: |
| 144295 | case 256 /* SyntaxKind.FunctionDeclaration */: |
| 144296 | case 226 /* SyntaxKind.ClassExpression */: |
| 144297 | case 213 /* SyntaxKind.FunctionExpression */: |
| 144298 | case 169 /* SyntaxKind.MethodDeclaration */: |
| 144299 | case 214 /* SyntaxKind.ArrowFunction */: |
| 144300 | cancellationToken.throwIfCancellationRequested(); |
| 144301 | } |
| 144302 | if (!ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { |
| 144303 | return; |
| 144304 | } |
| 144305 | if (ts.isTypeNode(node)) { |
| 144306 | return; |
| 144307 | } |
| 144308 | if (preferences.includeInlayVariableTypeHints && ts.isVariableDeclaration(node)) { |
| 144309 | visitVariableLikeDeclaration(node); |
| 144310 | } |
| 144311 | else if (preferences.includeInlayPropertyDeclarationTypeHints && ts.isPropertyDeclaration(node)) { |
| 144312 | visitVariableLikeDeclaration(node); |
| 144313 | } |
| 144314 | else if (preferences.includeInlayEnumMemberValueHints && ts.isEnumMember(node)) { |
| 144315 | visitEnumMember(node); |
| 144316 | } |
| 144317 | else if (shouldShowParameterNameHints(preferences) && (ts.isCallExpression(node) || ts.isNewExpression(node))) { |
| 144318 | visitCallOrNewExpression(node); |
| 144319 | } |
| 144320 | else { |
| 144321 | if (preferences.includeInlayFunctionParameterTypeHints && ts.isFunctionLikeDeclaration(node) && ts.hasContextSensitiveParameters(node)) { |
| 144322 | visitFunctionLikeForParameterType(node); |
| 144323 | } |
| 144324 | if (preferences.includeInlayFunctionLikeReturnTypeHints && isSignatureSupportingReturnAnnotation(node)) { |
| 144325 | visitFunctionDeclarationLikeForReturnType(node); |
| 144326 | } |
| 144327 | } |
| 144328 | return ts.forEachChild(node, visitor); |
| 144329 | } |
| 144330 | function isSignatureSupportingReturnAnnotation(node) { |
| 144331 | return ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node) || ts.isMethodDeclaration(node) || ts.isGetAccessorDeclaration(node); |
| 144332 | } |
| 144333 | function addParameterHints(text, position, isFirstVariadicArgument) { |
| 144334 | result.push({ |
| 144335 | text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"), |
| 144336 | position: position, |
nothing calls this directly
no test coverage detected