File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -118,13 +118,12 @@ let expandTypes ~file ~package ~supportsMarkdownLinks typ =
118
118
`InlineType )
119
119
| all ->
120
120
let typesSeen = ref StringSet. empty in
121
- let typeId ~(env : QueryEnv.t ) ~name =
122
- env.file.moduleName :: List. rev (name :: env.pathRev) |> String. concat " ."
123
- in
124
121
( all
125
122
(* Don't produce duplicate type definitions for recursive types *)
126
- |> List. filter (fun {env; name} ->
127
- let typeId = typeId ~env ~name in
123
+ |> List. filter (fun {env; name; loc} ->
124
+ let typeId =
125
+ TypeUtils. typeId ~env ~name: (Location. mkloc name loc)
126
+ in
128
127
if StringSet. mem typeId ! typesSeen then false
129
128
else (
130
129
typesSeen := StringSet. add typeId ! typesSeen;
Original file line number Diff line number Diff line change @@ -1179,6 +1179,12 @@ let transformCompletionToPipeCompletion ?(synthetic = false) ~env ?posOfDot
1179
1179
| Some posOfDot -> Some (makeAdditionalTextEditsForRemovingDot posOfDot));
1180
1180
}
1181
1181
1182
+ (* * Light weight type id *)
1183
+ let typeId ~(env : QueryEnv.t ) ~(name : string Location.loc ) =
1184
+ (env.file.moduleName :: List. rev (name.txt :: env.pathRev)
1185
+ |> String. concat " ." )
1186
+ ^ " :" ^ Loc. toString name.loc
1187
+
1182
1188
(* * This takes a type expr and the env that type expr was found in, and produces a globally unique
1183
1189
id for that specific type. The globally unique id is the full path to the type as seen from the root
1184
1190
of the project. Example: type x in module SomeModule in file SomeFile would get the globally
You can’t perform that action at this time.
0 commit comments