Skip to content

Commit 8503def

Browse files
committed
Emit completable where it is processed.
1 parent f725fbf commit 8503def

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,8 +1396,9 @@ let rec completeTypedValue ~full ~prefix ~completionContext ~mode
13961396
~env;
13971397
]
13981398

1399-
let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
1400-
(completable : Completable.t) =
1399+
let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
1400+
if debug then
1401+
Printf.printf "Completable: %s\n" (Completable.toString completable);
14011402
let package = full.package in
14021403
let rawOpens = Scope.getRawOpens scope in
14031404
let opens = getOpens ~debug ~rawOpens ~package ~env in

analysis/src/Completions.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ let getCompletions ~debug ~path ~pos ~currentFile ~forHover =
99
with
1010
| None -> None
1111
| Some (completable, scope) -> (
12-
if debug then
13-
Printf.printf "Completable: %s\n"
14-
(SharedTypes.Completable.toString completable);
1512
(* Only perform expensive ast operations if there are completables *)
1613
match Cmt.loadFullCmtFromPath ~path with
1714
| None -> None

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,7 @@ Ppat_construct T:[362:7->362:8]
14491449
Completable: Cpattern Value[x]=T
14501450
Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder
14511451
Resolved opens 2 Completion.res Completion.res
1452+
Completable: Cpath Value[T]
14521453
Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder
14531454
Resolved opens 2 Completion.res Completion.res
14541455
[{

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ posCursor:[16:19] posNoWhite:[16:18] Found expr:[16:11->16:20]
33
Pexp_apply ...[16:11->16:19] (...[46:0->16:20])
44
posCursor:[16:19] posNoWhite:[16:18] Found expr:[16:11->16:19]
55
Pexp_ident someFunc:[16:11->16:19]
6+
Completable: Cpath Value[someFunc]
67
argAtCursor: unlabelled<0>
78
extracted params:
89
[(
@@ -22,6 +23,7 @@ posCursor:[19:19] posNoWhite:[19:18] Found expr:[19:11->19:21]
2223
Pexp_apply ...[19:11->19:19] (...[19:20->19:21])
2324
posCursor:[19:19] posNoWhite:[19:18] Found expr:[19:11->19:19]
2425
Pexp_ident someFunc:[19:11->19:19]
26+
Completable: Cpath Value[someFunc]
2527
argAtCursor: unlabelled<0>
2628
extracted params:
2729
[(
@@ -41,6 +43,7 @@ posCursor:[22:19] posNoWhite:[22:18] Found expr:[22:11->22:29]
4143
Pexp_apply ...[22:11->22:19] (...[22:20->22:23], ~two22:26->22:29=...[22:26->22:29])
4244
posCursor:[22:19] posNoWhite:[22:18] Found expr:[22:11->22:19]
4345
Pexp_ident someFunc:[22:11->22:19]
46+
Completable: Cpath Value[someFunc]
4447
argAtCursor: ~two
4548
extracted params:
4649
[(
@@ -60,6 +63,7 @@ posCursor:[25:19] posNoWhite:[25:18] Found expr:[25:11->25:35]
6063
Pexp_apply ...[25:11->25:19] (...[25:20->25:23], ~two25:26->25:29=...[25:30->25:35])
6164
posCursor:[25:19] posNoWhite:[25:18] Found expr:[25:11->25:19]
6265
Pexp_ident someFunc:[25:11->25:19]
66+
Completable: Cpath Value[someFunc]
6367
argAtCursor: ~two
6468
extracted params:
6569
[(
@@ -79,6 +83,7 @@ posCursor:[28:19] posNoWhite:[28:18] Found expr:[28:11->28:42]
7983
Pexp_apply ...[28:11->28:19] (...[28:20->28:23], ~two28:26->28:29=...[28:30->28:35], ~four28:38->28:42=...[28:38->28:42])
8084
posCursor:[28:19] posNoWhite:[28:18] Found expr:[28:11->28:19]
8185
Pexp_ident someFunc:[28:11->28:19]
86+
Completable: Cpath Value[someFunc]
8287
argAtCursor: ~four
8388
extracted params:
8489
[(
@@ -98,6 +103,7 @@ posCursor:[31:19] posNoWhite:[31:18] Found expr:[31:11->31:44]
98103
Pexp_apply ...[31:11->31:19] (...[31:20->31:23], ~two31:26->31:29=...[31:30->31:35], ~four31:38->31:42=...[31:43->31:44])
99104
posCursor:[31:19] posNoWhite:[31:18] Found expr:[31:11->31:19]
100105
Pexp_ident someFunc:[31:11->31:19]
106+
Completable: Cpath Value[someFunc]
101107
argAtCursor: ~four
102108
extracted params:
103109
[(
@@ -117,6 +123,7 @@ posCursor:[34:20] posNoWhite:[34:19] Found expr:[34:11->34:21]
117123
Pexp_apply ...[34:11->34:20] (...[46:0->34:21])
118124
posCursor:[34:20] posNoWhite:[34:19] Found expr:[34:11->34:20]
119125
Pexp_ident otherFunc:[34:11->34:20]
126+
Completable: Cpath Value[otherFunc]
120127
argAtCursor: unlabelled<0>
121128
extracted params:
122129
[(string, int, float]
@@ -134,6 +141,7 @@ posCursor:[37:20] posNoWhite:[37:19] Found expr:[37:11->37:26]
134141
Pexp_apply ...[37:11->37:20] (...[37:21->37:26])
135142
posCursor:[37:20] posNoWhite:[37:19] Found expr:[37:11->37:20]
136143
Pexp_ident otherFunc:[37:11->37:20]
144+
Completable: Cpath Value[otherFunc]
137145
argAtCursor: unlabelled<0>
138146
extracted params:
139147
[(string, int, float]
@@ -151,6 +159,7 @@ posCursor:[40:20] posNoWhite:[40:19] Found expr:[40:11->40:39]
151159
Pexp_apply ...[40:11->40:20] (...[40:21->40:26], ...[40:28->40:31], ...[40:33->40:38])
152160
posCursor:[40:20] posNoWhite:[40:19] Found expr:[40:11->40:20]
153161
Pexp_ident otherFunc:[40:11->40:20]
162+
Completable: Cpath Value[otherFunc]
154163
argAtCursor: unlabelled<2>
155164
extracted params:
156165
[(string, int, float]
@@ -168,6 +177,7 @@ posCursor:[43:29] posNoWhite:[43:28] Found expr:[43:11->43:34]
168177
Pexp_apply ...[43:11->43:29] (~age43:31->43:34=...[43:31->43:34])
169178
posCursor:[43:29] posNoWhite:[43:28] Found expr:[43:11->43:29]
170179
Pexp_ident Completion.Lib.foo:[43:11->43:29]
180+
Completable: Cpath Value[Completion, Lib, foo]
171181
argAtCursor: ~age
172182
extracted params:
173183
[(~age: int, ~name: string]
@@ -185,6 +195,7 @@ posCursor:[50:23] posNoWhite:[50:22] Found expr:[50:11->50:24]
185195
Pexp_apply ...[50:11->50:23] (...[56:0->50:24])
186196
posCursor:[50:23] posNoWhite:[50:22] Found expr:[50:11->50:23]
187197
Pexp_ident iAmSoSpecial:[50:11->50:23]
198+
Completable: Cpath Value[iAmSoSpecial]
188199
argAtCursor: unlabelled<0>
189200
extracted params:
190201
[string]
@@ -203,6 +214,7 @@ posCursor:[53:29] posNoWhite:[53:28] Found expr:[53:20->53:31]
203214
Pexp_apply ...[53:20->53:29] (...[53:30->53:31])
204215
posCursor:[53:29] posNoWhite:[53:28] Found expr:[53:20->53:29]
205216
Pexp_ident otherFunc:[53:20->53:29]
217+
Completable: Cpath Value[otherFunc]
206218
argAtCursor: unlabelled<1>
207219
extracted params:
208220
[(string, int, float]
@@ -220,6 +232,7 @@ posCursor:[62:13] posNoWhite:[62:12] Found expr:[62:11->62:19]
220232
Pexp_apply ...[62:11->62:13] (...[62:14->62:16])
221233
posCursor:[62:13] posNoWhite:[62:12] Found expr:[62:11->62:13]
222234
Pexp_ident fn:[62:11->62:13]
235+
Completable: Cpath Value[fn]
223236
argAtCursor: unlabelled<1>
224237
extracted params:
225238
[(int, string, int]
@@ -237,6 +250,7 @@ posCursor:[65:13] posNoWhite:[65:12] Found expr:[65:11->65:25]
237250
Pexp_apply ...[65:11->65:13] (...[65:14->65:16], ...[65:20->65:24])
238251
posCursor:[65:13] posNoWhite:[65:12] Found expr:[65:11->65:13]
239252
Pexp_ident fn:[65:11->65:13]
253+
Completable: Cpath Value[fn]
240254
argAtCursor: unlabelled<1>
241255
extracted params:
242256
[(int, string, int]
@@ -254,6 +268,7 @@ posCursor:[68:13] posNoWhite:[68:12] Found expr:[68:11->68:28]
254268
Pexp_apply ...[68:11->68:13] (...[68:14->68:16], ...[68:18->68:25])
255269
posCursor:[68:13] posNoWhite:[68:12] Found expr:[68:11->68:13]
256270
Pexp_ident fn:[68:11->68:13]
271+
Completable: Cpath Value[fn]
257272
argAtCursor: unlabelled<2>
258273
extracted params:
259274
[(int, string, int]
@@ -273,6 +288,7 @@ posCursor:[71:28] posNoWhite:[71:27] Found expr:[71:16->71:30]
273288
Pexp_apply ...[71:16->71:28] (...[71:29->71:30])
274289
posCursor:[71:28] posNoWhite:[71:27] Found expr:[71:16->71:28]
275290
Pexp_ident iAmSoSpecial:[71:16->71:28]
291+
Completable: Cpath Value[iAmSoSpecial]
276292
argAtCursor: unlabelled<0>
277293
extracted params:
278294
[string]
@@ -294,6 +310,7 @@ posCursor:[74:39] posNoWhite:[74:38] Found expr:[74:31->74:41]
294310
Pexp_apply ...[74:31->74:39] (...[74:40->74:41])
295311
posCursor:[74:39] posNoWhite:[74:38] Found expr:[74:31->74:39]
296312
Pexp_ident someFunc:[74:31->74:39]
313+
Completable: Cpath Value[someFunc]
297314
argAtCursor: unlabelled<0>
298315
extracted params:
299316
[(

0 commit comments

Comments
 (0)