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.
…#4057) ## Description This PR adds tests for go_to and hover functionality for `TyStructDeclaration` and `TyEnumDeclaration` tokens. works towards FuelLabs#3989
- Loading branch information
1 parent
3f3fe47
commit 1d31ff6
Showing
9 changed files
with
251 additions
and
12 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
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 = "enums" | ||
|
||
[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,27 @@ | ||
contract; | ||
|
||
/// Test Struct Docs | ||
struct TestStruct { | ||
foo: u8, | ||
} | ||
|
||
/// Color enum with RGB variants | ||
enum Color { | ||
Red: (), | ||
Green: (), | ||
Blue: (), | ||
} | ||
|
||
/// My Enum documentation | ||
pub enum MyEnum { | ||
First: TestStruct, | ||
Second: Color, | ||
Third: (u8, Color), | ||
/// Docs for variants | ||
Fourth: u8, | ||
} | ||
|
||
fn func() { | ||
let x = Color::Red; | ||
let y: MyEnum = MyEnum::Fourth(8); | ||
} |
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 = "structs" | ||
|
||
[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,28 @@ | ||
contract; | ||
|
||
/// My data enum | ||
enum Data { | ||
First: (), | ||
Second: (), | ||
} | ||
|
||
/// My struct type | ||
struct MyStruct<T, U> { | ||
g: U, | ||
x: T, | ||
y: Data, | ||
z: (u64, Data), | ||
t: [Data; 5], | ||
j: (u32, (Data, [Data; 2])), | ||
o: Option<Identity>, | ||
} | ||
|
||
struct Simple { | ||
x: u8, | ||
} | ||
|
||
fn func() { | ||
let x = Simple { | ||
x: 7 | ||
}; | ||
} |
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