tryInsertTypeAnnotation(sourceFile, node, type) {
          let endNode2;
          if (isFunctionLike(node)) {
            endNode2 = findChildOfKind(node, 22 /* CloseParenToken */, sourceFile);
            if (!endNode2) {
              if (!isArrowFunction(node))
                return false;
              endNode2 = first(node.parameters);
            }
          } else {
            endNode2 = (node.kind === 260 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken) ?? node.name;
          }
          this.insertNodeAt(sourceFile, endNode2.end, type, { prefix: ": " });
          return true;
        }
Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node.