Skip to content

Commit 6bdc1a5

Browse files
committed
Clean up cli.
1 parent 0478400 commit 6bdc1a5

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

analysis/src/Cli.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ let main () =
7171
| _ :: "dump" :: files -> Commands.dump files
7272
| [_; "documentSymbol"; path] -> Commands.documentSymbol ~path
7373
| [_; "semanticTokens"; currentFile] ->
74-
SemanticTokens.testCommand ~currentFile
74+
SemanticTokens.semanticTokens ~currentFile
7575
| [_; "hover"; path; line; col] ->
7676
Commands.hover ~path ~line:(int_of_string line) ~col:(int_of_string col)
7777
| [_; "references"; path; line; col] ->

analysis/src/Commands.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ let test ~path =
347347
close_out cout;
348348
completion ~path ~line ~col ~currentFile;
349349
Sys.remove currentFile
350-
| "par" ->
351-
print_endline ("Parse " ^ path);
352-
SemanticTokens.parser ~debug:true
350+
| "hig" ->
351+
print_endline ("Highlight " ^ path);
352+
SemanticTokens.command ~debug:true
353353
~emitter:(SemanticTokens.Token.createEmitter ())
354354
~path
355355
| _ -> ());

analysis/src/SemanticTokens.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ let emitVariant ~(name : Longident.t Location.loc) ~debug emitter =
208208
~pos:(Utils.tupleOfLexing name.loc.loc_start)
209209
~lid:name.txt ~debug
210210

211-
let parser ~debug ~emitter ~path =
211+
let command ~debug ~emitter ~path =
212212
let processTypeArg (coreType : Parsetree.core_type) =
213213
if debug then Printf.printf "TypeArg: %s\n" (locToString coreType.ptyp_loc)
214214
in
@@ -441,8 +441,7 @@ let parser ~debug ~emitter ~path =
441441
(List.length signature) (List.length diagnostics);
442442
mapper.signature mapper signature |> ignore
443443

444-
let testCommand ~currentFile =
444+
let semanticTokens ~currentFile =
445445
let emitter = Token.createEmitter () in
446-
parser ~emitter ~debug:false ~path:currentFile;
447-
(* emitter |> Token.add ~line:0 ~char:0 ~length:3 ~type_:Token.Keyword; *)
446+
command ~emitter ~debug:false ~path:currentFile;
448447
Printf.printf "{\"data\":[%s]}" (Token.emit emitter)

analysis/tests/src/Highlight.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ open XX.YY
5353

5454
type tt = t
5555

56-
// ^par
56+
// ^hig
5757

5858
module T = {
5959
type someRecord<'typeParameter> = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Parse tests/src/Highlight.res
1+
Highlight tests/src/Highlight.res
22
structure items:38 diagnostics:0
33
Lident: M (0,7) Class
44
Lident: C (1,9) Class

0 commit comments

Comments
 (0)