Skip to content

Commit f5c97aa

Browse files
committed
Update cmdline -hlep
Fixes #124
1 parent 03ce0a1 commit f5c97aa

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

analysis/src/Cli.ml

+27-20
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,62 @@ let help =
33
**Private CLI For rescript-vscode usage only**
44

55
Examples:
6-
./run.exe dump src/MyFile.res src/MyFile2.res
76
./run.exe complete src/MyFile.res 0 4 currentContent.res
8-
./run.exe hover src/MyFile.res 10 2
97
./run.exe definition src/MyFile.res 9 3
8+
./run.exe dump src/MyFile.res src/MyFile2.res
9+
./run.exe documentSymbol src/Foo.res
10+
./run.exe hover src/MyFile.res 10 2
11+
./run.exe references src/MyFile.res 10 2
12+
./run.exe test src/MyFile.res
1013

1114
Note: coordinates are zero-based, so the first position is 0 0.
1215

1316
Options:
14-
dump: debugging. definition and hover for Foo.res and Foo2.res:
17+
complete: compute autocomplete for MyFile.res at line 0 and column 4,
18+
where MyFile.res is being edited and the editor content is in file current.res.
1519

16-
./run.exe dump src/Foo.res src/Foo2.res
20+
./run.exe complete src/MyFile.res 0 4 current.res
1721

18-
complete: compute autocomplete for Foo.res at line 0 and column 4,
19-
where Foo.res is being edited and the editor content is in file current.res.
22+
definition: get definition for item in MyFile.res at line 10 column 2:
2023

21-
./run.exe complete src/Foo.res 0 4 current.res
24+
./run.exe definition src/MyFile.res 10 2
2225

23-
hover: get inferred type for Foo.res at line 10 column 2:
26+
dump: for debugging, show all definitions and hovers for MyFile.res and MyFile.res:
2427

25-
./run.exe hover src/Foo.res 10 2
28+
./run.exe dump src/Foo.res src/MyFile.res
2629

27-
definition: get definition for item in Foo.res at line 10 column 2:
30+
documentSymbol: get all symbols declared in MyFile.res
2831

29-
./run.exe definition src/Foo.res 10 2
32+
./run.exe documentSymbol src/MyFile.res
3033

31-
references: get references to item in Foo.res at line 10 column 2:
34+
hover: get inferred type for MyFile.res at line 10 column 2:
3235

33-
./run.exe references src/Foo.res 10 2
36+
./run.exe hover src/MyFile.res 10 2
3437

35-
documentSymbol: get all symbols in Foo.res:
38+
references: get all references to item in MyFile.res at line 10 column 2:
3639

37-
./run.exe documentSymbol src/Foo.res
38-
|}
40+
./run.exe references src/MyFile.res 10 2
41+
42+
test: run tests specified by special comments in file src/MyFile.res
43+
44+
./run.exe test src/src/MyFile.res
45+
|}
3946

4047
let main () =
4148
match Array.to_list Sys.argv with
4249
| [_; "complete"; path; line; col; currentFile] ->
4350
Commands.complete ~path ~line:(int_of_string line) ~col:(int_of_string col)
4451
~currentFile
45-
| [_; "hover"; path; line; col] ->
46-
Commands.hover ~path ~line:(int_of_string line) ~col:(int_of_string col)
4752
| [_; "definition"; path; line; col] ->
4853
Commands.definition ~path ~line:(int_of_string line)
4954
~col:(int_of_string col)
55+
| _ :: "dump" :: files -> Commands.dump files
56+
| [_; "documentSymbol"; path] -> Commands.documentSymbol ~path
57+
| [_; "hover"; path; line; col] ->
58+
Commands.hover ~path ~line:(int_of_string line) ~col:(int_of_string col)
5059
| [_; "references"; path; line; col] ->
5160
Commands.references ~path ~line:(int_of_string line)
5261
~col:(int_of_string col)
53-
| [_; "documentSymbol"; path] -> Commands.documentSymbol ~path
54-
| _ :: "dump" :: files -> Commands.dump files
5562
| [_; "test"; path] -> Commands.test ~path
5663
| args when List.mem "-h" args || List.mem "--help" args -> prerr_endline help
5764
| _ ->

0 commit comments

Comments
 (0)