Skip to content

Commit 654bc7d

Browse files
committed
What's up Windows.
1 parent c50262e commit 654bc7d

File tree

8 files changed

+52
-0
lines changed

8 files changed

+52
-0
lines changed

analysis/src/Commands.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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);
1718

1819
if Filename.check_suffix path ".res" then (
1920
let parser =

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Complete tests/src/CompletePrioritize1.res 4:2
2+
posNoWhite (5,3)
23
Found expr:(5,2)->(5,4)
34
[{
45
"label": "Test.add",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Complete tests/src/CompletePrioritize2.res 8:2
2+
posNoWhite (9,3)
23
Found expr:(9,2)->(9,4)
34
[{
45
"label": "Test.add",

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Complete tests/src/Completion.res 0:2
2+
posNoWhite (1,8)
23
Found expr:(1,1)->(1,9)
34
[{
45
"label": "mapReverse",
@@ -69,6 +70,7 @@ Found expr:(1,1)->(1,9)
6970
}]
7071

7172
Complete tests/src/Completion.res 1:2
73+
posNoWhite (2,6)
7274
Found expr:(2,1)->(6,6)
7375
[{
7476
"label": "Floatarray",
@@ -289,6 +291,7 @@ Found expr:(2,1)->(6,6)
289291
}]
290292

291293
Complete tests/src/Completion.res 2:2
294+
posNoWhite (3,7)
292295
Found expr:(3,1)->(3,8)
293296
[{
294297
"label": "mapi",
@@ -341,6 +344,7 @@ Found expr:(3,1)->(3,8)
341344
}]
342345

343346
Complete tests/src/Completion.res 12:2
347+
posNoWhite (13,14)
344348
Found expr:(13,10)->(13,15)
345349
[{
346350
"label": "customDouble",
@@ -351,6 +355,7 @@ Found expr:(13,10)->(13,15)
351355
}]
352356

353357
Complete tests/src/Completion.res 19:2
358+
posNoWhite (20,17)
354359
Found expr:(20,9)->(20,18)
355360
[{
356361
"label": "age",
@@ -367,6 +372,7 @@ Found expr:(20,9)->(20,18)
367372
}]
368373

369374
Complete tests/src/Completion.res 21:2
375+
posNoWhite (22,10)
370376
Found expr:(22,1)->(22,11)
371377
Found expr:(22,10)->(22,11)
372378
[{
@@ -384,6 +390,7 @@ Found expr:(22,10)->(22,11)
384390
}]
385391

386392
Complete tests/src/Completion.res 23:2
393+
posNoWhite (24,10)
387394
Found expr:(24,1)->(24,11)
388395
Found expr:(24,8)->(24,11)
389396
[{
@@ -395,6 +402,7 @@ Found expr:(24,8)->(24,11)
395402
}]
396403

397404
Complete tests/src/Completion.res 27:2
405+
posNoWhite (28,5)
398406
Found expr:(28,1)->(28,6)
399407
Found expr:(28,5)->(28,6)
400408
[{
@@ -412,6 +420,7 @@ Found expr:(28,5)->(28,6)
412420
}]
413421

414422
Complete tests/src/Completion.res 36:2
423+
posNoWhite (37,4)
415424
Found expr:(37,1)->(46,3)
416425
Found expr:(37,1)->(41,8)
417426
Found expr:(37,3)->(37,5)
@@ -430,6 +439,7 @@ Found expr:(37,3)->(37,5)
430439
}]
431440

432441
Complete tests/src/Completion.res 38:2
442+
posNoWhite (39,18)
433443
Found expr:(39,1)->(39,19)
434444
Found expr:(39,10)->(39,19)
435445
[{
@@ -447,6 +457,7 @@ Found expr:(39,10)->(39,19)
447457
}]
448458

449459
Complete tests/src/Completion.res 50:2
460+
posNoWhite (51,27)
450461
Found expr:(51,13)->(51,28)
451462
Found expr:(51,27)->(51,28)
452463
[{
@@ -458,6 +469,7 @@ Found expr:(51,27)->(51,28)
458469
}]
459470

460471
Complete tests/src/Completion.res 52:2
472+
posNoWhite (53,20)
461473
Found expr:(53,13)->(53,21)
462474
Found expr:(53,20)->(53,21)
463475
[{
@@ -663,6 +675,7 @@ DocumentSymbol tests/src/Completion.res
663675
]
664676

665677
Complete tests/src/Completion.res 56:2
678+
posNoWhite (57,5)
666679
XXX Not found!
667680
[{
668681
"label": "react.component",
@@ -673,6 +686,7 @@ XXX Not found!
673686
}]
674687

675688
Complete tests/src/Completion.res 58:2
689+
posNoWhite (59,7)
676690
Found expr:(0,-1)->(69,17)
677691
[{
678692
"label": "component",
@@ -683,6 +697,7 @@ Found expr:(0,-1)->(69,17)
683697
}]
684698

685699
Complete tests/src/Completion.res 60:2
700+
posNoWhite (61,24)
686701
Found expr:(61,9)->(61,25)
687702
[{
688703
"label": "age",
@@ -693,6 +708,7 @@ Found expr:(61,9)->(61,25)
693708
}]
694709

695710
Complete tests/src/Completion.res 62:2
711+
posNoWhite (63,23)
696712
Found expr:(63,9)->(63,24)
697713
[{
698714
"label": "name",
@@ -703,6 +719,7 @@ Found expr:(63,9)->(63,24)
703719
}]
704720

705721
Complete tests/src/Completion.res 64:2
722+
posNoWhite (65,29)
706723
Found expr:(65,9)->(65,30)
707724
[{
708725
"label": "name",
@@ -713,6 +730,7 @@ Found expr:(65,9)->(65,30)
713730
}]
714731

715732
Complete tests/src/Completion.res 67:2
733+
posNoWhite (68,1)
716734
Found expr:(67,8)->(69,17)
717735
[{
718736
"label": "age",
@@ -729,6 +747,7 @@ Found expr:(67,8)->(69,17)
729747
}]
730748

731749
Complete tests/src/Completion.res 72:2
750+
posNoWhite (73,10)
732751
Found expr:(73,8)->(75,18)
733752
[{
734753
"label": "age",
@@ -739,6 +758,7 @@ Found expr:(73,8)->(75,18)
739758
}]
740759

741760
Complete tests/src/Completion.res 76:2
761+
posNoWhite (77,21)
742762
Found expr:(77,20)->(80,10)
743763
[{
744764
"label": "age",
@@ -755,6 +775,7 @@ Found expr:(77,20)->(80,10)
755775
}]
756776

757777
Complete tests/src/Completion.res 79:2
778+
posNoWhite (80,4)
758779
Found expr:(80,2)->(82,20)
759780
[{
760781
"label": "age",
@@ -765,6 +786,7 @@ Found expr:(80,2)->(82,20)
765786
}]
766787

767788
Complete tests/src/Completion.res 83:2
789+
posNoWhite (84,14)
768790
Found expr:(84,13)->(101,20)
769791
[{
770792
"label": "name",
@@ -781,6 +803,7 @@ Found expr:(84,13)->(101,20)
781803
}]
782804

783805
Complete tests/src/Completion.res 88:3
806+
posNoWhite (89,2)
784807
Found expr:(89,1)->(93,3)
785808
[{
786809
"label": "x",
@@ -797,6 +820,7 @@ Found expr:(89,1)->(93,3)
797820
}]
798821

799822
Complete tests/src/Completion.res 90:3
823+
posNoWhite (91,18)
800824
Found expr:(91,1)->(93,3)
801825
[{
802826
"label": "xx",
@@ -813,6 +837,7 @@ Found expr:(91,1)->(93,3)
813837
}]
814838

815839
Complete tests/src/Completion.res 96:3
840+
posNoWhite (97,2)
816841
Found expr:(96,11)->(99,1)
817842
Found expr:(97,1)->(98,5)
818843
Found expr:(97,1)->(97,3)
@@ -825,6 +850,7 @@ Found expr:(97,1)->(97,3)
825850
}]
826851

827852
Complete tests/src/Completion.res 100:3
853+
posNoWhite (101,12)
828854
Found expr:(101,11)->(120,32)
829855
[{
830856
"label": "name",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +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)
9798
Found expr:(40,1)->(40,26)
9899
[]
99100

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +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)
56
Found expr:(4,2)->(4,15)
67
Found expr:(4,6)->(4,15)
78
[{

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Definition tests/src/Jsx.res 5:9
22
{"uri": "Jsx.res", "range": {"start": {"line": 2, "character": 6}, "end": {"line": 2, "character": 10}}}
33

44
Complete tests/src/Jsx.res 7:2
5+
posNoWhite (8,12)
56
Found expr:(8,2)->(8,13)
67
Found expr:(8,11)->(8,13)
78
[{
@@ -25,6 +26,7 @@ Found expr:(8,11)->(8,13)
2526
}]
2627

2728
Complete tests/src/Jsx.res 9:2
29+
posNoWhite (10,17)
2830
Found expr:(10,2)->(10,18)
2931
Found expr:(10,17)->(10,18)
3032
[{
@@ -42,6 +44,7 @@ Found expr:(10,17)->(10,18)
4244
}]
4345

4446
Complete tests/src/Jsx.res 11:2
47+
posNoWhite (12,10)
4548
Found expr:(12,10)->(12,11)
4649
Found expr:(12,10)->(12,11)
4750
[{
@@ -71,6 +74,7 @@ Found expr:(12,10)->(12,11)
7174
}]
7275

7376
Complete tests/src/Jsx.res 18:2
77+
posNoWhite (19,16)
7478
Found expr:(19,2)->(19,17)
7579
Found expr:(19,16)->(19,17)
7680
[{
@@ -82,6 +86,7 @@ Found expr:(19,16)->(19,17)
8286
}]
8387

8488
Complete tests/src/Jsx.res 20:2
89+
posNoWhite (21,14)
8590
Found expr:(21,2)->(21,15)
8691
Found expr:(21,14)->(21,15)
8792
[{
@@ -93,6 +98,7 @@ Found expr:(21,14)->(21,15)
9398
}]
9499

95100
Complete tests/src/Jsx.res 22:2
101+
posNoWhite (23,18)
96102
Found expr:(23,2)->(23,19)
97103
Found expr:(23,18)->(23,19)
98104
[{
@@ -104,6 +110,7 @@ Found expr:(23,18)->(23,19)
104110
}]
105111

106112
Complete tests/src/Jsx.res 24:2
113+
posNoWhite (25,21)
107114
Found expr:(25,2)->(25,22)
108115
Found expr:(25,21)->(25,22)
109116
[{
@@ -115,6 +122,7 @@ Found expr:(25,21)->(25,22)
115122
}]
116123

117124
Complete tests/src/Jsx.res 26:2
125+
posNoWhite (27,15)
118126
Found expr:(27,2)->(27,16)
119127
Found expr:(27,15)->(27,16)
120128
[{
@@ -126,6 +134,7 @@ Found expr:(27,15)->(27,16)
126134
}]
127135

128136
Complete tests/src/Jsx.res 28:2
137+
posNoWhite (29,13)
129138
Found expr:(29,2)->(29,14)
130139
Found expr:(29,13)->(29,14)
131140
[{
@@ -137,6 +146,7 @@ Found expr:(29,13)->(29,14)
137146
}]
138147

139148
Complete tests/src/Jsx.res 30:2
149+
posNoWhite (31,14)
140150
Found expr:(31,2)->(31,15)
141151
Found expr:(31,14)->(31,15)
142152
[{
@@ -148,11 +158,13 @@ Found expr:(31,14)->(31,15)
148158
}]
149159

150160
Complete tests/src/Jsx.res 32:2
161+
posNoWhite (33,15)
151162
Found expr:(33,2)->(33,16)
152163
Found expr:(33,15)->(33,16)
153164
[]
154165

155166
Complete tests/src/Jsx.res 34:2
167+
posNoWhite (35,13)
156168
Found expr:(35,2)->(35,14)
157169
Found expr:(35,13)->(35,14)
158170
[{
@@ -164,6 +176,7 @@ Found expr:(35,13)->(35,14)
164176
}]
165177

166178
Complete tests/src/Jsx.res 36:2
179+
posNoWhite (37,24)
167180
Found expr:(37,2)->(37,25)
168181
Found expr:(37,24)->(37,25)
169182
[{
@@ -175,6 +188,7 @@ Found expr:(37,24)->(37,25)
175188
}]
176189

177190
Complete tests/src/Jsx.res 38:2
191+
posNoWhite (39,35)
178192
Found expr:(39,2)->(39,36)
179193
Found expr:(39,35)->(39,36)
180194
[{
@@ -186,6 +200,7 @@ Found expr:(39,35)->(39,36)
186200
}]
187201

188202
Complete tests/src/Jsx.res 40:2
203+
posNoWhite (41,22)
189204
Found expr:(41,2)->(41,23)
190205
Found expr:(41,22)->(41,23)
191206
[{
@@ -200,6 +215,7 @@ Definition tests/src/Jsx.res 43:11
200215
{"uri": "Component.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}}
201216

202217
Complete tests/src/Jsx.res 52:2
218+
posNoWhite (53,7)
203219
Found expr:(53,2)->(53,8)
204220
Found expr:(53,6)->(53,8)
205221
[{
@@ -211,6 +227,7 @@ Found expr:(53,6)->(53,8)
211227
}]
212228

213229
Complete tests/src/Jsx.res 54:2
230+
posNoWhite (55,8)
214231
Found expr:(55,2)->(55,9)
215232
Found expr:(55,4)->(55,9)
216233
[{
@@ -234,6 +251,7 @@ Found expr:(55,4)->(55,9)
234251
}]
235252

236253
Complete tests/src/Jsx.res 56:2
254+
posNoWhite (57,13)
237255
Found expr:(57,2)->(57,14)
238256
Found expr:(57,13)->(57,14)
239257
[{
@@ -245,6 +263,7 @@ Found expr:(57,13)->(57,14)
245263
}]
246264

247265
Complete tests/src/Jsx.res 58:2
266+
posNoWhite (59,20)
248267
Found expr:(59,2)->(59,21)
249268
Found expr:(59,20)->(59,21)
250269
[{

0 commit comments

Comments
 (0)