-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compiler): error diagnostics v2 (#4416)
The Wing compiler now has the capability to provide more detailed information with each compiler error. I've implemented a few examples in this pull request to demonstrate the feature: Example 1: showing the original symbol definition in "use before defined" errors: <img width="425" alt="Screenshot 2023-10-04 at 6 34 41 PM" src="https://github.com/winglang/wing/assets/5008987/8749876c-9fd2-455e-9af5-93b4679af492"> Example 2: showing the previous definition in "symbol already defined" errors: <img width="403" alt="Screenshot 2023-10-04 at 6 36 01 PM" src="https://github.com/winglang/wing/assets/5008987/4106b141-db79-452d-a517-e279b956fb62"> Example 3: showing the variable definition in "variable is not reassignable" errors: <img width="499" alt="Screenshot 2023-10-04 at 6 31 04 PM" src="https://github.com/winglang/wing/assets/5008987/ea2e2042-6e57-4d4e-b7e0-15bc783edd02"> These errors are also displayed as related information in the LSP with clickable links: <img width="452" alt="Screenshot 2023-10-04 at 6 21 01 PM" src="https://github.com/winglang/wing/assets/5008987/68680896-adc6-4de7-931e-be2589bc9f08"> I haven't tested what happens when the annotations refer to other files, but in theory it should also work... ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
Showing
18 changed files
with
225 additions
and
65 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
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.