Skip to content

Commit

Permalink
fix merge bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
PizieDust committed Dec 9, 2024
1 parent a5d2c92 commit b48f03f
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 445 deletions.
401 changes: 134 additions & 267 deletions src-bindings/vscode/vscode.ml

Large diffs are not rendered by default.

97 changes: 6 additions & 91 deletions src-bindings/vscode/vscode.mli
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,9 @@ module ThemeIcon : sig
include Ojs.T

val make : id:string -> ?color:ThemeColor.t -> unit -> t

val file : t

val folder : t

val id : t -> string

val color : t -> ThemeColor.t option
end

Expand Down Expand Up @@ -701,9 +697,7 @@ module QuickInputButton : sig
]

val iconPath : t -> iconPath

val tooltip : t -> string option

val create : iconPath:iconPath -> ?tooltip:string -> unit -> t
end

Expand Down Expand Up @@ -761,89 +755,49 @@ module QuickPick : sig
type nonrec t = T.t t

val onDidAccept : t -> unit Event.t

val onDidChangeActive : t -> T.t list Event.t

val onDidChangeSelection : t -> T.t list Event.t

val onDidChangeValue : t -> string Event.t

val onDidHide : t -> unit Event.t

val onDidTriggerButton : t -> QuickInputButton.t Event.t

val activeItems : t -> T.t list option

val set_activeItems : t -> T.t list option -> unit

val busy : t -> bool option

val set_busy : t -> bool option -> unit

val buttons : t -> QuickInputButton.t list option

val set_buttons : t -> QuickInputButton.t list option -> unit

val canSelectMany : t -> bool option

val set_canSelectMany : t -> bool option -> unit

val enabled : t -> bool option

val set_enabled : t -> bool option -> unit

val ignoreFocusOut : t -> bool option

val set_ignoreFocusOut : t -> bool option -> unit

val items : t -> T.t list option

val set_items : t -> T.t list option -> unit

val keepScrollPosition : t -> bool option

val set_keepScrollPosition : t -> bool option -> unit

val matchOnDescription : t -> bool option

val set_matchOnDescription : t -> bool option -> unit

val matchOnDetail : t -> bool option

val set_matchOnDetail : t -> bool option -> unit

val placeholder : t -> string option

val set_placeholder : t -> string option -> unit

val selectedItems : t -> T.t list option

val set_selectedItems : t -> T.t list option -> unit

val step : t -> int option

val set_step : t -> int option -> unit

val title : t -> string option

val set_title : t -> string option -> unit

val totalSteps : t -> int option

val set_totalSteps : t -> int option -> unit

val value : t -> string option

val set_value : t -> string option -> unit

val dispose : t -> unit

val hide : t -> unit

val show : t -> unit

val set :
t
val set
: t
-> ?activeItems:T.t list
-> ?busy:bool
-> ?buttons:QuickInputButton.t list
Expand Down Expand Up @@ -887,11 +841,8 @@ module InputBoxValidationMessage : sig
include Ojs.T

val message : t -> string

val severity : t -> InputBoxValidationSeverity.t

val create :
message:string -> severity:InputBoxValidationSeverity.t -> unit -> t
val create : message:string -> severity:InputBoxValidationSeverity.t -> unit -> t
end

module InputBoxOptions : sig
Expand Down Expand Up @@ -923,56 +874,32 @@ module InputBox : sig
include Ojs.T

val title : t -> string option

val set_title : t -> string option -> unit

val enabled : t -> bool

val set_enabled : t -> bool -> unit

val busy : t -> bool

val set_busy : t -> bool -> unit

val ignoreFocusOut : t -> bool option

val set_ignoreFocusOut : t -> bool option -> unit

val onDidHide : t -> unit Event.t

val value : t -> string option

val set_value : t -> string option -> unit

val valueSelection : t -> (int * int) option

val set_valueSelection : t -> (int * int) option -> unit

val placeholder : t -> string option

val set_placeholder : t -> string option -> unit

val password : t -> bool option

val set_password : t -> bool option -> unit

val onDidChangeValue : t -> string Event.t

val onDidAccept : t -> unit Event.t

val prompt : t -> string option

val set_prompt : t -> string option -> unit

val validationMessage : t -> InputBoxValidationMessage.t or_undefined

val set_validationMessage :
t -> InputBoxValidationMessage.t or_undefined -> unit

val set_validationMessage : t -> InputBoxValidationMessage.t or_undefined -> unit
val show : t -> unit

val set :
t
val set
: t
-> ?title:string
-> ?ignoreFocusOut:bool
-> ?value:string
Expand Down Expand Up @@ -1798,16 +1725,6 @@ module TreeItemLabel : sig
val highlights : t -> (int * int) list option
end

module ThemeIcon : sig
include Ojs.T

val make : id:string -> ?color:ThemeColor.t -> unit -> t
val file : t
val folder : t
val id : t -> string
val color : t -> ThemeColor.t option
end

module TreeItem : sig
include Ojs.T

Expand Down Expand Up @@ -2214,7 +2131,6 @@ module Window : sig
-> 'a option Promise.t

val createQuickPick : 'a Js.t -> unit -> 'a QuickPick.t

val quickInputButtonBack : QuickInputButton.t

val showQuickPick
Expand All @@ -2231,7 +2147,6 @@ module Window : sig
-> string option Promise.t

val createInputBox : unit -> InputBox.t

val showOpenDialog : ?options:OpenDialogOptions.t -> unit -> Uri.t list option Promise.t
val createOutputChannel : name:string -> OutputChannel.t

Expand Down
32 changes: 19 additions & 13 deletions src/custom_requests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,17 @@ module Type_search = struct

let encode_params { uri; position; limit; query; with_doc; doc_format } =
let open Jsonoo.Encode in
let uri =
("textDocument", object_ [ ("uri", string @@ Uri.toString uri ()) ])
in
let position = ("position", Position.json_of_t position) in
let query = ("query", string query) in
let limit = ("limit", int limit) in
let with_doc = ("with_doc", bool with_doc) in
let uri = "textDocument", object_ [ "uri", string @@ Uri.toString uri () ] in
let position = "position", Position.json_of_t position in
let query = "query", string query in
let limit = "limit", int limit in
let with_doc = "with_doc", bool with_doc in
let doc_format =
( "doc_format"
, MarkupKind.json_of_t
(Option.value ~default:MarkupKind.Markdown doc_format) )
, MarkupKind.json_of_t (Option.value ~default:MarkupKind.Markdown doc_format) )
in
object_ [ uri; position; query; limit; with_doc; doc_format ]
;;

let decode_response response =
let open Jsonoo.Decode in
Expand All @@ -206,11 +204,19 @@ module Type_search = struct
{ name; typ; loc; doc; cost; constructible }
in
list decode_res response
;;

let make ~uri ~position ~limit ~query ~with_doc
?(doc_format = Some MarkupKind.Markdown) () =
let make
~uri
~position
~limit
~query
~with_doc
?(doc_format = Some MarkupKind.Markdown)
()
=
{ uri; position; limit; query; with_doc; doc_format }
;;

let request =
{ meth = ocamllsp_prefixed "typeSearch"; encode_params; decode_response }
let request = { meth = ocamllsp_prefixed "typeSearch"; encode_params; decode_response }
end
5 changes: 2 additions & 3 deletions src/custom_requests.mli
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ module Type_search : sig
}

type params

type response = type_search_result list

val make :
uri:Uri.t
val make
: uri:Uri.t
-> position:Position.t
-> limit:int
-> query:string
Expand Down
Loading

0 comments on commit b48f03f

Please sign in to comment.