Summary: Java bytecode format does not record the declarations location for classes and fields. We set up a first infrastructure to recover this information. Currently we only track location for classes and only gives the first line of the corresponding source file. We will enhance this location with source file (baby) parsing in a next diff. Reviewed By: mityal Differential Revision: D20868187 fbshipit-source-id: d355475e9master
parent
3ccacb1f6e
commit
50c98db391
@ -0,0 +1,13 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
|
||||||
|
open! IStd
|
||||||
|
|
||||||
|
(** this is a naive/temporary implementation in a near diff, we will 1) parse the source file to
|
||||||
|
collect location datas for all class names 2) cache the result for later uses but we may have to
|
||||||
|
adapt a litle some signatures *)
|
||||||
|
let class_name_location file _cn : Location.t = {line= 0; col= 0; file}
|
@ -0,0 +1,12 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
|
||||||
|
open! IStd
|
||||||
|
|
||||||
|
val class_name_location : SourceFile.t -> string -> Location.t
|
||||||
|
(** [class_name_location source class_name] searches in file [source] the declaration location for
|
||||||
|
class name [class_name] *)
|
Loading…
Reference in new issue