Skip to content

Commit cb54388

Browse files
committed
Print pattern constructor.
1 parent 6e67aef commit cb54388

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

analysis/src/CompletionFrontEnd.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,13 @@ let completionWithParser ~debug ~path ~posCursor ~currentFile ~text =
683683
Printf.printf "posCursor:[%s] posNoWhite:[%s] Found pattern:%s\n"
684684
(Pos.toString posCursor) (Pos.toString posNoWhite)
685685
(Loc.toString pat.ppat_loc);
686+
(match pat.ppat_desc with
687+
| Ppat_construct (lid, _) ->
688+
if debug then
689+
Printf.printf "XXX Ppat_construct %s:%s\n"
690+
(flattenLidCheckDot lid |> String.concat ".")
691+
(Loc.toString lid.loc)
692+
| _ -> ());
686693
Ast_iterator.default_iterator.pat iterator pat)
687694
in
688695
let module_expr (iterator : Ast_iterator.iterator)

analysis/tests/src/expected/Completion.res.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,7 @@ XXX Pexp_match with 1 cases not handled
13941394
XXX first case pattern:[362:7->364:5] expression:[364:9->364:10]
13951395
posCursor:[362:8] posNoWhite:[362:7] Found pattern:[362:7->364:5]
13961396
posCursor:[362:8] posNoWhite:[362:7] Found pattern:[362:7->362:8]
1397+
XXX Ppat_construct T:[362:7->362:8]
13971398
[]
13981399

13991400
Complete tests/src/Completion.res 367:30
@@ -1402,6 +1403,7 @@ posCursor:[367:30] posNoWhite:[367:29] Found expr:[367:16->376:3]
14021403
XXX Pexp_match with 1 cases not handled
14031404
XXX first case pattern:[367:29->367:30] expression:[370:0->376:3]
14041405
posCursor:[367:30] posNoWhite:[367:29] Found pattern:[367:29->367:30]
1406+
XXX Ppat_construct T:[367:29->367:30]
14051407
[]
14061408

14071409
Complete tests/src/Completion.res 372:8
@@ -1411,5 +1413,6 @@ XXX Pexp_match with 2 cases not handled
14111413
XXX first case pattern:[372:7->374:5] expression:[374:18->374:19]
14121414
posCursor:[372:8] posNoWhite:[372:7] Found pattern:[372:7->374:5]
14131415
posCursor:[372:8] posNoWhite:[372:7] Found pattern:[372:7->372:8]
1416+
XXX Ppat_construct T:[372:7->372:8]
14141417
[]
14151418

0 commit comments

Comments
 (0)