Skip to content

Commit 8deb41f

Browse files
aspeddrozth
authored andcommitted
remove location field
1 parent ab6c8fe commit 8deb41f

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

analysis/src/DocExtraction.ml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ type docItem =
2929
docstring: string list;
3030
signature: string;
3131
name: string;
32-
loc: Warnings.loc;
3332
deprecated: string option;
3433
}
3534
| Type of {
3635
id: string;
3736
docstring: string list;
3837
signature: string;
3938
name: string;
40-
loc: Warnings.loc;
4139
deprecated: string option;
4240
detail: docItemDetail option;
4341
(** Additional documentation for constructors and record fields, if available. *)
@@ -117,17 +115,6 @@ let stringifyDetail ?(indentation = 0) (detail : docItemDetail) =
117115
|> array) );
118116
]
119117

120-
let stringifyLoc loc ~indentation =
121-
let open Protocol in
122-
let line, col = Loc.start loc in
123-
let path = loc.loc_start.pos_fname in
124-
stringifyObject ~startOnNewline:false ~indentation:(indentation + 1)
125-
[
126-
("path", Some (wrapInQuotes path));
127-
("line", Some (string_of_int (line + 1)));
128-
("col", Some (string_of_int (col + 1)));
129-
]
130-
131118
let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
132119
let open Protocol in
133120
match item with
@@ -141,7 +128,6 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
141128
match deprecated with
142129
| Some d -> Some (wrapInQuotes d)
143130
| None -> None );
144-
(* ("location", Some (stringifyLoc loc ~indentation)); *)
145131
( "signature",
146132
Some (signature |> String.trim |> Json.escape |> wrapInQuotes) );
147133
("docstrings", Some (stringifyDocstrings docstring));
@@ -156,7 +142,6 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
156142
match deprecated with
157143
| Some d -> Some (wrapInQuotes d)
158144
| None -> None );
159-
(* ("location", Some (stringifyLoc loc ~indentation)); *)
160145
("signature", Some (signature |> Json.escape |> wrapInQuotes));
161146
("docstrings", Some (stringifyDocstrings docstring));
162147
( "detail",
@@ -289,7 +274,6 @@ let extractDocs ~path ~debug =
289274
"let " ^ item.name ^ ": " ^ Shared.typeToString typ
290275
|> formatCode;
291276
name = item.name;
292-
loc = item.loc;
293277
deprecated = item.deprecated;
294278
})
295279
| Type (typ, _) ->
@@ -303,7 +287,6 @@ let extractDocs ~path ~debug =
303287
|> Shared.declToString item.name
304288
|> formatCode;
305289
name = item.name;
306-
loc = item.loc;
307290
deprecated = item.deprecated;
308291
detail = typeDetail typ ~full ~env;
309292
})

analysis/src/ProcessCmt.ml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ let rec forTypeSignatureItem ~(env : SharedTypes.Env.t) ~(exported : Exported.t)
5959
Module.kind = Module.Value declared.item;
6060
name = declared.name.txt;
6161
docstring = declared.docstring;
62-
loc;
6362
deprecated = declared.deprecated;
6463
};
6564
]
@@ -134,7 +133,6 @@ let rec forTypeSignatureItem ~(env : SharedTypes.Env.t) ~(exported : Exported.t)
134133
Module.kind = Type (declared.item, recStatus);
135134
name = declared.name.txt;
136135
docstring = declared.docstring;
137-
loc = type_loc;
138136
deprecated = declared.deprecated;
139137
};
140138
]
@@ -153,7 +151,6 @@ let rec forTypeSignatureItem ~(env : SharedTypes.Env.t) ~(exported : Exported.t)
153151
Module.kind = Module declared.item;
154152
name = declared.name.txt;
155153
docstring = declared.docstring;
156-
loc = md_loc;
157154
deprecated = declared.deprecated;
158155
};
159156
]
@@ -318,7 +315,6 @@ let forTypeDeclaration ~env ~(exported : Exported.t)
318315
Module.kind = Module.Type (declared.item, recStatus);
319316
name = declared.name.txt;
320317
docstring = declared.docstring;
321-
loc = typ_loc;
322318
deprecated = declared.deprecated;
323319
}
324320

@@ -338,7 +334,6 @@ let rec forSignatureItem ~env ~(exported : Exported.t)
338334
Module.kind = Module.Value declared.item;
339335
name = declared.name.txt;
340336
docstring = declared.docstring;
341-
loc = name.loc;
342337
deprecated = declared.deprecated;
343338
};
344339
]
@@ -370,7 +365,6 @@ let rec forSignatureItem ~env ~(exported : Exported.t)
370365
Module.kind = Module declared.item;
371366
name = declared.name.txt;
372367
docstring = declared.docstring;
373-
loc = name.loc;
374368
deprecated = declared.deprecated;
375369
};
376370
]
@@ -448,7 +442,6 @@ let rec forStructureItem ~env ~(exported : Exported.t) item =
448442
Module.kind = Module.Value declared.item;
449443
name = declared.name.txt;
450444
docstring = declared.docstring;
451-
loc = pat.pat_loc;
452445
deprecated = declared.deprecated;
453446
}
454447
:: !items
@@ -484,7 +477,6 @@ let rec forStructureItem ~env ~(exported : Exported.t) item =
484477
Module.kind = Module declared.item;
485478
name = declared.name.txt;
486479
docstring = declared.docstring;
487-
loc = name.loc;
488480
deprecated = declared.deprecated;
489481
};
490482
]
@@ -516,7 +508,6 @@ let rec forStructureItem ~env ~(exported : Exported.t) item =
516508
Module.kind = Module modTypeItem;
517509
name = declared.name.txt;
518510
docstring = declared.docstring;
519-
loc = name.loc;
520511
deprecated = declared.deprecated;
521512
};
522513
]
@@ -546,7 +537,6 @@ let rec forStructureItem ~env ~(exported : Exported.t) item =
546537
Module.kind = Value declared.item;
547538
name = declared.name.txt;
548539
docstring = declared.docstring;
549-
loc = vd.val_loc;
550540
deprecated = declared.deprecated;
551541
};
552542
]

analysis/src/SharedTypes.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ module Module = struct
126126
kind: kind;
127127
name: string;
128128
docstring: string list;
129-
loc: Warnings.loc;
130129
deprecated: string option;
131130
}
132131

0 commit comments

Comments
 (0)