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(
176176
177177fn instantiate_union ( db : & DbIndex , union : & LuaUnionType , substitutor : & TypeSubstitutor ) -> LuaType {
178178 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 ( ) ;
180181 for t in types {
181182 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+ }
183186 }
184187
185- match new_types . len ( ) {
188+ match old_sorted_types . len ( ) {
186189 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 ( ) ) ,
189192 }
190193}
191194
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ impl ProviderVirtualWorkspace {
147147 } ;
148148 // dbg!(&value);
149149 if value != expect. value {
150+ eprintln ! (
151+ "Hover content does not match expected value left: {value},\n right: {}" ,
152+ expect. value
153+ ) ;
150154 return false ;
151155 }
152156
You can’t perform that action at this time.
0 commit comments