Skip to content

Commit

Permalink
[flow][cleanup] Remove unused eq functions
Browse files Browse the repository at this point in the history
Summary: Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D55618839

fbshipit-source-id: 07c8a860e9c90cbdda86e6414a4cd63fd5979a0e
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Apr 2, 2024
1 parent 388bcf9 commit 6be0565
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
27 changes: 0 additions & 27 deletions src/services/autocomplete/autocompleteService_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module AcCompletion = struct
insert: Loc.t;
replace: Loc.t;
}
[@@deriving eq]

type completion_item = {
kind: Lsp.Completion.completionItemKind option;
Expand All @@ -33,33 +32,10 @@ module AcCompletion = struct
insert_text_format: Lsp.Completion.insertTextFormat;
}

let opt_eq ~eq o1 o2 =
match (o1, o2) with
| (None, None) -> true
| (Some _, None)
| (None, Some _) ->
false
| (Some v1, Some v2) -> eq v1 v2

let equal_completion_item item1 item2 =
opt_eq ~eq:Lsp.Completion.equal_completionItemKind item1.kind item2.kind
&& String.equal item1.name item2.name
&& opt_eq ~eq:String.equal item1.labelDetail item2.labelDetail
&& opt_eq ~eq:String.equal item1.description item2.description
&& item1.itemDetail = item2.itemDetail
&& opt_eq ~eq:equal_insert_replace_edit item1.text_edit item2.text_edit
&& item1.additional_text_edits = item2.additional_text_edits
&& opt_eq ~eq:String.equal item1.sort_text item2.sort_text
&& item1.preselect = item2.preselect
&& Lazy.force item1.documentation_and_tags = Lazy.force item2.documentation_and_tags
&& String.equal item1.log_info item2.log_info
&& Lsp.Completion.equal_insertTextFormat item1.insert_text_format item2.insert_text_format

type t = {
items: completion_item list;
is_incomplete: bool;
}
[@@deriving eq]

let empty_documentation_and_tags = lazy (None, None)

Expand Down Expand Up @@ -392,16 +368,13 @@ type 'r ac_result = {
result: 'r;
errors_to_log: string list;
}
[@@deriving eq]

type 'r autocomplete_service_result_generic =
| AcResult of 'r ac_result
| AcEmpty of string
| AcFatalError of string
[@@deriving eq]

type autocomplete_service_result = AcCompletion.t autocomplete_service_result_generic
[@@deriving eq]

let jsdoc_of_def_loc { loc_of_aloc; get_ast; ast; _ } def_loc =
loc_of_aloc def_loc |> Find_documentation.jsdoc_of_getdef_loc ~ast ~get_ast
Expand Down
5 changes: 0 additions & 5 deletions src/services/autocomplete/autocompleteService_js.mli
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module AcCompletion : sig
insert: Loc.t;
replace: Loc.t;
}
[@@deriving eq]

type completion_item = {
kind: Lsp.Completion.completionItemKind option;
Expand All @@ -27,13 +26,11 @@ module AcCompletion : sig
log_info: string;
insert_text_format: Lsp.Completion.insertTextFormat;
}
[@@deriving eq]

type t = {
items: completion_item list;
is_incomplete: bool;
}
[@@deriving eq]
end

type ac_options = {
Expand Down Expand Up @@ -72,10 +69,8 @@ type 'r autocomplete_service_result_generic =
| AcResult of 'r ac_result
| AcEmpty of string
| AcFatalError of string
[@@deriving eq]

type autocomplete_service_result = AcCompletion.t autocomplete_service_result_generic
[@@deriving eq]

val autocomplete_get_results :
typing ->
Expand Down

0 comments on commit 6be0565

Please sign in to comment.