Skip to content

Some renaming #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions analysis/.depend
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
src/BuildSystem.cmx : src/ModuleResolution.cmx src/Log.cmx src/Infix.cmx \
src/Files.cmx
src/EditorSupportCommands.cmx : src/Utils.cmx src/Uri2.cmx src/TopTypes.cmx \
src/State.cmx src/SharedTypes.cmx src/Shared.cmx src/References.cmx \
src/Protocol.cmx src/NewCompletions.cmx src/Hover.cmx src/Files.cmx
src/Cli.cmx : src/Commands.cmx
src/Commands.cmx : src/Utils.cmx src/Uri2.cmx src/TopTypes.cmx src/State.cmx \
src/SharedTypes.cmx src/Shared.cmx src/References.cmx src/Protocol.cmx \
src/NewCompletions.cmx src/Hover.cmx src/Files.cmx
src/Files.cmx :
src/FindFiles.cmx : src/Utils.cmx src/SharedTypes.cmx \
src/ModuleResolution.cmx src/Log.cmx src/vendor/Json.cmx src/Infix.cmx \
Expand Down Expand Up @@ -40,7 +41,6 @@ src/Protocol.cmx : src/vendor/Json.cmx
src/Query.cmx : src/SharedTypes.cmx src/Log.cmx src/Infix.cmx
src/References.cmx : src/Utils.cmx src/Uri2.cmx src/SharedTypes.cmx \
src/Query.cmx src/Log.cmx src/Infix.cmx
src/RescriptEditorSupport.cmx : src/EditorSupportCommands.cmx
src/Shared.cmx : src/PrintType.cmx src/Files.cmx
src/SharedTypes.cmx : src/Utils.cmx src/Uri2.cmx src/Shared.cmx \
src/Infix.cmx
Expand Down
47 changes: 47 additions & 0 deletions analysis/src/Cli.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
let help =
{|
**Private CLI For rescript-vscode usage only**

Examples:
current-platform.exe dump src/MyFile.res src/MyFile2.res
current-platform.exe complete src/MyFile.res 0 4 currentContent.res
current-platform.exe hover src/MyFile.res 10 2
current-platform.exe definition src/MyFile.res 9 3

Options:
dump: debugging. definition and hover for Foo.res and Foo2.res:

current-platform.exe dump src/Foo.res src/Foo2.res

complete: compute autocomplete for Foo.res at line 0 and column 4,
where Foo.res is being edited and the editor content is in file current.res.

current-platform.exe complete src/Foo.res 0 4 current.res

hover: get inferred type for Foo.res at line 10 column 2:

current-platform.exe hover src/Foo.res 10 2

definition: get inferred type for Foo.res at line 10 column 2:

current-platform.exe definition src/Foo.res 10 2|}

let main () =
match Array.to_list Sys.argv with
| [_; "complete"; path; line; col; currentFile] ->
Commands.complete ~path ~line:(int_of_string line) ~col:(int_of_string col)
~currentFile
| [_; "hover"; path; line; col] ->
Commands.hover ~path ~line:(int_of_string line) ~col:(int_of_string col)
| [_; "definition"; path; line; col] ->
Commands.definition ~path ~line:(int_of_string line)
~col:(int_of_string col)
| _ :: "dump" :: files -> Commands.dump files
| [_; "test"; path] -> Commands.test ~path
| args when List.mem "-h" args || List.mem "--help" args -> prerr_endline help
| _ ->
prerr_endline help;
exit 1

;;
main ()
File renamed without changes.
51 changes: 0 additions & 51 deletions analysis/src/RescriptEditorSupport.ml

This file was deleted.