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.
Improve ContractCaller type labels in CompileErrors and LSP features (F…
…uelLabs#4361) ## Description Closes FuelLabs#4314 This PR does the following: 1. Move impl of `DisplayWithEngines` to `DebugWithEngines`, since the output of these impls is really debug output. 2. Add impls for `DisplayWithEngines` to TypeInfo, TypeArgument and others, which the LSP uses for features like inlay hints and autocomplete. 3. Remove `display_name` in favor of `DisplayWithEngines::fmt` 4. Fixes the display label for `ContractCaller` in hover and inlay hints. 5. Changes aliases to display only the alias name, rather than the string `type {alias name} = {other name}`, similar to Rust. 6. Many of the Compile Errors that display a type now use the new `DisplayWithEngines::fmt`, which is slightly more user-friendly than before. This makes it so the types shown in the errors are the same as what the user sees in the inlay hints and hover docs. For this reason, I updated a few of the e2e vm tests where necessary. Going forward, the output of `DisplayWithEngines::fmt` should always be the user-friendly name of the type that will be shown in the editor. Here's an example of the difference: before <img width="806" alt="image" src="https://user-images.githubusercontent.com/47993817/228378865-8ec62a9c-4564-4cc6-b2fd-ed680bfb108a.png"> after <img width="872" alt="image" src="https://user-images.githubusercontent.com/47993817/228378207-94993f77-ca01-414d-84ca-d800efaa73a6.png"> ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] I have added tests that prove my fix is effective or that my feature works. (existing tests pass) - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Joshua Batty <[email protected]>
- Loading branch information
1 parent
8ad8fd5
commit c16c850
Showing
19 changed files
with
244 additions
and
62 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
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
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
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
Oops, something went wrong.