MCPcopy Index your code
hub / github.com/nodejs/node / annotateSetAccessor

Function annotateSetAccessor

test/fixtures/snapshot/typescript.js:156761–156775  ·  view source on GitHub ↗
(changes, importAdder, sourceFile, setAccessorDeclaration, program, host, cancellationToken)

Source from the content-addressed store, hash-verified

156759 ]);
156760 }
156761 function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclaration, program, host, cancellationToken) {
156762 var param = ts.firstOrUndefined(setAccessorDeclaration.parameters);
156763 if (param && ts.isIdentifier(setAccessorDeclaration.name) && ts.isIdentifier(param.name)) {
156764 var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken);
156765 if (type === program.getTypeChecker().getAnyType()) {
156766 type = inferTypeForVariableFromUsage(param.name, program, cancellationToken);
156767 }
156768 if (ts.isInJSFile(setAccessorDeclaration)) {
156769 annotateJSDocParameters(changes, sourceFile, [{ declaration: param, type: type }], program, host);
156770 }
156771 else {
156772 annotate(changes, importAdder, sourceFile, param, type, program, host);
156773 }
156774 }
156775 }
156776 function annotate(changes, importAdder, sourceFile, declaration, type, program, host) {
156777 var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host);
156778 if (typeNode) {

Callers 1

doChangeFunction · 0.85

Calls 3

annotateJSDocParametersFunction · 0.85
annotateFunction · 0.85

Tested by

no test coverage detected