From f3f8889f87db7fd992f2c853d5c60a17fbff41c3 Mon Sep 17 00:00:00 2001 From: Dhruv Makwana Date: Tue, 3 Apr 2018 19:03:56 +0100 Subject: [PATCH] Fix #1868: Merlin typed-hole formatted incorrectly --- src/reason-parser/reason_pprint_ast.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reason-parser/reason_pprint_ast.ml b/src/reason-parser/reason_pprint_ast.ml index d2829acaf..bc73732cb 100644 --- a/src/reason-parser/reason_pprint_ast.ml +++ b/src/reason-parser/reason_pprint_ast.ml @@ -1760,6 +1760,8 @@ let typeApplicationFinalWrapping typeApplicationItems = (* add parentheses to binders when they are in fact infix or prefix operators *) let protectIdentifier txt = + (* (??) is a typed-hole in Merlin *) + if txt = "??" then atom "(??)" else if not (needs_parens txt) then atom txt else if needs_spaces txt then makeList ~wrap:("(", ")") ~pad:(true, true) [atom txt] else atom ("(" ^ txt ^ ")")