Skip to content

Commit e0f802b

Browse files
committed
More win debug.
1 parent 654bc7d commit e0f802b

File tree

8 files changed

+54
-52
lines changed

8 files changed

+54
-52
lines changed

analysis/src/Commands.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ let completionWithParser ~debug ~path ~pos ~currentFile ~textOpt =
1414
let line, col = pos in
1515
let offsetNoWhite = PartialParser.skipWhite text offset in
1616
let posNoWhite = (line, max 0 col - offset + offsetNoWhite) in
17-
Printf.printf "posNoWhite %s\n" (SemanticTokens.posToString posNoWhite);
17+
Printf.printf "posNoWhite %s offset:%d offsetNoWhite:%d len:%d\n"
18+
(SemanticTokens.posToString posNoWhite)
19+
offset offsetNoWhite (String.length text);
1820

1921
if Filename.check_suffix path ".res" then (
2022
let parser =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Complete tests/src/CompletePrioritize1.res 4:2
2-
posNoWhite (5,3)
2+
posNoWhite (5,3) offset:106 offsetNoWhite:105 len:110
33
Found expr:(5,2)->(5,4)
44
[{
55
"label": "Test.add",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Complete tests/src/CompletePrioritize2.res 8:2
2-
posNoWhite (9,3)
2+
posNoWhite (9,3) offset:145 offsetNoWhite:144 len:146
33
Found expr:(9,2)->(9,4)
44
[{
55
"label": "Test.add",

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Complete tests/src/Completion.res 0:2
2-
posNoWhite (1,8)
2+
posNoWhite (1,8) offset:35 offsetNoWhite:34 len:1968
33
Found expr:(1,1)->(1,9)
44
[{
55
"label": "mapReverse",
@@ -70,7 +70,7 @@ Found expr:(1,1)->(1,9)
7070
}]
7171

7272
Complete tests/src/Completion.res 1:2
73-
posNoWhite (2,6)
73+
posNoWhite (2,6) offset:49 offsetNoWhite:48 len:1968
7474
Found expr:(2,1)->(6,6)
7575
[{
7676
"label": "Floatarray",
@@ -291,7 +291,7 @@ Found expr:(2,1)->(6,6)
291291
}]
292292

293293
Complete tests/src/Completion.res 2:2
294-
posNoWhite (3,7)
294+
posNoWhite (3,7) offset:64 offsetNoWhite:63 len:1968
295295
Found expr:(3,1)->(3,8)
296296
[{
297297
"label": "mapi",
@@ -344,7 +344,7 @@ Found expr:(3,1)->(3,8)
344344
}]
345345

346346
Complete tests/src/Completion.res 12:2
347-
posNoWhite (13,14)
347+
posNoWhite (13,14) offset:251 offsetNoWhite:250 len:1968
348348
Found expr:(13,10)->(13,15)
349349
[{
350350
"label": "customDouble",
@@ -355,7 +355,7 @@ Found expr:(13,10)->(13,15)
355355
}]
356356

357357
Complete tests/src/Completion.res 19:2
358-
posNoWhite (20,17)
358+
posNoWhite (20,17) offset:400 offsetNoWhite:399 len:1968
359359
Found expr:(20,9)->(20,18)
360360
[{
361361
"label": "age",
@@ -372,7 +372,7 @@ Found expr:(20,9)->(20,18)
372372
}]
373373

374374
Complete tests/src/Completion.res 21:2
375-
posNoWhite (22,10)
375+
posNoWhite (22,10) offset:419 offsetNoWhite:418 len:1968
376376
Found expr:(22,1)->(22,11)
377377
Found expr:(22,10)->(22,11)
378378
[{
@@ -390,7 +390,7 @@ Found expr:(22,10)->(22,11)
390390
}]
391391

392392
Complete tests/src/Completion.res 23:2
393-
posNoWhite (24,10)
393+
posNoWhite (24,10) offset:438 offsetNoWhite:437 len:1968
394394
Found expr:(24,1)->(24,11)
395395
Found expr:(24,8)->(24,11)
396396
[{
@@ -402,7 +402,7 @@ Found expr:(24,8)->(24,11)
402402
}]
403403

404404
Complete tests/src/Completion.res 27:2
405-
posNoWhite (28,5)
405+
posNoWhite (28,5) offset:470 offsetNoWhite:469 len:1968
406406
Found expr:(28,1)->(28,6)
407407
Found expr:(28,5)->(28,6)
408408
[{
@@ -420,7 +420,7 @@ Found expr:(28,5)->(28,6)
420420
}]
421421

422422
Complete tests/src/Completion.res 36:2
423-
posNoWhite (37,4)
423+
posNoWhite (37,4) offset:604 offsetNoWhite:603 len:1968
424424
Found expr:(37,1)->(46,3)
425425
Found expr:(37,1)->(41,8)
426426
Found expr:(37,3)->(37,5)
@@ -439,7 +439,7 @@ Found expr:(37,3)->(37,5)
439439
}]
440440

441441
Complete tests/src/Completion.res 38:2
442-
posNoWhite (39,18)
442+
posNoWhite (39,18) offset:631 offsetNoWhite:630 len:1968
443443
Found expr:(39,1)->(39,19)
444444
Found expr:(39,10)->(39,19)
445445
[{
@@ -457,7 +457,7 @@ Found expr:(39,10)->(39,19)
457457
}]
458458

459459
Complete tests/src/Completion.res 50:2
460-
posNoWhite (51,27)
460+
posNoWhite (51,27) offset:845 offsetNoWhite:844 len:1968
461461
Found expr:(51,13)->(51,28)
462462
Found expr:(51,27)->(51,28)
463463
[{
@@ -469,7 +469,7 @@ Found expr:(51,27)->(51,28)
469469
}]
470470

471471
Complete tests/src/Completion.res 52:2
472-
posNoWhite (53,20)
472+
posNoWhite (53,20) offset:874 offsetNoWhite:873 len:1968
473473
Found expr:(53,13)->(53,21)
474474
Found expr:(53,20)->(53,21)
475475
[{
@@ -675,7 +675,7 @@ DocumentSymbol tests/src/Completion.res
675675
]
676676

677677
Complete tests/src/Completion.res 56:2
678-
posNoWhite (57,5)
678+
posNoWhite (57,5) offset:896 offsetNoWhite:895 len:1968
679679
XXX Not found!
680680
[{
681681
"label": "react.component",
@@ -686,7 +686,7 @@ XXX Not found!
686686
}]
687687

688688
Complete tests/src/Completion.res 58:2
689-
posNoWhite (59,7)
689+
posNoWhite (59,7) offset:912 offsetNoWhite:911 len:1968
690690
Found expr:(0,-1)->(69,17)
691691
[{
692692
"label": "component",
@@ -697,7 +697,7 @@ Found expr:(0,-1)->(69,17)
697697
}]
698698

699699
Complete tests/src/Completion.res 60:2
700-
posNoWhite (61,24)
700+
posNoWhite (61,24) offset:945 offsetNoWhite:944 len:1968
701701
Found expr:(61,9)->(61,25)
702702
[{
703703
"label": "age",
@@ -708,7 +708,7 @@ Found expr:(61,9)->(61,25)
708708
}]
709709

710710
Complete tests/src/Completion.res 62:2
711-
posNoWhite (63,23)
711+
posNoWhite (63,23) offset:977 offsetNoWhite:976 len:1968
712712
Found expr:(63,9)->(63,24)
713713
[{
714714
"label": "name",
@@ -719,7 +719,7 @@ Found expr:(63,9)->(63,24)
719719
}]
720720

721721
Complete tests/src/Completion.res 64:2
722-
posNoWhite (65,29)
722+
posNoWhite (65,29) offset:1015 offsetNoWhite:1014 len:1968
723723
Found expr:(65,9)->(65,30)
724724
[{
725725
"label": "name",
@@ -730,7 +730,7 @@ Found expr:(65,9)->(65,30)
730730
}]
731731

732732
Complete tests/src/Completion.res 67:2
733-
posNoWhite (68,1)
733+
posNoWhite (68,1) offset:1049 offsetNoWhite:1048 len:1968
734734
Found expr:(67,8)->(69,17)
735735
[{
736736
"label": "age",
@@ -747,7 +747,7 @@ Found expr:(67,8)->(69,17)
747747
}]
748748

749749
Complete tests/src/Completion.res 72:2
750-
posNoWhite (73,10)
750+
posNoWhite (73,10) offset:1126 offsetNoWhite:1125 len:1968
751751
Found expr:(73,8)->(75,18)
752752
[{
753753
"label": "age",
@@ -758,7 +758,7 @@ Found expr:(73,8)->(75,18)
758758
}]
759759

760760
Complete tests/src/Completion.res 76:2
761-
posNoWhite (77,21)
761+
posNoWhite (77,21) offset:1212 offsetNoWhite:1211 len:1968
762762
Found expr:(77,20)->(80,10)
763763
[{
764764
"label": "age",
@@ -775,7 +775,7 @@ Found expr:(77,20)->(80,10)
775775
}]
776776

777777
Complete tests/src/Completion.res 79:2
778-
posNoWhite (80,4)
778+
posNoWhite (80,4) offset:1257 offsetNoWhite:1256 len:1968
779779
Found expr:(80,2)->(82,20)
780780
[{
781781
"label": "age",
@@ -786,7 +786,7 @@ Found expr:(80,2)->(82,20)
786786
}]
787787

788788
Complete tests/src/Completion.res 83:2
789-
posNoWhite (84,14)
789+
posNoWhite (84,14) offset:1355 offsetNoWhite:1354 len:1968
790790
Found expr:(84,13)->(101,20)
791791
[{
792792
"label": "name",
@@ -803,7 +803,7 @@ Found expr:(84,13)->(101,20)
803803
}]
804804

805805
Complete tests/src/Completion.res 88:3
806-
posNoWhite (89,2)
806+
posNoWhite (89,2) offset:1437 offsetNoWhite:1436 len:1967
807807
Found expr:(89,1)->(93,3)
808808
[{
809809
"label": "x",
@@ -820,7 +820,7 @@ Found expr:(89,1)->(93,3)
820820
}]
821821

822822
Complete tests/src/Completion.res 90:3
823-
posNoWhite (91,18)
823+
posNoWhite (91,18) offset:1465 offsetNoWhite:1464 len:1967
824824
Found expr:(91,1)->(93,3)
825825
[{
826826
"label": "xx",
@@ -837,7 +837,7 @@ Found expr:(91,1)->(93,3)
837837
}]
838838

839839
Complete tests/src/Completion.res 96:3
840-
posNoWhite (97,2)
840+
posNoWhite (97,2) offset:1551 offsetNoWhite:1550 len:1967
841841
Found expr:(96,11)->(99,1)
842842
Found expr:(97,1)->(98,5)
843843
Found expr:(97,1)->(97,3)
@@ -850,7 +850,7 @@ Found expr:(97,1)->(97,3)
850850
}]
851851

852852
Complete tests/src/Completion.res 100:3
853-
posNoWhite (101,12)
853+
posNoWhite (101,12) offset:1584 offsetNoWhite:1583 len:1967
854854
Found expr:(101,11)->(120,32)
855855
[{
856856
"label": "name",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ TypeDefinition tests/src/Cross.res 37:37
9494
{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 3, "character": 0}, "end": {"line": 3, "character": 6}}}
9595

9696
Complete tests/src/Cross.res 39:2
97-
posNoWhite (40,25)
97+
posNoWhite (40,25) offset:856 offsetNoWhite:855 len:857
9898
Found expr:(40,1)->(40,26)
9999
[]
100100

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Hover tests/src/Div.res 1:10
22
{"contents": "```rescript\n(\n string,\n ~props: ReactDOMRe.domProps=?,\n array<React.element>,\n) => React.element\n```"}
33

44
Complete tests/src/Div.res 3:3
5-
posNoWhite (4,14)
5+
posNoWhite (4,14) offset:53 offsetNoWhite:52 len:54
66
Found expr:(4,2)->(4,15)
77
Found expr:(4,6)->(4,15)
88
[{

0 commit comments

Comments
 (0)