Skip to content

Commit

Permalink
Fix jump to hole on destruct/construct to jump only within new genera…
Browse files Browse the repository at this point in the history
…ted text (ocamllabs#784)

* jump to a hole on destruct/construct only if
    the hole is within the generated text
* ignore old arguments protocol for jump-next-hole
* add bindings for some `vscode_languageclient` functionality:
`StaticFeature`, `registerFeature`, `ClientCapabilities`
* add experimental client capability `jumpToNextHole`
  • Loading branch information
ulugbekna authored Feb 10, 2022
1 parent 124779a commit a8febc3
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 145 deletions.
36 changes: 35 additions & 1 deletion src-bindings/vscode_languageclient/vscode_languageclient.ml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,38 @@ end

module ServerOptions = Executable

module ClientCapabilities = struct
include Interface.Make ()

include
[%js:
val experimental : t -> Jsonoo.t or_undefined [@@js.get]

val set_experimental : t -> Jsonoo.t or_undefined -> unit [@@js.set]]
end

module InitializeParams = struct
include Interface.Make ()
end

module StaticFeature = struct
include Interface.Make ()

include
[%js:
val make :
?fillInitializeParams:(params:InitializeParams.t -> unit)
-> fillClientCapabilities:(capabilities:ClientCapabilities.t -> unit)
-> initialize:
( capabilities:ServerCapabilities.t
-> documentSelector:DocumentSelector.t or_undefined
-> unit)
-> dispose:(unit -> unit)
-> unit
-> t
[@@js.builder]]
end

module LanguageClient = struct
include Class.Make ()

Expand Down Expand Up @@ -173,7 +205,9 @@ module LanguageClient = struct
-> ?token:Vscode.CancellationToken.t
-> unit
-> Jsonoo.t Promise.t
[@@js.call]]
[@@js.call]

val registerFeature : t -> feature:StaticFeature.t -> unit [@@js.call]]

let ready_initialize_result t =
let open Promise.Syntax in
Expand Down
29 changes: 29 additions & 0 deletions src-bindings/vscode_languageclient/vscode_languageclient.mli
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,33 @@ end

module ServerOptions = Executable

module InitializeParams : sig
include Js.T
end

module ClientCapabilities : sig
include Js.T

val experimental : t -> Jsonoo.t or_undefined

val set_experimental : t -> Jsonoo.t or_undefined -> unit
end

module StaticFeature : sig
include Js.T

val make :
?fillInitializeParams:(params:InitializeParams.t -> unit)
-> fillClientCapabilities:(capabilities:ClientCapabilities.t -> unit)
-> initialize:
( capabilities:ServerCapabilities.t
-> documentSelector:DocumentSelector.t or_undefined
-> unit)
-> dispose:(unit -> unit)
-> unit
-> t
end

module LanguageClient : sig
include Js.T

Expand Down Expand Up @@ -148,4 +175,6 @@ module LanguageClient : sig
-> ?token:Vscode.CancellationToken.t
-> unit
-> Jsonoo.t Promise.t

val registerFeature : t -> feature:StaticFeature.t -> unit
end
Loading

0 comments on commit a8febc3

Please sign in to comment.