Skip to content

Commit 312c62e

Browse files
committed
Only use new complete format in tests.
1 parent d26c059 commit 312c62e

10 files changed

+84
-100
lines changed

analysis/src/Commands.ml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -286,22 +286,6 @@ let test ~path =
286286
in
287287
rename ~path ~line ~col ~newName
288288
| "com" ->
289-
print_endline
290-
("Complete " ^ path ^ " " ^ string_of_int line ^ ":"
291-
^ string_of_int col);
292-
let currentFile, cout = Filename.open_temp_file "def" "txt" in
293-
lines
294-
|> List.iteri (fun j l ->
295-
let lineToOutput =
296-
if j == i then String.sub rest 3 (len - mlen - 3) else l
297-
in
298-
Printf.fprintf cout "%s\n" lineToOutput);
299-
let line = line + 1 in
300-
let col = len - mlen - 3 in
301-
close_out cout;
302-
completion ~debug:true ~path ~pos:(line, col) ~currentFile;
303-
Sys.remove currentFile
304-
| "co2" ->
305289
print_endline
306290
("Complete " ^ path ^ " " ^ string_of_int line ^ ":"
307291
^ string_of_int col);

analysis/tests/src/CompletePrioritize1.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ module Test = {
44
}
55
let a: Test.t = {name: 4}
66
// a->
7-
// ^co2
7+
// ^com

analysis/tests/src/CompletePrioritize2.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Test = {
88
}
99
let ax: Test.t = {name: 4}
1010
// ax->
11-
// ^co2
11+
// ^com
1212

1313
// ax
14-
// ^co2
14+
// ^com

analysis/tests/src/Completion.res

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module MyList = Belt.List
22
// MyList.m
3-
// ^co2
3+
// ^com
44
// Array.
5-
// ^co2
5+
// ^com
66
// Array.m
7-
// ^co2
7+
// ^com
88

99
module Dep: {
1010
@ocaml.doc("Some doc comment") @deprecated("Use customDouble instead")
@@ -14,26 +14,26 @@ module Dep: {
1414
}
1515

1616
// let cc = Dep.c
17-
// ^co2
17+
// ^com
1818

1919
module Lib = {
2020
let foo = (~age, ~name) => name ++ string_of_int(age)
2121
let next = (~number=0, ~year) => number + year
2222
}
2323

2424
// let x = Lib.foo(~
25-
// ^co2
25+
// ^com
2626

2727
// [1,2,3]->m
28-
// ^co2
28+
// ^com
2929

3030
// "abc"->toU
31-
// ^co2
31+
// ^com
3232

3333
let op = Some(3)
3434

3535
// op->e
36-
// ^co2
36+
// ^com
3737

3838
module ForAuto = {
3939
type t = int
@@ -43,10 +43,10 @@ module ForAuto = {
4343

4444
let fa: ForAuto.t = 34
4545
// fa->
46-
// ^co2
46+
// ^com
4747

4848
// "hello"->Js.Dict.u
49-
// ^co2
49+
// ^com
5050

5151
module O = {
5252
module Comp = {
@@ -58,75 +58,75 @@ module O = {
5858
let zzz = 11
5959

6060
// let comp = <O.Comp second=z
61-
// ^co2
61+
// ^com
6262

6363
// let comp = <O.Comp z
64-
// ^co2
64+
// ^com
6565

6666
//^doc
6767

6868
// @reac
69-
// ^co2
69+
// ^com
7070

7171
// @react.
72-
// ^co2
72+
// ^com
7373

7474
// let x = Lib.foo(~name, ~
75-
// ^co2
75+
// ^com
7676

7777
// let x = Lib.foo(~age, ~
78-
// ^co2
78+
// ^com
7979

8080
// let x = Lib.foo(~age={3+4}, ~
81-
// ^co2
81+
// ^com
8282

8383
let _ = Lib.foo(
8484
//~age,
8585
//~
86-
// ^co2
86+
// ^com
8787
~age=3,
8888
~name="",
8989
)
9090

9191
let someObj = {"name": "a", "age": 32}
9292

9393
// someObj["a
94-
// ^co2
94+
// ^com
9595

9696
let nestedObj = {"x": {"y": {"name": "a", "age": 32}}}
9797

9898
// nestedObj["x"]["y"]["
99-
// ^co2
99+
// ^com
100100

101101
let o: Obj.objT = assert false
102102
// o["a
103-
// ^co2
103+
// ^com
104104

105105
type nestedObjT = {"x": Obj.nestedObjT}
106106
let no: nestedObjT = assert false
107107
// no["x"]["y"]["
108-
// ^co2
108+
// ^com
109109

110110
type r = {x: int, y: string}
111111
type rAlias = r
112112
let r: rAlias = assert false
113113
// r.
114-
// ^co2
114+
// ^com
115115

116116
// Obj.Rec.recordVal.
117-
// ^co2
117+
// ^com
118118

119119
let myAmazingFunction = (x, y) => x + y
120120

121121
@react.component
122122
let make = () => {
123123
// my
124-
// ^co2
124+
// ^com
125125
<> </>
126126
}
127127

128128
// Obj.object["
129-
// ^co2
129+
// ^com
130130

131131
let foo = {
132132
let x = {
@@ -152,46 +152,46 @@ let foo = {
152152
exception MyOtherException
153153

154154
// <O.
155-
// ^co2
155+
// ^com
156156

157157
type aa = {x: int, name: string}
158158
type bb = {aa: aa, w: int}
159159
let q: bb = assert false
160160
// q.aa.
161-
// ^co2
161+
// ^com
162162
// q.aa.n
163-
// ^co2
163+
// ^com
164164

165165
// Lis
166-
// ^co2
166+
// ^com
167167

168168
module WithChildren = {
169169
@react.component
170170
let make = (~children, ~name as _: string) => <jsx> children </jsx>
171171
}
172172
// <WithChildren
173-
// ^co2
173+
// ^com
174174

175175
// type t = Js.n
176-
// ^co2
176+
// ^com
177177
// type t = ForAuto.
178-
// ^co2
178+
// ^com
179179

180180
type z = Allo | Asterix | Baba
181181

182182
// let q = As
183-
// ^co2
183+
// ^com
184184

185185
// module M = For
186-
// ^co2
186+
// ^com
187187

188188
module Private = {
189189
%%private(let awr = 3)
190190
let b = awr
191191
}
192192

193193
// Private.
194-
// ^co2
194+
// ^com
195195

196196
module Shadow = {
197197
module A = {
@@ -203,13 +203,13 @@ module Shadow = {
203203
}
204204

205205
// sha
206-
// ^co2
206+
// ^com
207207
open Shadow.A
208208
// sha
209-
// ^co2
209+
// ^com
210210
open Shadow.B
211211
// sha
212-
// ^co2
212+
// ^com
213213
let _ = shadowed
214214

215215
module FAR = {
@@ -222,13 +222,13 @@ module FAO = {
222222
}
223223

224224
// FAO.forAutoObject["
225-
// ^co2
225+
// ^com
226226

227227
// FAO.forAutoObject["forAutoLabel"].
228-
// ^co2
228+
// ^com
229229

230230
// FAO.forAutoObject["forAutoLabel"].forAuto->
231-
// ^co2
231+
// ^com
232232

233233
// FAO.forAutoObject["forAutoLabel"].forAuto->ForAuto.a
234-
// ^co2
234+
// ^com

analysis/tests/src/Cross.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ type defT2 = DefinitionWithInterface.t
3535
// ^typ
3636

3737
// DefinitionWithInterface.a
38-
// ^co2
38+
// ^com

analysis/tests/src/Debug.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Before = {
1212
}
1313
module Inner = {
1414
// eqN
15-
// ^co2
15+
// ^com
1616
open List
1717
let _ = map
1818
}

analysis/tests/src/Div.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ let q = <div />
22
// ^hov
33

44
// <div dangerous
5-
// ^co2
5+
// ^com

0 commit comments

Comments
 (0)