File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
emmylua_code_analysis/src/semantic/generic
emmylua_ls/src/handlers/test_lib Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -176,16 +176,19 @@ fn instantiate_object(
176
176
177
177
fn instantiate_union ( db : & DbIndex , union : & LuaUnionType , substitutor : & TypeSubstitutor ) -> LuaType {
178
178
let types = union. into_vec ( ) ;
179
- let mut new_types = HashSet :: new ( ) ;
179
+ let mut new_type_set = HashSet :: new ( ) ;
180
+ let mut old_sorted_types = Vec :: new ( ) ;
180
181
for t in types {
181
182
let t = instantiate_type_generic ( db, & t, substitutor) ;
182
- new_types. insert ( t) ;
183
+ if new_type_set. insert ( t. clone ( ) ) {
184
+ old_sorted_types. push ( t) ;
185
+ }
183
186
}
184
187
185
- match new_types . len ( ) {
188
+ match old_sorted_types . len ( ) {
186
189
0 => LuaType :: Unknown ,
187
- 1 => new_types . iter ( ) . next ( ) . unwrap ( ) . clone ( ) ,
188
- _ => LuaType :: Union ( LuaUnionType :: from_set ( new_types ) . into ( ) ) ,
190
+ 1 => old_sorted_types [ 0 ] . clone ( ) ,
191
+ _ => LuaType :: Union ( LuaUnionType :: from_vec ( old_sorted_types ) . into ( ) ) ,
189
192
}
190
193
}
191
194
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ impl ProviderVirtualWorkspace {
147
147
} ;
148
148
// dbg!(&value);
149
149
if value != expect. value {
150
+ eprintln ! (
151
+ "Hover content does not match expected value left: {value},\n right: {}" ,
152
+ expect. value
153
+ ) ;
150
154
return false ;
151
155
}
152
156
You can’t perform that action at this time.
0 commit comments