Skip to content

Commit d0ef714

Browse files
committed
test: add new test with partially annotated generic function
1 parent a0b046c commit d0ef714

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

compiler-core/src/language_server/tests/action.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10744,6 +10744,19 @@ pub fn add_one(thing: Int) {
1074410744
);
1074510745
}
1074610746

10747+
#[test]
10748+
fn annotate_all_top_level_definitions_with_partially_annotated_generic_function() {
10749+
assert_code_action!(
10750+
ANNOTATE_TOP_LEVEL_DEFINITIONS,
10751+
r#"
10752+
pub fn wibble(a: a, b, c: c, d) {
10753+
todo
10754+
}
10755+
"#,
10756+
find_position_of("wibble").to_selection()
10757+
);
10758+
}
10759+
1074710760
#[test]
1074810761
fn annotate_all_top_level_definitions_with_two_generic_functions() {
1074910762
assert_code_action!(
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
source: compiler-core/src/language_server/tests/action.rs
3+
expression: "\npub fn wibble(a: a, b, c: c, d) {\n todo\n}\n"
4+
---
5+
----- BEFORE ACTION
6+
7+
pub fn wibble(a: a, b, c: c, d) {
8+
9+
todo
10+
}
11+
12+
13+
----- AFTER ACTION
14+
15+
pub fn wibble(a: a, b: b, c: c, d: d) -> e {
16+
todo
17+
}

0 commit comments

Comments
 (0)