Skip to content

Commit 950e23e

Browse files
committed
fix
1 parent f65a1a6 commit 950e23e

File tree

4 files changed

+20
-26
lines changed

4 files changed

+20
-26
lines changed

crates/emmylua_ls/src/handlers/completion/providers/member_provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use emmylua_code_analysis::{
2-
DbIndex, LuaMemberInfo, LuaSemanticDeclId, LuaType, LuaTypeDeclId, SemanticModel,
2+
DbIndex, LuaMemberInfo, LuaMemberKey, LuaSemanticDeclId, LuaType, LuaTypeDeclId, SemanticModel,
33
enum_variable_is_param, get_tpl_ref_extend_type,
44
};
55
use emmylua_parser::{LuaAstNode, LuaAstToken, LuaIndexExpr, LuaStringToken};

crates/emmylua_ls/src/handlers/semantic_token/build_semantic_tokens.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn build_semantic_tokens(
5353
}
5454

5555
fn build_tokens_semantic_token(
56-
semantic_model: &SemanticModel,
56+
_semantic_model: &SemanticModel,
5757
builder: &mut SemanticBuilder,
5858
token: &LuaSyntaxToken,
5959
client_id: ClientId,

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,8 @@ mod tests {
659659
Ok(())
660660
}
661661

662-
#[test]
663-
fn test_str_tpl_ref_4() {
662+
#[gtest]
663+
fn test_str_tpl_ref_4() -> Result<()> {
664664
let mut ws = ProviderVirtualWorkspace::new_with_init_std_lib();
665665
ws.def(
666666
r#"
@@ -669,7 +669,7 @@ mod tests {
669669
---@class D: C
670670
"#,
671671
);
672-
assert!(ws.check_completion_with_kind(
672+
check!(ws.check_completion_with_kind(
673673
r#"
674674
---@generic T: string
675675
---@param name `T`
@@ -694,8 +694,8 @@ mod tests {
694694
],
695695
CompletionTriggerKind::TRIGGER_CHARACTER,
696696
));
697+
Ok(())
697698
}
698-
699699

700700
#[gtest]
701701
fn test_table_field_function_1() -> Result<()> {
@@ -2057,16 +2057,16 @@ mod tests {
20572057
Ok(())
20582058
}
20592059

2060-
#[test]
2061-
fn test_issue_646() {
2060+
#[gtest]
2061+
fn test_issue_646() -> Result<()> {
20622062
let mut ws = ProviderVirtualWorkspace::new();
20632063
ws.def(
20642064
r#"
20652065
---@class Base
20662066
---@field a string
20672067
"#,
20682068
);
2069-
assert!(ws.check_completion(
2069+
check!(ws.check_completion(
20702070
r#"
20712071
---@generic T: Base
20722072
---@param file T
@@ -2080,5 +2080,6 @@ mod tests {
20802080
..Default::default()
20812081
},],
20822082
));
2083+
Ok(())
20832084
}
20842085
}

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

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ mod tests {
431431
Ok(())
432432
}
433433

434-
#[test]
435-
fn test_goto_variable_param() {
434+
#[gtest]
435+
fn test_goto_variable_param() -> Result<()> {
436436
let mut ws = ProviderVirtualWorkspace::new();
437437
ws.def_file(
438438
"a.lua",
@@ -454,23 +454,16 @@ mod tests {
454454
return export
455455
"#,
456456
);
457-
let result = ws
458-
.check_definition(
459-
r#"
457+
check!(ws.check_definition(
458+
r#"
460459
local zipLatest = require('b').zipLatest
461460
zipLatest<??>()
462461
"#,
463-
)
464-
.unwrap();
465-
match result {
466-
GotoDefinitionResponse::Array(array) => {
467-
assert_eq!(array.len(), 1);
468-
let location = &array[0];
469-
assert_eq!(location.uri.path().as_str().ends_with("a.lua"), true);
470-
}
471-
_ => {
472-
panic!("expect array");
473-
}
474-
}
462+
vec![Expected {
463+
file: "a.lua".to_string(),
464+
line: 4,
465+
}],
466+
));
467+
Ok(())
475468
}
476469
}

0 commit comments

Comments
 (0)