File tree 2 files changed +38
-4
lines changed
2 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -676,10 +676,12 @@ let completionWithParser ~debug ~path ~posCursor ~currentFile ~text =
676
676
(Loc. toString pat.ppat_loc);
677
677
(match pat.ppat_desc with
678
678
| Ppat_construct (lid , _ ) ->
679
+ let lidPath = flattenLidCheckDot lid in
679
680
if debug then
680
681
Printf. printf " XXX Ppat_construct %s:%s\n "
681
- (flattenLidCheckDot lid |> String. concat " ." )
682
- (Loc. toString lid.loc)
682
+ (lidPath |> String. concat " ." )
683
+ (Loc. toString lid.loc);
684
+ setResult (Cpath (CPId (lidPath, Value )))
683
685
| _ -> () );
684
686
Ast_iterator. default_iterator.pat iterator pat)
685
687
in
Original file line number Diff line number Diff line change @@ -1389,13 +1389,45 @@ posCursor:[362:8] posNoWhite:[362:7] Found expr:[361:2->365:3]
1389
1389
posCursor:[362:8] posNoWhite:[362:7] Found pattern:[362:7->364:5]
1390
1390
posCursor:[362:8] posNoWhite:[362:7] Found pattern:[362:7->362:8]
1391
1391
XXX Ppat_construct T:[362:7->362:8]
1392
- []
1392
+ Completable: Cpath Value[T]
1393
+ [{
1394
+ "label": "That",
1395
+ "kind": 4,
1396
+ "tags": [],
1397
+ "detail": "That\n\ntype v = This | That",
1398
+ "documentation": null
1399
+ }, {
1400
+ "label": "This",
1401
+ "kind": 4,
1402
+ "tags": [],
1403
+ "detail": "This\n\ntype v = This | That",
1404
+ "documentation": null
1405
+ }, {
1406
+ "label": "TableclothMap",
1407
+ "kind": 9,
1408
+ "tags": [],
1409
+ "detail": "file module",
1410
+ "documentation": null
1411
+ }, {
1412
+ "label": "TypeDefinition",
1413
+ "kind": 9,
1414
+ "tags": [],
1415
+ "detail": "file module",
1416
+ "documentation": null
1417
+ }]
1393
1418
1394
1419
Complete tests/src/Completion.res 373:21
1395
1420
posCursor:[373:21] posNoWhite:[373:20] Found expr:[371:8->376:3]
1396
1421
posCursor:[373:21] posNoWhite:[373:20] Found expr:[372:2->376:3]
1397
1422
posCursor:[373:21] posNoWhite:[373:20] Found pattern:[373:7->375:5]
1398
1423
posCursor:[373:21] posNoWhite:[373:20] Found pattern:[373:7->373:21]
1399
1424
XXX Ppat_construct AndThatOther.T:[373:7->373:21]
1400
- []
1425
+ Completable: Cpath Value[AndThatOther, T]
1426
+ [{
1427
+ "label": "ThatOther",
1428
+ "kind": 4,
1429
+ "tags": [],
1430
+ "detail": "ThatOther\n\ntype v = And | ThatOther",
1431
+ "documentation": null
1432
+ }]
1401
1433
You can’t perform that action at this time.
0 commit comments