Skip to content

Commit

Permalink
add missing go to def tests for structs (FuelLabs#4115)
Browse files Browse the repository at this point in the history
## Description
just adding a missing go to test for structs.

works towards FuelLabs#3989
  • Loading branch information
JoshuaBatty authored Feb 17, 2023
1 parent 812608c commit 7031e60
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions sway-lsp/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,13 +1141,29 @@ async fn go_to_definition_for_structs() {
definition_check_with_req_offset(&mut service, &mut go_to, 14, 9, &mut i).await;
definition_check_with_req_offset(&mut service, &mut go_to, 15, 16, &mut i).await;
definition_check_with_req_offset(&mut service, &mut go_to, 15, 23, &mut i).await;
// TODO: check `o: Option<Identity>`
go_to = GotoDefinition {
req_uri: &uri,
req_line: 16,
req_char: 11,
def_line: 80,
def_start_char: 9,
def_end_char: 15,
def_path: "sway-lib-std/src/option.sw",
};
// Type Params
let _ = lsp::definition_check(&mut service, &go_to, &mut i).await;

// Call Path
go_to.def_line = 19;
go_to.def_start_char = 7;
go_to.def_end_char = 13;
definition_check_with_req_offset(&mut service, &mut go_to, 24, 16, &mut i).await;
go_to = GotoDefinition {
req_uri: &uri,
req_line: 24,
req_char: 16,
def_line: 19,
def_start_char: 7,
def_end_char: 13,
def_path: uri.as_str(),
};
let _ = lsp::definition_check(&mut service, &go_to, &mut i).await;
}

#[tokio::test]
Expand Down

0 comments on commit 7031e60

Please sign in to comment.