(changes, context, info)
| 155005 | changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration); |
| 155006 | } |
| 155007 | function addJsxAttributes(changes, context, info) { |
| 155008 | var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host); |
| 155009 | var quotePreference = ts.getQuotePreference(context.sourceFile, context.preferences); |
| 155010 | var checker = context.program.getTypeChecker(); |
| 155011 | var jsxAttributesNode = info.parentDeclaration.attributes; |
| 155012 | var hasSpreadAttribute = ts.some(jsxAttributesNode.properties, ts.isJsxSpreadAttribute); |
| 155013 | var attrs = ts.map(info.attributes, function (attr) { |
| 155014 | var value = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr)); |
| 155015 | var name = ts.factory.createIdentifier(attr.name); |
| 155016 | var jsxAttribute = ts.factory.createJsxAttribute(name, ts.factory.createJsxExpression(/*dotDotDotToken*/ undefined, value)); |
| 155017 | // formattingScanner requires the Identifier to have a context for scanning attributes with "-" (data-foo). |
| 155018 | ts.setParent(name, jsxAttribute); |
| 155019 | return jsxAttribute; |
| 155020 | }); |
| 155021 | var jsxAttributes = ts.factory.createJsxAttributes(hasSpreadAttribute ? __spreadArray(__spreadArray([], attrs, true), jsxAttributesNode.properties, true) : __spreadArray(__spreadArray([], jsxAttributesNode.properties, true), attrs, true)); |
| 155022 | var options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : undefined }; |
| 155023 | changes.replaceNode(context.sourceFile, jsxAttributesNode, jsxAttributes, options); |
| 155024 | } |
| 155025 | function addObjectLiteralProperties(changes, context, info) { |
| 155026 | var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host); |
| 155027 | var quotePreference = ts.getQuotePreference(context.sourceFile, context.preferences); |
no test coverage detected