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.
Implement a runnables custom method and collect typed tokens (FuelLab…
…s#2441) This PR enables the language server to collect and use typed tokens. As a result, go to definition works for tokens that have an associated type definition (roughly 50% of tokens). This also allows us to get the main_function for script and predicate files, allowing us to send the code position on the main fn back to the client. Code lens is implemented on the client side for now which allows us to have a play button show up above the main fn to execute forc run. Currently, we are only able to use the typed tokens, and send information about the main fn location if the program is able to successfully compile. This should be fixed once FuelLabs#1674 is addressed.
- Loading branch information
1 parent
541adf2
commit c39bd36
Showing
7 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ pub mod formatting; | |
pub mod highlight; | ||
pub mod hover; | ||
pub mod rename; | ||
pub mod runnable; | ||
pub mod semantic_tokens; |
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 @@ | ||
#[derive(Debug, Eq, PartialEq, Hash)] | ||
pub enum RunnableType { | ||
/// This is the main_fn entry point for the predicate or script. | ||
MainFn, | ||
/// Place holder for when we have in language testing supported. | ||
/// The field holds the index of the test to run. | ||
_TestFn(u8), | ||
} |
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