New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve Schema Error Diplay with Glyphs #562
Merged
Merged
Conversation
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
…and must be installed separately
…module next/babel
…custom babel config being present.
darunrs
approved these changes
Feb 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Copy over the description from the previous PR, and do a squash and merge.
Name the PR something like: |
Kevin101Zhang
changed the title
Parsing ddl error 2
feat: Improve Schema Error Diplay with Glyphs
Feb 16, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Accidentally overwrote some changes here - #555.
Checkout a branch a resolved the latest changes for removing glyphsuccess color from green to transparent and removing trycatch.
Glyphs margins to showcase a better error message to the user. The Glyph is either red or green. Green indicating it has not caught an errors and red indicating it has found an error. When an error is found it will come with a hoverable error message as well as the line it was caught on.
Procedure:
Onload of the schema page the glyphs will mount and check if there is an error based off the users previously written schema or their locally stored code.
If the user has an error: It will highlight the line the error was caught on with a red glyph and a hoverable message.
If the user does not have an error it will remain on line 1 with a green glyph. Onhover it will tell the user there are no errors.
If the user navigates away from the schema tab with an error it will prompt the user with a Alert that there was an error and to please return back to the schema tab and correct the schema.
The Glyph functionality with run on a debounced event of 500ms based off the users onChange typing activity on the schema page. When triggered it will prettify the users schema and will attempt to generate types in a try/catch. If it hits the error then it will relay the line number the error was caught on and the err message which the glyph will represent.
The Glyph only takes place on schema.sql as for indexLogic we have monaco's support for intellisense/catching errors in the JS env.
In the case in the video where the glyph is on line one and hovering over the glyph showcases an error message with a line number - this is when prettier is throwing an error and can be added through string matching to correctly display the glyph location
https://www.loom.com/share/78d0c6435115470597b9e8448976fda4?sid=fba10322-2ded-4b14-8178-8a5b51143148