Skip to content

Commit 85b546e

Browse files
committed
Refactor: remove unused Explanation.
1 parent b50e0bf commit 85b546e

File tree

5 files changed

+3
-19
lines changed

5 files changed

+3
-19
lines changed

analysis/src/Commands.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ let hover ~file ~line ~col ~extra ~package =
5757
let locIsModule =
5858
match loc with
5959
| SharedTypes.LModule _ | TopLevelModule _ -> true
60-
| TypeDefinition _ | Typed _ | Constant _ | Explanation _ -> false
60+
| TypeDefinition _ | Typed _ | Constant _ -> false
6161
in
6262
let uriLocOpt = References.definitionForLoc ~package ~file loc in
6363
let skipZero =
@@ -97,7 +97,7 @@ let definition ~file ~line ~col ~extra ~package =
9797
let locIsModule =
9898
match loc with
9999
| SharedTypes.LModule _ | TopLevelModule _ -> true
100-
| TypeDefinition _ | Typed _ | Constant _ | Explanation _ -> false
100+
| TypeDefinition _ | Typed _ | Constant _ -> false
101101
in
102102
let uriLocOpt = References.definitionForLoc ~package ~file loc in
103103
match uriLocOpt with

analysis/src/Hover.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ let showModule ~docstring ~(file : SharedTypes.file) ~name
4949

5050
let newHover ~(file : SharedTypes.file) ~package loc =
5151
match loc with
52-
| SharedTypes.Explanation text -> Some text
53-
| TypeDefinition (name, decl, _stamp) ->
52+
| SharedTypes.TypeDefinition (name, decl, _stamp) ->
5453
let typeDef = Shared.declToString name decl in
5554
Some (codeBlock typeDef)
5655
| LModule (Definition (stamp, _tip)) | LModule (LocalReference (stamp, _tip))

analysis/src/ProcessCmt.ml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -919,17 +919,6 @@ struct
919919

920920
let enter_structure_item item =
921921
match item.str_desc with
922-
| Tstr_attribute
923-
( {Asttypes.txt = "ocaml.explanation"; loc},
924-
PStr
925-
[
926-
{
927-
pstr_desc =
928-
Pstr_eval
929-
({pexp_desc = Pexp_constant (Pconst_string (doc, _))}, _);
930-
};
931-
] ) ->
932-
addLocation loc (Explanation doc)
933922
| Tstr_include {incl_mod = expr} -> handle_module_expr expr.mod_desc
934923
| Tstr_module {mb_expr} -> handle_module_expr mb_expr.mod_desc
935924
| Tstr_open {open_path; open_txt = {txt; loc}} ->

analysis/src/References.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ let definitionForLoc ~package ~file loc =
308308
let loc = validateLoc declared.name.loc declared.extentLoc in
309309
Some (file.uri, loc))
310310
else None)
311-
| Explanation _
312311
| Typed (_, NotFound)
313312
| LModule (NotFound | Definition (_, _))
314313
| TypeDefinition (_, _, _)
@@ -448,7 +447,6 @@ let forLocalStamp ~package ~file ~extra stamp tip =
448447

449448
let allReferencesForLoc ~package ~file ~extra loc =
450449
match loc with
451-
| Explanation _
452450
| Typed (_, NotFound)
453451
| LModule NotFound
454452
| TopLevelModule _ | Constant _ ->

analysis/src/SharedTypes.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ type loc =
180180
| LModule of locKind
181181
| TopLevelModule of string
182182
| TypeDefinition of string * Types.type_declaration * int
183-
| Explanation of string
184183

185184
type openTracker = {
186185
path : Path.t;
@@ -225,7 +224,6 @@ let locToString = function
225224
| LModule _ -> "LModule"
226225
| TopLevelModule _ -> "TopLevelModule"
227226
| TypeDefinition _ -> "TypeDefinition"
228-
| Explanation _ -> "Explanation"
229227

230228
let locationToString ({Location.loc_start; loc_end}, loc) =
231229
let pos1 = Utils.cmtPosToPosition loc_start in

0 commit comments

Comments
 (0)