forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add goto and hover tests for
TyConstantDeclaration
tokens (FuelLabs…
…#3990) ## Description This PR adds tests for go_to and hover functionality for `TyConstantDeclaration` tokens. Hover requests have been reworked so be inline with how go_to requests are structured. works towards: FuelLabs#3989
- Loading branch information
1 parent
5c02668
commit ddd1b8b
Showing
7 changed files
with
193 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
out | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "consts" | ||
|
||
[dependencies] | ||
std = { path = "../../../../../sway-lib-std" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
contract; | ||
|
||
dep more_consts; | ||
use more_consts::{Data, Value}; | ||
|
||
/// documentation for CONSTANT_1 | ||
const CONSTANT_1 = 100; | ||
/// CONSTANT_2 has a value of 200 | ||
const CONSTANT_2: u32 = 200; | ||
const BASE_TOKEN = ContractId::from(0x9ae5b658754e096e4d681c548daf46354495a437cc61492599e33fc64dcdc30c); | ||
const MY_DATA: Data = Data::B(Value {a: 100}); | ||
|
||
struct Point { | ||
x: u64, | ||
y: u32, | ||
} | ||
|
||
fn test() { | ||
// Constants defined in the same module | ||
let point = Point { x: CONSTANT_1, y: CONSTANT_2 }; | ||
let contract_id = BASE_TOKEN; | ||
|
||
// Constants defined in a different module | ||
let point = Point { x: more_consts::CONSTANT_3, y: more_consts::CONSTANT_4 }; | ||
let data = more_consts::MY_DATA1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
library more_consts; | ||
|
||
struct Value { | ||
a: u32, | ||
} | ||
|
||
enum Data { | ||
A: bool, | ||
B: Value, | ||
} | ||
|
||
pub const CONSTANT_3: u32 = 300; | ||
pub const CONSTANT_4: u32 = 400; | ||
pub const MY_DATA1: Data = Data::A(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters