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

Function getContextualJsxElementAttributesType

test/fixtures/snapshot/typescript.js:73056–73064  ·  view source on GitHub ↗
(node, contextFlags)

Source from the content-addressed store, hash-verified

73054 return ancestor && ancestor.inferenceContext;
73055 }
73056 function getContextualJsxElementAttributesType(node, contextFlags) {
73057 if (ts.isJsxOpeningElement(node) && node.parent.contextualType && contextFlags !== 4 /* ContextFlags.Completions */) {
73058 // Contextually applied type is moved from attributes up to the outer jsx attributes so when walking up from the children they get hit
73059 // _However_ to hit them from the _attributes_ we must look for them here; otherwise we'll used the declared type
73060 // (as below) instead!
73061 return node.parent.contextualType;
73062 }
73063 return getContextualTypeForArgumentAtIndex(node, 0);
73064 }
73065 function getEffectiveFirstArgumentForJsxSignature(signature, node) {
73066 return getJsxReferenceKind(node) !== 0 /* JsxReferenceKind.Component */
73067 ? getJsxPropsTypeFromCallSignature(signature, node)

Callers 1

getContextualTypeFunction · 0.85

Tested by

no test coverage detected