Skip to content

Commit cd0be72

Browse files
committed
update hover
1 parent fa747d5 commit cd0be72

File tree

1 file changed

+9
-4
lines changed
  • crates/emmylua_code_analysis/src/db_index/type

1 file changed

+9
-4
lines changed

crates/emmylua_code_analysis/src/db_index/type/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,17 @@ fn get_real_type_with_depth<'a>(
302302

303303
// 第一个参数是否不应该视为 self
304304
pub fn first_param_may_not_self(typ: &LuaType) -> bool {
305-
if typ.is_table() || matches!(typ, LuaType::Ref(_) | LuaType::Def(_) | LuaType::Any) {
306-
return false;
305+
if typ.is_table()
306+
|| matches!(
307+
typ,
308+
LuaType::TplRef(_) | LuaType::StrTplRef(_) | LuaType::Any
309+
)
310+
{
311+
return true;
307312
}
313+
308314
if let LuaType::Union(u) = typ {
309315
return u.into_vec().iter().any(first_param_may_not_self);
310316
}
311-
312-
true
317+
false
313318
}

0 commit comments

Comments
 (0)