diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 44798735ca..b1463ce7d7 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -1816,9 +1816,6 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = let keyLabels = if Utils.startsWith "key" prefix then [mkLabel ("key", "string")] else [] in - (* We always try to look up completion from the actual domProps type first. - This works in JSXv4. For JSXv3, we have a backup hardcoded list of dom - labels we can use for completion. *) let pathToElementProps = TypeUtils.pathToElementProps package in if Debug.verbose () then Printf.printf @@ -1852,12 +1849,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = Printf.printf "[completing-lowercase-jsx] could not find element props to complete \ from.\n"; - (CompletionJsx.domLabels - |> List.filter (fun (name, _t) -> - Utils.startsWith name prefix - && (forHover || not (List.mem name identsSeen))) - |> List.map mkLabel) - @ keyLabels) + keyLabels) | Cjsx (componentPath, prefix, identsSeen) -> let labels = CompletionJsx.getJsxLabels ~componentPath ~findTypeOfValue ~package diff --git a/analysis/src/CompletionJsx.ml b/analysis/src/CompletionJsx.ml index e7368daff0..4d68ad3098 100644 --- a/analysis/src/CompletionJsx.ml +++ b/analysis/src/CompletionJsx.ml @@ -1,492 +1,5 @@ open SharedTypes -let domLabels = - let bool = "bool" in - let float = "float" in - let int = "int" in - let string = "string" in - [ - ("ariaDetails", string); - ("ariaDisabled", bool); - ("ariaHidden", bool); - ("ariaKeyshortcuts", string); - ("ariaLabel", string); - ("ariaRoledescription", string); - ("ariaExpanded", bool); - ("ariaLevel", int); - ("ariaModal", bool); - ("ariaMultiline", bool); - ("ariaMultiselectable", bool); - ("ariaPlaceholder", string); - ("ariaReadonly", bool); - ("ariaRequired", bool); - ("ariaSelected", bool); - ("ariaSort", string); - ("ariaValuemax", float); - ("ariaValuemin", float); - ("ariaValuenow", float); - ("ariaValuetext", string); - ("ariaAtomic", bool); - ("ariaBusy", bool); - ("ariaRelevant", string); - ("ariaGrabbed", bool); - ("ariaActivedescendant", string); - ("ariaColcount", int); - ("ariaColindex", int); - ("ariaColspan", int); - ("ariaControls", string); - ("ariaDescribedby", string); - ("ariaErrormessage", string); - ("ariaFlowto", string); - ("ariaLabelledby", string); - ("ariaOwns", string); - ("ariaPosinset", int); - ("ariaRowcount", int); - ("ariaRowindex", int); - ("ariaRowspan", int); - ("ariaSetsize", int); - ("defaultChecked", bool); - ("defaultValue", string); - ("accessKey", string); - ("className", string); - ("contentEditable", bool); - ("contextMenu", string); - ("dir", string); - ("draggable", bool); - ("hidden", bool); - ("id", string); - ("lang", string); - ("style", "style"); - ("spellCheck", bool); - ("tabIndex", int); - ("title", string); - ("itemID", string); - ("itemProp", string); - ("itemRef", string); - ("itemScope", bool); - ("itemType", string); - ("accept", string); - ("acceptCharset", string); - ("action", string); - ("allowFullScreen", bool); - ("alt", string); - ("async", bool); - ("autoComplete", string); - ("autoCapitalize", string); - ("autoFocus", bool); - ("autoPlay", bool); - ("challenge", string); - ("charSet", string); - ("checked", bool); - ("cite", string); - ("crossOrigin", string); - ("cols", int); - ("colSpan", int); - ("content", string); - ("controls", bool); - ("coords", string); - ("data", string); - ("dateTime", string); - ("default", bool); - ("defer", bool); - ("disabled", bool); - ("download", string); - ("encType", string); - ("form", string); - ("formAction", string); - ("formTarget", string); - ("formMethod", string); - ("headers", string); - ("height", string); - ("high", int); - ("href", string); - ("hrefLang", string); - ("htmlFor", string); - ("httpEquiv", string); - ("icon", string); - ("inputMode", string); - ("integrity", string); - ("keyType", string); - ("label", string); - ("list", string); - ("loop", bool); - ("low", int); - ("manifest", string); - ("max", string); - ("maxLength", int); - ("media", string); - ("mediaGroup", string); - ("method", string); - ("min", string); - ("minLength", int); - ("multiple", bool); - ("muted", bool); - ("name", string); - ("nonce", string); - ("noValidate", bool); - ("open_", bool); - ("optimum", int); - ("pattern", string); - ("placeholder", string); - ("playsInline", bool); - ("poster", string); - ("preload", string); - ("radioGroup", string); - ("readOnly", bool); - ("rel", string); - ("required", bool); - ("reversed", bool); - ("rows", int); - ("rowSpan", int); - ("sandbox", string); - ("scope", string); - ("scoped", bool); - ("scrolling", string); - ("selected", bool); - ("shape", string); - ("size", int); - ("sizes", string); - ("span", int); - ("src", string); - ("srcDoc", string); - ("srcLang", string); - ("srcSet", string); - ("start", int); - ("step", float); - ("summary", string); - ("target", string); - ("type_", string); - ("useMap", string); - ("value", string); - ("width", string); - ("wrap", string); - ("onCopy", "ReactEvent.Clipboard.t => unit"); - ("onCut", "ReactEvent.Clipboard.t => unit"); - ("onPaste", "ReactEvent.Clipboard.t => unit"); - ("onCompositionEnd", "ReactEvent.Composition.t => unit"); - ("onCompositionStart", "ReactEvent.Composition.t => unit"); - ("onCompositionUpdate", "ReactEvent.Composition.t => unit"); - ("onKeyDown", "ReactEvent.Keyboard.t => unit"); - ("onKeyPress", "ReactEvent.Keyboard.t => unit"); - ("onKeyUp", "ReactEvent.Keyboard.t => unit"); - ("onFocus", "ReactEvent.Focus.t => unit"); - ("onBlur", "ReactEvent.Focus.t => unit"); - ("onChange", "ReactEvent.Form.t => unit"); - ("onInput", "ReactEvent.Form.t => unit"); - ("onSubmit", "ReactEvent.Form.t => unit"); - ("onInvalid", "ReactEvent.Form.t => unit"); - ("onClick", "ReactEvent.Mouse.t => unit"); - ("onContextMenu", "ReactEvent.Mouse.t => unit"); - ("onDoubleClick", "ReactEvent.Mouse.t => unit"); - ("onDrag", "ReactEvent.Mouse.t => unit"); - ("onDragEnd", "ReactEvent.Mouse.t => unit"); - ("onDragEnter", "ReactEvent.Mouse.t => unit"); - ("onDragExit", "ReactEvent.Mouse.t => unit"); - ("onDragLeave", "ReactEvent.Mouse.t => unit"); - ("onDragOver", "ReactEvent.Mouse.t => unit"); - ("onDragStart", "ReactEvent.Mouse.t => unit"); - ("onDrop", "ReactEvent.Mouse.t => unit"); - ("onMouseDown", "ReactEvent.Mouse.t => unit"); - ("onMouseEnter", "ReactEvent.Mouse.t => unit"); - ("onMouseLeave", "ReactEvent.Mouse.t => unit"); - ("onMouseMove", "ReactEvent.Mouse.t => unit"); - ("onMouseOut", "ReactEvent.Mouse.t => unit"); - ("onMouseOver", "ReactEvent.Mouse.t => unit"); - ("onMouseUp", "ReactEvent.Mouse.t => unit"); - ("onSelect", "ReactEvent.Selection.t => unit"); - ("onTouchCancel", "ReactEvent.Touch.t => unit"); - ("onTouchEnd", "ReactEvent.Touch.t => unit"); - ("onTouchMove", "ReactEvent.Touch.t => unit"); - ("onTouchStart", "ReactEvent.Touch.t => unit"); - ("onPointerOver", "ReactEvent.Pointer.t => unit"); - ("onPointerEnter", "ReactEvent.Pointer.t => unit"); - ("onPointerDown", "ReactEvent.Pointer.t => unit"); - ("onPointerMove", "ReactEvent.Pointer.t => unit"); - ("onPointerUp", "ReactEvent.Pointer.t => unit"); - ("onPointerCancel", "ReactEvent.Pointer.t => unit"); - ("onPointerOut", "ReactEvent.Pointer.t => unit"); - ("onPointerLeave", "ReactEvent.Pointer.t => unit"); - ("onGotPointerCapture", "ReactEvent.Pointer.t => unit"); - ("onLostPointerCapture", "ReactEvent.Pointer.t => unit"); - ("onScroll", "ReactEvent.UI.t => unit"); - ("onWheel", "ReactEvent.Wheel.t => unit"); - ("onAbort", "ReactEvent.Media.t => unit"); - ("onCanPlay", "ReactEvent.Media.t => unit"); - ("onCanPlayThrough", "ReactEvent.Media.t => unit"); - ("onDurationChange", "ReactEvent.Media.t => unit"); - ("onEmptied", "ReactEvent.Media.t => unit"); - ("onEncrypetd", "ReactEvent.Media.t => unit"); - ("onEnded", "ReactEvent.Media.t => unit"); - ("onError", "ReactEvent.Media.t => unit"); - ("onLoadedData", "ReactEvent.Media.t => unit"); - ("onLoadedMetadata", "ReactEvent.Media.t => unit"); - ("onLoadStart", "ReactEvent.Media.t => unit"); - ("onPause", "ReactEvent.Media.t => unit"); - ("onPlay", "ReactEvent.Media.t => unit"); - ("onPlaying", "ReactEvent.Media.t => unit"); - ("onProgress", "ReactEvent.Media.t => unit"); - ("onRateChange", "ReactEvent.Media.t => unit"); - ("onSeeked", "ReactEvent.Media.t => unit"); - ("onSeeking", "ReactEvent.Media.t => unit"); - ("onStalled", "ReactEvent.Media.t => unit"); - ("onSuspend", "ReactEvent.Media.t => unit"); - ("onTimeUpdate", "ReactEvent.Media.t => unit"); - ("onVolumeChange", "ReactEvent.Media.t => unit"); - ("onWaiting", "ReactEvent.Media.t => unit"); - ("onAnimationStart", "ReactEvent.Animation.t => unit"); - ("onAnimationEnd", "ReactEvent.Animation.t => unit"); - ("onAnimationIteration", "ReactEvent.Animation.t => unit"); - ("onTransitionEnd", "ReactEvent.Transition.t => unit"); - ("accentHeight", string); - ("accumulate", string); - ("additive", string); - ("alignmentBaseline", string); - ("allowReorder", string); - ("alphabetic", string); - ("amplitude", string); - ("arabicForm", string); - ("ascent", string); - ("attributeName", string); - ("attributeType", string); - ("autoReverse", string); - ("azimuth", string); - ("baseFrequency", string); - ("baseProfile", string); - ("baselineShift", string); - ("bbox", string); - ("bias", string); - ("by", string); - ("calcMode", string); - ("capHeight", string); - ("clip", string); - ("clipPath", string); - ("clipPathUnits", string); - ("clipRule", string); - ("colorInterpolation", string); - ("colorInterpolationFilters", string); - ("colorProfile", string); - ("colorRendering", string); - ("contentScriptType", string); - ("contentStyleType", string); - ("cursor", string); - ("cx", string); - ("cy", string); - ("d", string); - ("decelerate", string); - ("descent", string); - ("diffuseConstant", string); - ("direction", string); - ("display", string); - ("divisor", string); - ("dominantBaseline", string); - ("dur", string); - ("dx", string); - ("dy", string); - ("edgeMode", string); - ("elevation", string); - ("enableBackground", string); - ("exponent", string); - ("externalResourcesRequired", string); - ("fill", string); - ("fillOpacity", string); - ("fillRule", string); - ("filter", string); - ("filterRes", string); - ("filterUnits", string); - ("floodColor", string); - ("floodOpacity", string); - ("focusable", string); - ("fontFamily", string); - ("fontSize", string); - ("fontSizeAdjust", string); - ("fontStretch", string); - ("fontStyle", string); - ("fontVariant", string); - ("fontWeight", string); - ("fomat", string); - ("from", string); - ("fx", string); - ("fy", string); - ("g1", string); - ("g2", string); - ("glyphName", string); - ("glyphOrientationHorizontal", string); - ("glyphOrientationVertical", string); - ("glyphRef", string); - ("gradientTransform", string); - ("gradientUnits", string); - ("hanging", string); - ("horizAdvX", string); - ("horizOriginX", string); - ("ideographic", string); - ("imageRendering", string); - ("in2", string); - ("intercept", string); - ("k", string); - ("k1", string); - ("k2", string); - ("k3", string); - ("k4", string); - ("kernelMatrix", string); - ("kernelUnitLength", string); - ("kerning", string); - ("keyPoints", string); - ("keySplines", string); - ("keyTimes", string); - ("lengthAdjust", string); - ("letterSpacing", string); - ("lightingColor", string); - ("limitingConeAngle", string); - ("local", string); - ("markerEnd", string); - ("markerHeight", string); - ("markerMid", string); - ("markerStart", string); - ("markerUnits", string); - ("markerWidth", string); - ("mask", string); - ("maskContentUnits", string); - ("maskUnits", string); - ("mathematical", string); - ("mode", string); - ("numOctaves", string); - ("offset", string); - ("opacity", string); - ("operator", string); - ("order", string); - ("orient", string); - ("orientation", string); - ("origin", string); - ("overflow", string); - ("overflowX", string); - ("overflowY", string); - ("overlinePosition", string); - ("overlineThickness", string); - ("paintOrder", string); - ("panose1", string); - ("pathLength", string); - ("patternContentUnits", string); - ("patternTransform", string); - ("patternUnits", string); - ("pointerEvents", string); - ("points", string); - ("pointsAtX", string); - ("pointsAtY", string); - ("pointsAtZ", string); - ("preserveAlpha", string); - ("preserveAspectRatio", string); - ("primitiveUnits", string); - ("r", string); - ("radius", string); - ("refX", string); - ("refY", string); - ("renderingIntent", string); - ("repeatCount", string); - ("repeatDur", string); - ("requiredExtensions", string); - ("requiredFeatures", string); - ("restart", string); - ("result", string); - ("rotate", string); - ("rx", string); - ("ry", string); - ("scale", string); - ("seed", string); - ("shapeRendering", string); - ("slope", string); - ("spacing", string); - ("specularConstant", string); - ("specularExponent", string); - ("speed", string); - ("spreadMethod", string); - ("startOffset", string); - ("stdDeviation", string); - ("stemh", string); - ("stemv", string); - ("stitchTiles", string); - ("stopColor", string); - ("stopOpacity", string); - ("strikethroughPosition", string); - ("strikethroughThickness", string); - (string, string); - ("stroke", string); - ("strokeDasharray", string); - ("strokeDashoffset", string); - ("strokeLinecap", string); - ("strokeLinejoin", string); - ("strokeMiterlimit", string); - ("strokeOpacity", string); - ("strokeWidth", string); - ("surfaceScale", string); - ("systemLanguage", string); - ("tableValues", string); - ("targetX", string); - ("targetY", string); - ("textAnchor", string); - ("textDecoration", string); - ("textLength", string); - ("textRendering", string); - ("transform", string); - ("u1", string); - ("u2", string); - ("underlinePosition", string); - ("underlineThickness", string); - ("unicode", string); - ("unicodeBidi", string); - ("unicodeRange", string); - ("unitsPerEm", string); - ("vAlphabetic", string); - ("vHanging", string); - ("vIdeographic", string); - ("vMathematical", string); - ("values", string); - ("vectorEffect", string); - ("version", string); - ("vertAdvX", string); - ("vertAdvY", string); - ("vertOriginX", string); - ("vertOriginY", string); - ("viewBox", string); - ("viewTarget", string); - ("visibility", string); - ("widths", string); - ("wordSpacing", string); - ("writingMode", string); - ("x", string); - ("x1", string); - ("x2", string); - ("xChannelSelector", string); - ("xHeight", string); - ("xlinkActuate", string); - ("xlinkArcrole", string); - ("xlinkHref", string); - ("xlinkRole", string); - ("xlinkShow", string); - ("xlinkTitle", string); - ("xlinkType", string); - ("xmlns", string); - ("xmlnsXlink", string); - ("xmlBase", string); - ("xmlLang", string); - ("xmlSpace", string); - ("y", string); - ("y1", string); - ("y2", string); - ("yChannelSelector", string); - ("z", string); - ("zoomAndPan", string); - ("about", string); - ("datatype", string); - ("inlist", string); - ("prefix", string); - ("property", string); - ("resource", string); - ("typeof", string); - ("vocab", string); - ("dangerouslySetInnerHTML", "{\"__html\": string}"); - ("suppressContentEditableWarning", bool); - ] - (* List and explanations taken from https://www.tutorialrepublic.com/html-reference/html5-tags.php. *) let htmlElements = @@ -697,16 +210,7 @@ let htmlElements = let getJsxLabels ~componentPath ~findTypeOfValue ~package = match componentPath @ ["make"] |> findTypeOfValue with | Some (typ, make_env) -> - let rec getFieldsV3 (texp : Types.type_expr) = - match texp.desc with - | Tfield (name, _, t1, t2) -> - let fields = t2 |> getFieldsV3 in - if name = "children" then fields else (name, t1, make_env) :: fields - | Tlink te | Tsubst te | Tpoly (te, []) -> te |> getFieldsV3 - | Tvar None -> [] - | _ -> [] - in - let getFieldsV4 ~path ~typeArgs = + let getFields ~path ~typeArgs = match References.digConstructor ~env:make_env ~package path with | Some ( env, @@ -736,17 +240,6 @@ let getJsxLabels ~componentPath ~findTypeOfValue ~package = | Tpoly (t1, []) | Tconstr (Pident {name = "function$"}, [t1; _], _) -> getLabels t1 - | Tarrow - ( Nolabel, - { - desc = - ( Tconstr (* Js.t *) (_, [{desc = Tobject (tObj, _)}], _) - | Tobject (tObj, _) ); - }, - _, - _ ) -> - (* JSX V3 *) - getFieldsV3 tObj | Tconstr (p, [propsType], _) when Path.name p = "React.component" -> ( let rec getPropsType (t : Types.type_expr) = match t.desc with @@ -756,31 +249,16 @@ let getJsxLabels ~componentPath ~findTypeOfValue ~package = | _ -> None in match propsType |> getPropsType with - | Some (path, typeArgs) -> getFieldsV4 ~path ~typeArgs + | Some (path, typeArgs) -> getFields ~path ~typeArgs | None -> []) | Tarrow (Nolabel, {desc = Tconstr (path, typeArgs, _)}, _, _) when Path.last path = "props" -> - (* JSX V4 *) - getFieldsV4 ~path ~typeArgs - | Tconstr - ( clPath, - [ - { - desc = - ( Tconstr (* Js.t *) (_, [{desc = Tobject (tObj, _)}], _) - | Tobject (tObj, _) ); - }; - _; - ], - _ ) - when Path.name clPath = "React.componentLike" -> - (* JSX V3 external or interface *) - getFieldsV3 tObj + getFields ~path ~typeArgs | Tconstr (clPath, [{desc = Tconstr (path, typeArgs, _)}; _], _) when Path.name clPath = "React.componentLike" && Path.last path = "props" -> (* JSX V4 external or interface *) - getFieldsV4 ~path ~typeArgs + getFields ~path ~typeArgs | Tarrow (Nolabel, typ, _, _) -> ( (* Component without the JSX PPX, like a make fn taking a hand-written type props. *) @@ -793,7 +271,7 @@ let getJsxLabels ~componentPath ~findTypeOfValue ~package = in match digToConstr typ with | None -> [] - | Some (path, typeArgs) -> getFieldsV4 ~path ~typeArgs) + | Some (path, typeArgs) -> getFields ~path ~typeArgs) | _ -> [] in typ |> getLabels diff --git a/analysis/src/CreateInterface.ml b/analysis/src/CreateInterface.ml index 9f1774b820..a3c19666c1 100644 --- a/analysis/src/CreateInterface.ml +++ b/analysis/src/CreateInterface.ml @@ -99,52 +99,6 @@ end = struct end let printSignature ~extractor ~signature = - let objectPropsToFun objTyp ~rhs ~makePropsType = - let propsTbl = Hashtbl.create 1 in - (* Process the object type of the make function, and map field names to types. *) - let rec processObjType typ = - match typ.Types.desc with - | Tfield (name, kind, {desc = Tlink t | Tsubst t | Tpoly (t, [])}, obj) -> - processObjType {typ with desc = Tfield (name, kind, t, obj)} - | Tfield (name, _kind, t, obj) -> - Hashtbl.add propsTbl name t; - processObjType obj - | Tnil -> () - | _ -> (* should not happen *) assert false - in - - processObjType objTyp; - - (* Traverse the type of the makeProps function, and fill the prop types - by using the corresponding field in the object type of the make function *) - let rec fillPropsTypes makePropsType ~rhs = - match makePropsType.Types.desc with - | Tarrow (((Labelled lbl | Optional lbl) as argLbl), _, retT, c) -> ( - match Hashtbl.find_opt propsTbl lbl with - | Some propT -> - { - makePropsType with - desc = Tarrow (argLbl, propT, fillPropsTypes retT ~rhs, c); - } - | None -> fillPropsTypes retT ~rhs) - | _ -> rhs - in - - match objTyp.Types.desc with - | Tnil -> - (* component with zero props *) - { - objTyp with - desc = - Tarrow - ( Nolabel, - Ctype.newconstr (Path.Pident (Ident.create "unit")) [], - rhs, - Cok ); - } - | _ -> fillPropsTypes makePropsType ~rhs - in - Printtyp.reset_names (); let sigItemToString (item : Outcometree.out_sig_item) = item |> Res_outcome_printer.print_out_sig_item_doc @@ -164,34 +118,12 @@ let printSignature ~extractor ~signature = let buf = Buffer.create 10 in - let rec getComponentTypeV3 (typ : Types.type_expr) = + let rec getComponentType (typ : Types.type_expr) = let reactElement = Ctype.newconstr (Pdot (Pident (Ident.create "React"), "element", 0)) [] in match typ.desc with - | Tconstr (Pident {name = "function$"}, [typ; _], _) -> - getComponentTypeV3 typ - | Tarrow (_, {desc = Tobject (tObj, _)}, retType, _) -> Some (tObj, retType) - | Tconstr - ( Pdot (Pident {name = "React"}, "component", _), - [{desc = Tobject (tObj, _)}], - _ ) -> - Some (tObj, reactElement) - | Tconstr - ( Pdot (Pident {name = "React"}, "componentLike", _), - [{desc = Tobject (tObj, _)}; retType], - _ ) -> - Some (tObj, retType) - | _ -> None - in - - let rec getComponentTypeV4 (typ : Types.type_expr) = - let reactElement = - Ctype.newconstr (Pdot (Pident (Ident.create "React"), "element", 0)) [] - in - match typ.desc with - | Tconstr (Pident {name = "function$"}, [typ; _], _) -> - getComponentTypeV4 typ + | Tconstr (Pident {name = "function$"}, [typ; _], _) -> getComponentType typ | Tarrow (_, {desc = Tconstr (Path.Pident propsId, typeArgs, _)}, retType, _) when Ident.name propsId = "props" -> Some (typeArgs, retType) @@ -212,34 +144,6 @@ let printSignature ~extractor ~signature = let rec processSignature ~indent (signature : Types.signature) : unit = match signature with - | Sig_value - ( makePropsId (* makeProps *), - {val_loc = makePropsLoc; val_type = makePropsType} ) - :: Sig_value (makeId (* make *), makeValueDesc) - :: rest - when Ident.name makePropsId = Ident.name makeId ^ "Props" - && ((* from implementation *) makePropsLoc.loc_ghost - || (* from interface *) makePropsLoc = makeValueDesc.val_loc) - && getComponentTypeV3 makeValueDesc.val_type <> None -> - (* - {"name": string} => retType ~~> (~name:string) => retType - React.component<{"name": string}> ~~> (~name:string) => React.element - React.componentLike<{"name": string}, retType> ~~> (~name:string) => retType - *) - let tObj, retType = - match getComponentTypeV3 makeValueDesc.val_type with - | None -> assert false - | Some (tObj, retType) -> (tObj, retType) - in - let funType = tObj |> objectPropsToFun ~rhs:retType ~makePropsType in - let newItemStr = - sigItemToString - (Printtyp.tree_of_value_description makeId - {makeValueDesc with val_type = funType}) - in - Buffer.add_string buf (indent ^ "@react.component\n"); - Buffer.add_string buf (indent ^ newItemStr ^ "\n"); - processSignature ~indent rest | Sig_type ( propsId, { @@ -250,14 +154,14 @@ let printSignature ~extractor ~signature = :: Sig_value (makeId (* make *), makeValueDesc) :: rest when Ident.name propsId = "props" - && getComponentTypeV4 makeValueDesc.val_type <> None -> + && getComponentType makeValueDesc.val_type <> None -> (* PPX V4 component declaration: type props = {...} let v = ... *) let newItemStr = let typeArgs, retType = - match getComponentTypeV4 makeValueDesc.val_type with + match getComponentType makeValueDesc.val_type with | Some x -> x | None -> assert false in