Skip to content

Commit a5084e2

Browse files
authored
Merge pull request #809 from xuhuanzy/fix
fix hover signature
2 parents 38509ef + 3ec2314 commit a5084e2

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
.idea
33
.cursor
44
dhat-heap.json
5+
.claude
6+
7+
# MCP, 用于为AI提供lsp上下文
8+
.serena

crates/emmylua_code_analysis/src/db_index/signature/signature.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ impl LuaSignature {
140140
if let (LuaType::Ref(_) | LuaType::Def(_), _) = (owner_type, param_type)
141141
&& (param_type.is_any()
142142
|| param_type.is_table()
143-
|| param_type.is_class_tpl())
143+
|| param_type.is_class_tpl()
144+
|| param_type.is_str_tpl_ref())
144145
{
145146
return false;
146147
}

crates/emmylua_ls/src/handlers/test/hover_function_test.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,24 @@ mod tests {
529529
));
530530
Ok(())
531531
}
532+
533+
#[gtest]
534+
fn test_first_strtpl() -> Result<()> {
535+
let mut ws = ProviderVirtualWorkspace::new();
536+
check!(ws.check_hover(
537+
r#"
538+
---@class Fix
539+
local Fix
540+
541+
---@generic T
542+
---@param name `T`
543+
function Fix.ad<??>d(name)
544+
end
545+
"#,
546+
VirtualHoverResult {
547+
value: "```lua\nfunction Fix.add(name: T)\n```".to_string(),
548+
},
549+
));
550+
Ok(())
551+
}
532552
}

0 commit comments

Comments
 (0)