Skip to content

Commit

Permalink
add a nested syntax test case
Browse files Browse the repository at this point in the history
  • Loading branch information
minestarks committed Oct 4, 2024
1 parent 42fcb76 commit 38a9916
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions language_service/src/completion/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,50 @@ fn struct_init_path_part() {
);
}

#[test]
fn struct_init_path_part_in_field_assigment() {
check(
r#"
namespace Test {
function Main() : Unit {
let x = new FakeStdLib.Udt { x = FakeStdLib.↘ } ;
}
}"#,
&["Udt", "Qubit", "FakeWithParam"],
&expect![[r#"
[
Some(
CompletionItem {
label: "Udt",
kind: Interface,
sort_text: Some(
"0300Udt",
),
detail: Some(
"struct Udt { x : Int, y : Int }",
),
additional_text_edits: None,
},
),
None,
Some(
CompletionItem {
label: "FakeWithParam",
kind: Function,
sort_text: Some(
"0300FakeWithParam",
),
detail: Some(
"operation FakeWithParam(x : Int) : Unit",
),
additional_text_edits: None,
},
),
]
"#]],
);
}

#[test]
fn export_path() {
check(
Expand Down

0 comments on commit 38a9916

Please sign in to comment.