src/typing/type_visitor.ml (150 lines): - line 11: let pole_TODO = Polarity.Neutral - line 56: | MatchingPropT (_, _, t) -> self#type_ cx pole_TODO acc t - line 72: let acc = self#type_ cx pole_TODO acc t1 in - line 73: let acc = self#type_ cx pole_TODO acc t2 in - line 160: | Elem key -> self#type_ cx pole_TODO acc key - line 203: | ReactConfigType default_props -> self#type_ cx pole_TODO acc default_props - line 204: | ElementType { index_type; _ } -> self#type_ cx pole_TODO acc index_type - line 206: self#type_ cx pole_TODO acc index_type - line 210: | RestType (_, t) -> self#type_ cx pole_TODO acc t - line 218: self#type_ cx pole_TODO acc t - line 253: let acc = self#type_ cx pole_TODO acc t in - line 260: let acc = self#tout cx pole_TODO acc t in - line 264: let acc = self#type_ cx pole_TODO acc t in - line 269: let acc = self#tout cx pole_TODO acc t in - line 272: let acc = self#type_ cx pole_TODO acc e in - line 273: let acc = self#type_ cx pole_TODO acc tin in - line 277: let acc = self#type_ cx pole_TODO acc e in - line 278: let acc = self#tout cx pole_TODO acc t in - line 281: let acc = self#type_ cx pole_TODO acc t in - line 286: self#tout cx pole_TODO acc t - line 287: | SetProtoT (_, t) -> self#type_ cx pole_TODO acc t - line 289: | ReposUseT (_, _, _, t) -> self#type_ cx pole_TODO acc t - line 293: let acc = self#type_ cx pole_TODO acc t in - line 300: | ImplementsT (_, t) -> self#type_ cx pole_TODO acc t - line 301: | MixinT (_, t) -> self#type_ cx pole_TODO acc t - line 304: let acc = self#type_ cx pole_TODO acc a in - line 305: let acc = self#type_ cx pole_TODO acc b in - line 307: | ComparatorT { arg; _ } -> self#type_ cx pole_TODO acc arg - line 308: | UnaryMinusT (_, t) -> self#type_ cx pole_TODO acc t - line 318: let acc = self#tout cx pole_TODO acc t in - line 322: let acc = self#type_ cx pole_TODO acc t1 in - line 323: let acc = self#tout cx pole_TODO acc t2 in - line 327: self#type_ cx pole_TODO acc arg - line 328: | NotT (_, t) -> self#tout cx pole_TODO acc t - line 332: let acc = self#type_ cx pole_TODO acc a in - line 333: let acc = self#tout cx pole_TODO acc b in - line 337: let acc = self#type_ cx pole_TODO acc t in - line 340: let acc = self#type_ cx pole_TODO acc this in - line 350: let acc = self#type_ cx pole_TODO acc a in - line 351: let acc = self#type_ cx pole_TODO acc b in - line 355: | TypeCastT (_, t) -> self#type_ cx pole_TODO acc t - line 357: self#type_ cx pole_TODO acc representation_t - line 359: let acc = self#type_ cx pole_TODO acc incomplete_out in - line 366: (fun acc (obj_t, _) -> self#type_ cx pole_TODO acc obj_t) - line 371: let acc = self#type_ cx pole_TODO acc return in - line 372: self#type_ cx pole_TODO acc void_t - line 373: | FilterOptionalT (_, t) -> self#type_ cx pole_TODO acc t - line 374: | FilterMaybeT (_, t) -> self#type_ cx pole_TODO acc t - line 378: let acc = self#type_ cx pole_TODO acc t2 in - line 399: let acc = self#type_ cx pole_TODO acc t1 in - line 400: let acc = self#type_ cx pole_TODO acc t2 in - line 402: | ObjTestProtoT (_, t) -> self#type_ cx pole_TODO acc t - line 406: self#type_ cx pole_TODO acc t - line 408: let acc = self#type_ cx pole_TODO acc t1 in - line 409: let acc = self#type_ cx pole_TODO acc t2 in - line 411: | BecomeT { reason = _; t; empty_success = _ } -> self#type_ cx pole_TODO acc t - line 413: | GetValuesT (_, t) -> self#type_ cx pole_TODO acc t - line 416: let acc = self#type_ cx pole_TODO acc t in - line 429: let acc = self#export_types cx pole_TODO acc ts in - line 430: let acc = self#type_ cx pole_TODO acc t in - line 435: let acc = self#type_ cx pole_TODO acc t in - line 436: let acc = self#type_ cx pole_TODO acc tout in - line 440: let acc = self#type_ cx pole_TODO acc tout in - line 443: let visit_pair acc (_loc, t) = self#type_ cx pole_TODO acc t in - line 445: let acc = self#type_ cx pole_TODO acc tout in - line 449: let acc = self#type_ cx pole_TODO acc tout in - line 456: self#type_ cx pole_TODO acc t - line 458: let acc = self#type_ cx pole_TODO acc default_props in - line 459: self#type_ cx pole_TODO acc t - line 461: let acc = self#type_ cx pole_TODO acc config in - line 464: let acc = self#type_ cx pole_TODO acc tout in - line 467: let acc = self#type_ cx pole_TODO acc component in - line 468: let acc = self#type_ cx pole_TODO acc config in - line 471: let acc = self#type_ cx pole_TODO acc tout in - line 473: | React.ConfigCheck config -> self#type_ cx pole_TODO acc config - line 493: let acc = self#type_ cx pole_TODO acc t in - line 531: | One t -> self#type_ cx pole_TODO acc t - line 547: let acc = self#type_ cx pole_TODO acc tout in - line 553: let acc = self#type_ cx pole_TODO acc t in - line 554: let acc = self#tout cx pole_TODO acc tout in - line 558: self#type_ cx pole_TODO acc tout - line 560: let acc = self#type_ cx pole_TODO acc this_t in - line 562: self#type_ cx pole_TODO acc voided_out - line 565: let acc = self#type_ cx pole_TODO acc index_type in - line 566: self#tout cx pole_TODO acc tout_tvar - line 571: let acc = self#type_ cx pole_TODO acc t1 in - line 572: let acc = self#tout cx pole_TODO acc t2 in - line 574: | SubstOnPredT (_, _, _, t) -> self#type_ cx pole_TODO acc t - line 577: let acc = self#tout cx pole_TODO acc t in - line 581: self#type_ cx pole_TODO acc t - line 586: | ResolvedArg (t, _) -> self#type_ cx pole_TODO acc t - line 588: | ResolvedSpreadArg (_, arr, _) -> self#arr_type cx pole_TODO acc arr) - line 597: self#type_ cx pole_TODO acc t) - line 605: let acc = self#type_ cx pole_TODO acc t1 in - line 606: let acc = self#type_ cx pole_TODO acc t2 in - line 610: self#fun_type cx pole_TODO acc fn - line 613: let acc = self#type_ cx pole_TODO acc t in - line 616: let acc = self#fun_type cx pole_TODO acc fn in - line 617: let acc = self#type_ cx pole_TODO acc t in - line 621: let acc = self#type_ cx pole_TODO acc t in - line 627: let acc = self#type_ cx pole_TODO acc else_t in - line 628: let acc = self#type_ cx pole_TODO acc tout in - line 633: let acc = self#type_ cx pole_TODO acc t1 in - line 634: let acc = self#type_ cx pole_TODO acc t2 in - line 641: let acc = self#type_ cx pole_TODO acc t in - line 645: let acc = self#type_ cx pole_TODO acc t1 in - line 646: let acc = self#type_ cx pole_TODO acc t2 in - line 647: let acc = self#tout cx pole_TODO acc t3 in - line 650: let acc = self#type_ cx pole_TODO acc t1 in - line 651: let acc = self#tout cx pole_TODO acc t2 in - line 657: let acc = self#tout cx pole_TODO acc tout in - line 660: let acc = self#type_ cx pole_TODO acc value in - line 661: let acc = self#tout cx pole_TODO acc tout_tvar in - line 677: let acc = self#type_ cx pole_TODO acc key in - line 782: let acc = self#type_ cx pole_TODO acc call_this_t in - line 785: let acc = self#tout cx pole_TODO acc call_tout in - line 793: let acc = self#tout cx pole_TODO acc meth_tout in - line 797: let acc = self#type_ cx pole_TODO acc call_this_t in - line 813: let acc = self#type_ cx pole_TODO acc this in - line 815: self#type_ cx pole_TODO acc void_out - line 821: let acc = self#type_ cx pole_TODO acc this in - line 823: self#type_ cx pole_TODO acc void_out - line 828: | Computed t -> self#type_ cx pole_TODO acc t - line 840: let acc = self#props cx pole_TODO acc class_private_fields in - line 841: let acc = self#props cx pole_TODO acc class_private_static_fields in - line 842: let acc = self#props cx pole_TODO acc class_private_methods in - line 843: let acc = self#props cx pole_TODO acc class_private_static_methods in - line 848: | Arg t -> self#type_ cx pole_TODO acc t - line 849: | SpreadArg t -> self#type_ cx pole_TODO acc t - line 855: let acc = self#type_ cx pole_TODO acc t1 in - line 856: let acc = self#type_ cx pole_TODO acc t2 in - line 866: let acc = self#type_ cx pole_TODO acc t1 in - line 867: let acc = self#tout cx pole_TODO acc tout in - line 870: let acc = self#type_ cx pole_TODO acc obj_t in - line 872: let acc = self#type_ cx pole_TODO acc tin in - line 876: self#prop cx pole_TODO acc prop - line 877: | MatchProp { prop_t = t; _ } -> self#type_ cx pole_TODO acc t - line 881: | ReadElem tout -> self#tout cx pole_TODO acc tout - line 883: let acc = self#type_ cx pole_TODO acc tin in - line 890: | Lower (_, l) -> self#type_ cx pole_TODO acc l - line 899: self#type_ cx pole_TODO acc t - line 921: let acc = (seen', self#goal_id cx pole_TODO acc id) in - line 932: let acc = self#type_ cx pole_TODO acc t in - line 953: let acc = self#namemap (fun acc (t, _, _) -> self#type_ cx pole_TODO acc t) acc props in - line 954: let acc = self#obj_flags cx pole_TODO acc flags in - line 957: let acc = self#type_ cx pole_TODO acc static in - line 958: let acc = self#inst_type cx pole_TODO acc insttype in - line 979: | Type t -> self#type_ cx pole_TODO acc t - line 984: let acc = self#obj_flags cx pole_TODO acc flags in - line 992: let acc = self#dict_type cx pole_TODO acc dict in src/typing/statement.ml (32 lines): - line 276: (* TODO we could pass over `return;` since it's definitely returning `undefined`. It will likely - line 342: (* TODO: When we actually pass types down, we should create a type annotation - line 381: (* TODO: detect structural misuses abnormal control flow constructs *) - line 412: (* TODO disallow or push vars into env? *) - line 924: (* TODO or disallow? *) - line 960: (* TODO: use tparams_map *) - line 1008: (* TODO: use tparams_map *) - line 1191: (* TODO add API to do this without having to swap in env *) - line 1735: (None, Key_map.empty, Key_map.empty, Key_map.empty) (* TODO: prune the "not" case *) - line 2188: (* TODO we may want to provide a location here *) - line 2854: TODO: This treatment of spreads is oblivious to issues that arise when spreading expressions - line 3371: (* TODO - tuple_types could be undefined x N if given a literal *) - line 3471: (* TODO call loc_of_predicate on some pred? - line 3555: (* TODO: walk quasis? *) - line 3755: (* TODO *) - line 4218: (* TODO use hint in arg_list *) - line 4263: (* TODO: require *) - line 5289: TODO: This assumption does not always hold. - line 5522: (* TODO: await should look up Promise in the environment instead of going - line 5528: TODO update this comment when recursive unwrapping of - line 5801: (* TODO: object, array and non-member expression patterns are invalid - line 6018: * TODO: To relax that constraint, we need to be able to figure out how to - line 6419: (* TODO check attribute types against an fbt API *) - line 6443: (* TODO: why are these different? *) - line 6626: (* TODO: attributes with namespaced names *) - line 7483: (* TODO: add Type.predicate variant that tests number equality *) - line 7631: (* TODO: one day we can replace this with a call to `method_call`, and - line 7721: (* TODO: Don't trap method calls for now *) - line 7767: TODO: It should be possible to factor the processing of LHS / reference - line 8078: (* TODO *) - line 8251: (* TODO: Does this distinction matter for the type checker? *) - line 8707: (* TODO: this should be a parse error, unrepresentable AST *) src/typing/flow_js.ml (29 lines): - line 695: (* TODO: directly derive loc and desc from the reason of tvar *) - line 2146: (* TODO get rid of this *) - line 2373: TODO we can move to a single representation for singletons - - line 2465: (* TODO: for the moment we only support simple keys (empty projection) - line 2556: (* TODO: it is conceivable that other things (e.g. functions) could also be - line 2662: (* TODO: check that this is a subtype of i? *) - line 3174: TODO: The type constructors ShapeT, ObjAssignToT/ObjAssignFromT, - line 3320: (* TODO: Fix GetProtoT for InstanceT (and ClassT). - line 3529: (* TODO: closure *) - line 3739: AnyT as well. TODO: wait for `to_obj` to be resolved, and then call - line 4346: (* TODO: closure *) - line 4410: (* TODO: inherited_method logic no longer applies for statics. It used to - line 4475: TODO: also, symbols *) - line 4615: TODO: Call properties are excluded from the subclass compatibility - line 4842: * Due to this, we never error on property accesses. TODO: Build a - line 5017: (* TODO: These properties should go in Object.prototype. Currently we - line 5024: (* TODO: Ditto above comment for Function.prototype *) - line 5449: * TODO: handle symbols (which raise a TypeError, so should be banned) - line 6022: (* TODO: Punt on these for now, but figure out whether these should fall through or not *) - line 6109: (* TODO: Punt on these for now, but figure out whether these should fall through or not *) - line 6154: (* TODO: own_props/proto_props is misleading, since they come from interfaces, - line 7408: (* TODO: possibly unsound to filter out orig_obj here, but if we don't, - line 7486: (* TODO: intersection *) - line 7616: (* TODO: possibly unsound to filter out orig_obj here, but if we - line 7654: (* TODO: add test for sentinel test on implements *) - line 8409: (* TODO: Unification between concrete types is still implemented as - line 8416: (* TODO: either ensure that array_unify is the same as array_flow both ways, or - line 9121: (* TODO: In the FullyResolved case, repositioning will cause us to "lose" - line 9231: (* TODO: Even in this case, the type might recursively include tvars, which src/services/autocomplete/autocompleteService_js.ml (18 lines): - line 143: TODO: if we know a function property vs a member, we could - line 316: (* TODO consider making the $-prefixed names internal *) - line 493: (* TODO: since we're inserting values, we shouldn't really be using the Ty_printer *) - line 505: (* TODO: if we had both the expanded and unexpanded type alias, we'd - line 533: detail = "(global)" (* TODO: include the type *); - line 535: sort_text = sort_text_of_rank 101 (* TODO: use a constant *); - line 548: detail = title (* TODO: include the type *); - line 550: sort_text = sort_text_of_rank 100 (* TODO: use a constant *); - line 556: type_ = None (* TODO: include the type *); - line 608: (* TODO: filter to results that match `token` *) - line 673: type_ = None (* TODO: include the class type *); - line 693: type_ = None (* TODO: include the parent class type *); - line 741: (* TODO consider omitting items with internal names throughout *) - line 969: (* TODO: filter to results that match `token` *) - line 1176: (* TODO: only complete obj destructuring pattern when name is valid identifier *) - line 1349: (* TODO: make this configurable between React and react *) - line 1581: (* TODO: include superclass keys *) - line 1584: (* TODO: complete module names *) lib/dom.js (13 lines): - line 336: +target: EventTarget; // TODO: nullable - line 338: +srcElement: Element; // TODO: nullable - line 342: +currentTarget: EventTarget; // TODO: nullable - line 770: ranges?: Array, // TODO: StaticRange - line 780: getTargetRanges(): Array; // TODO: StaticRange - line 923: // TODO: *Event - line 1672: // TODO: HTMLDocument - line 4118: // TODO: HTML*Element - line 4215: // TODO: Add ReadableStream - line 4252: // TODO: The use of `typeof` makes this function signature effectively - line 4261: // TODO: window.NodeFilter exists at runtime and behaves as a constructor - line 4283: // TODO: window.NodeIterator exists at runtime and behaves as a constructor - line 4297: // TODO: window.TreeWalker exists at runtime and behaves as a constructor src/typing/subtyping_kit.ml (13 lines): - line 99: TODO: somehow the original flow needs to be propagated as well *) - line 504: TODO: Make these rules great again by computing more reasonable summary - line 705: (* TODO: ordered_reasons should not be necessary *) - line 715: (* TODO: ordered_reasons should not be necessary *) - line 725: (* TODO: ordered_reasons should not be necessary *) - line 891: * slices, but that approach behaves in nonobvious ways. TODO why? - line 1063: (* TODO: ideally we'd do the same when lower bounds flow to a - line 1283: TODO: somehow the original flow needs to be propagated as well *) - line 1515: * TODO: The type constructors ShapeT, ObjAssignToT/ObjAssignFromT, - line 1660: * TODO: This rule doesn't interact very well with union-type checking. It - line 1696: (* TODO: similar concern as above *) - line 1735: (* TODO matching on the use_op seems wrong *) - line 1761: * TODO: Call properties are excluded from the subclass compatibility src/typing/type_sig_merge.ml (12 lines): - line 63: * TODO Fix once T71257430 is closed. *) - line 127: (* TODO: use_op *) - line 132: (* TODO: use_op *) - line 236: (* TODO: use_op *) - line 244: (* TODO: use_op *) - line 259: (* TODO: use_op *) - line 265: (* TODO: use_op *) - line 954: * TODO Fix once T71257430 is closed. *) - line 995: (* TODO: fix spread to use provided __proto__ prop *) - line 1072: * TODO Fix once T71257430 is closed. *) - line 1088: * TODO Fix once T71257430 is closed. *) - line 1194: (* TODO: interfaces don't have a name field, or even statics *) src/services/code_action/autofix_imports.ml (12 lines): - line 28: (* TODO: sort global modules above ../ above ./ *) - line 38: (* TODO: handle requires *) - line 84: (* TODO: handle requires *) - line 149: (* TODO: support inserting requires - line 158: (* TODO: should add .default depending on facebook_module_interop *) - line 162: (* TODO: depends on facebook_module_interop *) - line 233: a separate import. TODO: maybe make this a config option? *) - line 275: import. TODO: maybe make this a config option? *) - line 281: TODO: maybe make this a config option? *) - line 287: TODO: maybe make this a config option? *) - line 423: (* TODO: confirm CJS/ESM interop, depends on flowconfig *) - line 680: (* TODO: we _could_ turn `import {a} from 'a'; import type {T} from 'a'` into src/parser_utils/exports/exports.ml (12 lines): - line 9: (* TODO: DefaultType, e.g. `export default class Foo {}` *) - line 127: (* TODO: get `_qual._name` *) - line 130: (* TODO: get `_qual._name` *) - line 146: (* TODO: remember these cross-module aliases. if the remote thing matches, - line 180: (* TODO: remember these cross-module aliases. if the remote thing matches, - line 205: | Value (ObjSpreadLit _) -> (* TODO *) Nothing - line 250: (* TODO: ExportFrom defines aliases, which we don't handle yet. TS - line 261: (* TODO: ExportTypeFrom defines aliases, which we don't handle yet. TS - line 267: (* TODO: re-exports *) - line 319: (* TODO: handle TEMPORARY_Object, ReadOnly, Exact, if they wrap objects? *) - line 342: (* TODO: ExportTypeFrom defines aliases, which we don't handle yet. TS - line 348: (* TODO: re-exports *) src/parser_utils/type_sig/type_sig_parse.ml (10 lines): - line 2215: (* TODO: error if targs <> None *) - line 2378: * we do in statement.ml. TODO: write a test and implement this. *) - line 2588: (* TODO: We should only special-case this logic if "require" is not aliased - line 2631: (* TODO: Similar to the "require" case above, we should only special-case - line 2651: (* TODO: In general, "keyMirror" could resolve to anything. It might not be - line 2852: ~err_loc:(Some id_loc) (* TODO: this seems wrong but matches TF1.0 *) - line 3023: (* TODO: OptionalMember *) - line 3089: (* TODO: should not refine if undefined is shadowed *) - line 3412: (* TODO: Instead of stopping at the first unexpected key, we should - line 4150: (* TODO: Assignment expressions can alter the actual type of something in src/typing/flow_js_utils.ml (9 lines): - line 496: (** TODO: (1) Define a more general partial equality, that takes into - line 1055: (* TODO: This rule allows interpreting an object as a type! - line 1209: (* TODO this Field should probably have a location *) - line 1260: (* TODO consider filtering these to OrdinaryNames only *) - line 1323: (* TODO consider filtering to OrdinaryNames only *) - line 1460: (* Remove locations. TODO at some point we may want to include them here. *) - line 1494: (* TODO we may want to add location information here *) - line 1532: (* TODO: own props should take precedence *) - line 1875: (* TODO consider converting to SMap here so downstream code doesn't need to src/typing/type.ml (8 lines): - line 194: (* TODO StrT should perhaps not allow internal names *) - line 210: (* TODO SingletonStrT should not include internal names *) - line 1493: (* TODO this should not allow internal names *) - line 2066: (* some types may not be evaluated yet; TODO *) - line 2237: Unknown (* TODO *) - line 3254: * but it's OK if they are in practice. TODO: consider making this an internal - line 3257: (* TODO: enumerate all use types *) - line 3328: TODO: Encoding formats in strings instead of ADTs is not ideal, obviously. *) src/common/reason.ml (8 lines): - line 69: (* TODO String literals should not be able to include internal names *) - line 146: (* TODO type names should not be able to be internal names *) - line 221: (* TODO React element names should not allow internal names *) - line 493: (* TODO return ALoc *) - line 809: (* TODO: Property accesses create unresolved tvars to hold results, even when - line 825: (* TODO consider avoiding the use of display_string_of_name here. For now, leaving as-is to - line 1126: (* TODO *) - line 1294: (* TODO: replace RCustom descriptions with proper descriptions *) src/services/inference/types_js.ml (8 lines): - line 405: * TODO: track unused suppressions *) - line 866: (* TODO (glevi) - One of the numbers we need to estimate is "If we restart how many files - line 1266: * TODO: Is OLD_M the same as NEW_M? - line 1283: (* TODO remove after lookup overhaul *) - line 1347: TODO: shouldn't this be captured by resolved_requires_changed because foo's - line 1352: TODO: we should be able to track the specific files this applies to and avoid - line 1920: (* TODO: update log to reflect current terminology **) - line 2186: (* TODO - explicitly order the libs. src/server/command_handler/commandHandler.ml (7 lines): - line 51: TODO: this should be a dedicated exception, but we have to make sure nothing - line 76: TODO: this should be a dedicated exception, but we have to make sure nothing - line 243: (* TODO: check status.directory *) - line 452: (* TODO: wow, this is a shady way to return no result! *) - line 597: (* TODO - this isn't exactly right. It could be something else, right? *) - line 2054: let on_error _ () = (* TODO send error to client *) () in - line 2074: let on_error _ () = (* TODO send error to client *) () in src/typing/members.ml (7 lines): - line 64: (* TODO: How to merge param names? *) - line 92: (* TODO: How to merge rest names and locs? *) - line 245: (* TODO: do we need to do anything special for merging Null with Void, - line 359: (* TODO we probably should filter out internal names too, but for now keeping behavior the same *) - line 415: (* TODO: replace type parameters with stable/proper names? *) - line 485: (* TODO: It isn't currently possible to return two types for a given - line 505: (* TODO: own props should take precedence *) src/typing/react_kit.ml (6 lines): - line 120: (* TODO: if intrinsic is null, we will treat it like prototype termination, - line 786: (* TODO: Don't ignore the required flag. *) - line 800: (* TODO: Don't ignore the required flag. *) - line 847: (* TODO: This is _very_ similar to `one_of` above. *) - line 871: (* TODO: Don't ignore the required flag. *) - line 917: (* TODO: If the resolved object is not exact and sealed, or if it does src/services/module/module_js.ml (6 lines): - line 177: (* TODO this exists only until we start resolving files using - line 182: to violate some well-hidden private agreements. TODO *) - line 191: (** TODO [perf]: investigate whether this takes too much memory **) - line 550: (* TODO: is it premature optimization to memoize this? how bad is doing the - line 584: TODO [perf]: measure size and possibly optimize *) - line 659: TODO: this shadow map is probably a perf bottleneck, get rid of it. lib/node.js (5 lines): - line 567: // TODO: enum type in crypto.constants - line 875: // TODO: See the comment above the events$EventEmitter declaration - line 2110: * TODO: takes a callback and returns `boolean` in v12+ - line 2117: * TODO: takes a callback and returns `boolean` in v12+ - line 2127: * TODO: takes a callback and returns `boolean` in v12+ src/parser/estree_translator.ml (5 lines): - line 339: default = _ (* TODO: confirm we shouldn't use this *); - line 418: (* TODO: arrows shouldn't have these: *) - line 808: (* TODO: extends shouldn't return an array *) - line 1457: (* TODO: add a node for the rest param itself, including the `...`, - line 1709: backwards-compatibility. TODO: change this? *) src/parser_utils/output/js_layout_generator.ml (5 lines): - line 276: (* TODO: this only needs to be shallow; we don't need to walk into function - line 288: (* TODO: use a fold *) - line 2042: (* TODO: getters/setters/constructors will never be async *) - line 2698: | None -> flat_ugly_space (* TODO we shouldn't do this for the last attr *) - line 2785: (* TODO: Remove the `Newline` hack, this forces newlines to exist src/common/errors/errors.ml (5 lines): - line 998: (* TODO: deprecate this in favor of Reason.json_of_loc *) - line 1005: (* TODO: return Hh_json.JSON_Null *) - line 1901: * TODO: Handle orphans gracefully. *) - line 2334: (* TODO: Get a SHA for each file when we parse it, and include the SHA in the - line 2560: (* TODO - if dash_length is less than 0 that means the line in question probably src/typing/type_annotation.ml (5 lines): - line 284: (* TODO *) - line 579: (* TODO: use `import typeof` instead when that lands **) - line 963: (* TODO move these to type aliases once optional type args - line 1805: (* TODO we could probably take the same shortcut for functions with an explicit `void` annotation - line 2230: (* TODO: interfaces don't have a name field, or even statics *) src/typing/env.ml (5 lines): - line 166: (* TODO maintain changelist here too *) - line 660: (* TODO currently we don't step on specific. shouldn't we? *) - line 853: * TODO: we started tracking annotations when variables are bound. Once we do - line 1260: (* TODO: remove extra info when surface syntax is added *) - line 1636: TODO rework the early-exit stuff to not break invariants. Until then it'll src/analysis/ssa_builder.ml (5 lines): - line 260: (* TODO: with_types should probably be false, but this maintains previous behavior *) - line 281: TODO: These low-level operations should probably be replaced by - line 495: (* TODO: what identifiers does `` read? *) - line 991: (* In general, cases are non-exhaustive. TODO: optimize with `default`. *) - line 1246: (* TODO: with_types should probably be false, but this maintains previous behavior *) src/typing/class_sig.ml (4 lines): - line 622: intersection of super types. TODO: Instead of using an intersection for - line 826: (* TODO: Ideally we should check polarity for all class types, but this flag is - line 836: (* TODO: use tparams_map instead of calculating this here *) - line 894: (* TODO: We can also specialize when there are targs, because this src/typing/slice_utils.ml (4 lines): - line 139: * be exact. TODO: Forbid writes to indexers through the photo chain. - line 1067: (* TODO $-prefixed names should be internal *) - line 1077: (* TODO $-prefixed names should be internal *) - line 1138: (* Statics of a class. TODO: This logic is unfortunately duplicated from the src/codemods/annotate_escaped_generics.ml (4 lines): - line 22: (* TODO consider just excluding internal names here. *) - line 44: (* TODO this use of display_string_of_name is a bit sketchy *) - line 126: (* TODO we should probably abort if we encounter an internal name here, rather than - line 222: (* TODO make tail-recursive *) src/services/autocomplete/autocomplete_js.ml (4 lines): - line 272: (* TODO: these are rare so we haven't implemented them yet *) - line 319: (* TODO: these are rare so we haven't implemented them yet *) - line 338: (* TODO: we shouldn't have to fabricate a type here! *) - line 527: (* TODO: we shouldn't have to fabricate a type here! *) src/services/export/export_service.ml (4 lines): - line 92: (* TODO: where does filename need to be searchable? *) - line 95: (* TODO: when a file changes, the below removes the file entirely and then adds - line 113: (* TODO: handle unchecked module names, maybe still parse? *) - line 158: (* TODO: assert that _to_remove is empty? should be on init *) src/services/inference/type_contents.ml (4 lines): - line 110: (* TODO consider asserting that there are no parse errors. *) - line 161: (* TODO: track unused suppressions *) - line 171: (* TODO: track unused suppressions *) - line 261: (** TODO: handle case when file+contents don't agree with file system state **) src/typing/env_resolution.ml (4 lines): - line 39: (* TODO: look up the annotation for the variable at loc and pass in *) - line 44: let reason = mk_reason (RCustom "for-in") loc (*TODO: loc should be loc of loop *) in - line 69: (* TODO: eveyrthing after a computed prop should be optional *) - line 75: (* TODO: change the way default works to see exp as a source *) src/typing/resolvableTypeJob.ml (3 lines): - line 166: (* TODO: The following kinds of types are not walked out of laziness. It's - line 175: standard walk). TODO: Rewriting this walker as a subclass of Type_visitor - line 312: (* TODO: Support for use types is currently sketchy. Full resolution of use src/common/files.ml (3 lines): - line 133: (* TODO: use Unix.realpath from OCaml 4.13+ *) - line 361: TODO: if all negated ignores are absolute, then we can check whether a - line 420: (* TODO: better to parse json files, not ignore them *) src/lsp/flowLsp.ml (3 lines): - line 1830: (* TODO - delete this line once this loop is fully lwt. At the moment, the idle loop never - line 1982: (* TODO - In the future if we start running check-contents on DidChange, we should probably - line 2308: (* TODO: use FlowConfig.get directly and send errors/warnings to the client instead src/parser/object_parser.ml (3 lines): - line 294: (* TODO: add support for object method predicates *) - line 771: (* TODO: add support for optional class properties *) - line 846: (* TODO: add support for method predicates *) src/typing/errors/error_message.ml (3 lines): - line 1334: * TODO (jmbrown): Maybe we should have two separate errors here-- one for type spread and - line 1519: (* TODO the $-prefixed names should be internal *) - line 2745: (* TODO: or symbol *) src/typing/type_inference_js.ml (3 lines): - line 22: (* TODO: Imports within `declare module`s can only reference other `declare - line 355: acc (* TODO (rballard): regional lint disabling *) - line 538: (* TODO: Wait a minute, why do we bother with requires for lib files? Pretty src/typing/destructuring.ml (3 lines): - line 12: (** TODO currently type annotations internal to patterns get parsed but not - line 151: | None -> () (* TODO: get-def when object property is refined *) - line 349: (* TODO destructuring+defaults unsupported in assignment expressions *) newtests/lsp/documentHighlight/test.js (3 lines): - line 141: // TODO it would be nice if the results included the use of the inherited class property. - line 144: // TODO it would be nice if the results included the use of the inherited class property. - line 147: // TODO it would be nice if this returned results. src/parser/flow_ast_mapper.ml (3 lines): - line 529: (* TODO *) - line 1574: (* TODO *) - line 2485: (* TODO *) src/analysis/env_builder/name_resolver.ml (3 lines): - line 1501: (* TODO: what identifiers does `` read? *) - line 2966: * TODO: figure out how to model the negation of an optional chain refinement without - line 3007: * TODO: we can't model this disjunction without heap refinements, so until then we newtests/lsp/selectionRange/test.js (3 lines): - line 1151: // TODO: include `extends `? not in the AST but could be useful - line 1498: // TODO: should include signature - line 1589: // TODO: should include signature src/common/ty/ty_serializer.ml (3 lines): - line 35: (* TODO consider issuing an error when we encounter an internal name *) - line 172: (* TODO: handle `this` constraints *) - line 227: (* TODO consider making it an error to try to serialize an internal name *) src/codemods/utils/codemod_runner.ml (3 lines): - line 389: (* TODO: refactor pre-pass to use Job_utils as well *) - line 428: (* TODO: build support for saved state *) - line 454: (* TODO: build support for saved state *) src/typing/debug_js.ml (2 lines): - line 32: | Elem _ -> "Elem _" (* TODO print info about the key *) - line 1600: (* TODO: string of parse error constructor *) src/hack_forked/watchman/watchman.ml (2 lines): - line 16: * TODO: - line 802: TODO: use `file_watcher.timeout` config instead (careful, it's in seconds) *) src/lsp/lspErrors.ml (2 lines): - line 37: * TODO: Guarantee that the streamed errors are complete. That once we stream down errors for - line 310: * TODO: Don't clear live parse errors. Those don't require the server, so we can still keep src/analysis/env_builder/invalidation_api.ml (2 lines): - line 41: (* TODO: anywhere where we would raise a Missing_def - line 73: (* TODO: anywhere where we would raise a Missing_def src/typing/merge_js.ml (2 lines): - line 310: (* TODO: replace this with the context_optimizer *) - line 367: (* TODO: it should not be possible to create a MatchingPropT with a non-tvar tout *) src/services/references/propertyFindRefs.ml (2 lines): - line 32: (* TODO consider supporting other property keys (e.g. literals). Also update the - line 88: (* TODO we may want to surface AnyType results somehow since we can't be sure whether they src/typing/errors/flow_error.ml (2 lines): - line 564: (* TODO the $-prefixed names should be internal *) - line 586: (* TODO the $-prefixed names should be internal *) src/parser_utils/output/printers/ast_diff_printer.ml (2 lines): - line 51: (* TODO use expression context for printing to insert parens when actually needed. *) - line 75: (* TODO if we are reprinting the entire program we probably want this to be src/parser_utils/output/printers/pretty_printer.ml (2 lines): - line 10: (* TODO: Make this configurable *) - line 58: (* TODO: need to consider `after`. and indent? *) src/parser/libflowparser.h (2 lines): - line 68: return convert_undefined(); // TODO: raise v8 exception - line 93: return convert_undefined(); // TODO: raise v8 exception src/typing/ty_normalizer.ml (2 lines): - line 1827: (* TODO: This will potentially report a remote name. - line 2111: (* TODO import namespaces (`ns`) as modules that might contain imported types *) src/services/code_action/insert_type.ml (2 lines): - line 384: (* TODO surface all errors *) - line 408: (* TODO: surface these errors to user *) src/parser/libflowparser.ml (2 lines): - line 31: let int x = number (float x) (* TODO: this is inefficient, push ints to C *) - line 92: (* TODO: register/handle Parse_error.Error *) src/services/references/propertyAccessSearcher.ml (2 lines): - line 80: | _ -> () (* TODO add type exports when find-refs supports them *) - line 83: (* TODO specifiers *) src/commands/autofixCommand.ml (2 lines): - line 130: (* TODO Figure out how to implement root striping *) - line 155: (* TODO implement a more useful set of error conditions *) src/typing/check_polarity.ml (2 lines): - line 14: (* TODO: flesh this out *) - line 160: (* TODO *) src/analysis/hoister.ml (2 lines): - line 16: TODO: Ideally implemented as a fold, not a map. - line 18: (* TODO: It should be possible to vastly simplify hoisting by overriding the src/typing/scope.ml (2 lines): - line 307: (* TODO lexical scope support *) - line 325: (* TODO add in-scope type variable binding table *) src/monitor/fileWatcher.ml (2 lines): - line 15: (* TODO - Push-based API for dfind. While the FileWatcher API is push based, dfind is faking it - line 397: (* TODO: handle this more gracefully than `failwith` *) src/analysis/env_builder/find_providers.ml (1 line): - line 742: (* TODO: It would be better if we modeled providers as Inter | UnionLike. This would src/codemods/utils/codemod_annotator.ml (1 line): - line 248: let size = Some 1 (* TODO *) in src/parser_utils/declare_function_utils.ml (1 line): - line 12: (* TODO: Would be better to handle declared functions directly rather than src/parser/jsx_parser.ml (1 line): - line 286: (* TODO: also say that we could expect an identifier, or if we're in a JSX child newtests/declare_module_imports/test.js (1 line): - line 69: * TODO: At the moment it isn't possible to import a non-libdef module from a src/parser/flow_lexer.ml (1 line): - line 877: (* TODO: Use [Symbol.iterator] instead of @@iterator. *) src/typing/object_kit.ml (1 line): - line 309: (* TODO: (jmbrown) we can be less strict here than unifying. It may be possible to src/typing/errors/error_suppressions.ml (1 line): - line 279: (* TODO: any related suppressions should not be considered used *) src/parser_utils/flow_ast_differ.ml (1 line): - line 1204: (* TODO *) src/typing/speculation_kit.ml (1 line): - line 347: again. TODO: there must be a better way *) src/typing/changeset.ml (1 line): - line 148: (Kill globals TODO: move to context.) src/commands/autocompleteCommand.ml (1 line): - line 108: (* TODO: remove this? kept for BC *) src/codemods/annotate_exports.ml (1 line): - line 278: | Ast.Class.Body.PrivateField (_loc, _field) -> elem (* TODO *) src/parser/parser_flow.ml (1 line): - line 242: (* TODO *) src/common/files.mli (1 line): - line 122: (* TODO: this doesn't match the signatures of the related functions above *) src/hack_forked/utils/sys/processor_info.c (1 line): - line 23: // TODO if we every start profiling Windows src/lsp/lspInteraction.ml (1 line): - line 350: (* TODO not sure if this is right, just need to unbreak the build. *) website/_webpack/js/tryFlow.js (1 line): - line 148: // TODO: show references src/services/coverage/coverage.ml (1 line): - line 226: (* TODO: Rethink coverage and trust for these types *) src/hack_forked/dfind/dfindAddFile.ml (1 line): - line 121: (* TODO add an option to support symlinks *) src/parser/expression_parser.ml (1 line): - line 1476: (* TODO: Delete once all expressions support comment attachment *) src/services/inference/merge_service.ml (1 line): - line 693: (* TODO: add new option *) src/commands/initCommand.ml (1 line): - line 71: | Ok (_, warnings) -> error warnings (* TODO: write warnings to stderr instead of exiting *) packages/flow-dev-tools/src/record/recordRunner.js (1 line): - line 179: // TODO - reorder records based on line number src/services/saved_state/compression/saved_state_compression_stubs.c (1 line): - line 24: // TODO - well todoish. If data is a string, we don't need to marshal it. src/commands/astCommand.ml (1 line): - line 148: TODO: make these CLI flags *) src/parser/lex_env.ml (1 line): - line 72: (* TODO *) src/heap/hh_shared.c (1 line): - line 1437: // TODO: Space between dst and info->heap is unused, but will almost certainly src/common/logging_utils/loggingUtils.ml (1 line): - line 21: (* TODO: min_level should probably default to warn, but was historically info *) src/monitor/flowServerMonitorServer.ml (1 line): - line 333: (* TODO (glevi) - We probably don't need to make the monitor exit when the file watcher dies. newtests/shadow/test.js (1 line): - line 106: // TODO: This should add more errors src/parser/statement_parser.ml (1 line): - line 1228: (* TODO: This is a semantic analysis and shouldn't be in the parser *) src/typing/annotation_inference.ml (1 line): - line 56: (* TODO: enumerate all use types *) src/typing/new_env.ml (1 line): - line 385: | OrdinaryName _ -> (* TODO *) None src/typing/typeUtil.ml (1 line): - line 181: (* TODO make a type visitor *) src/parser_utils/ast_builder.ml (1 line): - line 245: (* TODO: add property *) src/state/heaps/parsing/parsing_heaps.ml (1 line): - line 201: * TODO: Regarding the above, we might profitably separate these two notions of src/services/code_action/code_action_service.ml (1 line): - line 482: ~exports (* TODO consider filtering out internal names *) src/commands/getDefCommand.ml (1 line): - line 85: (* TODO: this format is deprecated but can't be backwards-compatible. src/parser_utils/output/source.ml (1 line): - line 104: (* TODO: Remove any right trailing whitespace *) src/commands/coverageCommand.ml (1 line): - line 145: (* TODO: Given that at this point we also have loc1.start.offset < src/typing/subst.ml (1 line): - line 255: failwith (Utils_js.spf "Unhandled type ctor: %s" (string_of_ctor t)) (* TODO *) src/codemods/utils/codemod_hardcoded_ty_fixes.ml (1 line): - line 54: (* TODO consider handling internal names explicitly *) lib/core.js (1 line): - line 352: // TODO: instance, static src/common/ty/ty.ml (1 line): - line 348: (* TODO consider implementing this without the string conversion. For now, leaving it this src/lsp/documentSymbolProvider.ml (1 line): - line 344: (* TODO *) src/parser_utils/signature_utils.ml (1 line): - line 46: (* TODO consider adding another name variant for munged property strings *) src/services/code_action/insert_type_imports.ml (1 line): - line 503: (* TODO we should probably give up if we are trying to generate an import statement with src/analysis/scope_builder.ml (1 line): - line 189: (* TODO: what identifiers does `` read? *) src/typing/type_inference_hooks_js.ml (1 line): - line 70: (* TODO: This is inconsistent with the way the id/member hooks work, but we src/server/server.ml (1 line): - line 223: (* TODO: The server should exit, but we should exit with a different src/services/get_def/getDefUtils.ml (1 line): - line 49: let reason_desc = reason_of_t ty (* TODO look into unwrap *) |> desc_of_reason ~unwrap:false in src/hack_forked/utils/collections/flow_set.ml (1 line): - line 144: (* FIXME: we should check to avoid creating unneeded Node src/commands/commandConnectSimple.ml (1 line): - line 103: (* TODO (glevi) - If we want this read to timeout on Windows, we need to make Marshal_tools src/commands/config/flowConfig.ml (1 line): - line 399: (* TODO: remove once .flowconfigs no longer use this setting *) src/services/inference/dep_service.ml (1 line): - line 87: TODO: Scanning the dependency graph to find reverse dependencies like this is not good! To avoid src/server/monitor_listener/serverMonitorListener.ml (1 line): - line 11: (* TODO - find a way to gracefully kill the workers. At the moment, if the workers are in the src/flow_dot_js.ml (1 line): - line 279: (* TODO: support suppressions *) src/parser_utils/aloc/aLoc.mli (1 line): - line 41: (* TODO move to ALocRepresentationDoNotUse *) src/common/exit_status/flowExitStatus.ml (1 line): - line 44: | Watchman_failed (** A fatal error with Watchman (TODO: dedupe with Watchman_error) *) src/services/export/index/export_index.ml (1 line): - line 43: TODO: this is a very coarse ranking. We could do much better. For example, we new_website/src/pages/index.js (1 line): - line 49: {/* TODO: add release */} src/heap/sharedMem.ml (1 line): - line 1649: * TODO: It is unfortunate that this function duplicates so much of the logic lib/bom.js (1 line): - line 1467: // TODO Heades and URLSearchParams are almost the same thing. src/common/semver/semver_range.ml (1 line): - line 12: (* TODO: support unions (`||`), like this: src/hack_forked/utils/lsp/lsp_fmt.ml (1 line): - line 427: activeSignatureHelp = None (* TODO *); src/services/type_info/type_info_service.ml (1 line): - line 60: ((* TODO use Ty_debug.json_of_t after making it faster using count_calls *) src/parsing/parsing_service_js.ml (1 line): - line 80: (* TODO: add TypesForbidden (disables types even on files with @flow) and