Skip to content

Commit

Permalink
make workspaceFolders not an option
Browse files Browse the repository at this point in the history
  • Loading branch information
tatchi committed May 31, 2020
1 parent 7903f6e commit f6498c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/Toolchain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@ let makeResources kind = kind

let selectAndSave () =
let open Promise.O in
let workspaceFolders =
Vscode.Workspace.workspaceFolders |. Belt.Option.getWithDefault [||]
in
let workspaceFolders = Vscode.Workspace.workspaceFolders () in
sandboxCandidates ~workspaceFolders >>= fun candidates ->
selectPackageManager candidates >>| function
| None -> None
Expand Down
4 changes: 3 additions & 1 deletion src/bindings/Vscode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ module Workspace = struct
external name : string option = "name"
[@@bs.module "vscode"] [@@bs.scope "workspace"]

external workspaceFolders : Folder.t array option = "workspaceFolders"
external _workspaceFolders : Folder.t array option = "workspaceFolders"
[@@bs.module "vscode"] [@@bs.scope "workspace"]

let workspaceFolders () = _workspaceFolders |. Belt.Option.getWithDefault [||]

external onDidOpenTextDocument : (TextDocument.event -> unit) -> unit
= "onDidOpenTextDocument"
[@@bs.module "vscode"] [@@bs.scope "workspace"]
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/Vscode.mli
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ module Workspace : sig

val name : string option

val workspaceFolders : Folder.t array option
val workspaceFolders : unit -> Folder.t array

val onDidOpenTextDocument : (TextDocument.event -> unit) -> unit

Expand Down

0 comments on commit f6498c7

Please sign in to comment.