-
Notifications
You must be signed in to change notification settings - Fork 135
Improved Error in Code Editor #1368
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
Conversation
…rkers in the Monaco editor. Added a new Fix type and updated the error serialization process in the ESM script worker to include fix information for parsing errors.
…ecific tags. Changed references from `range` and `precision` to `@range` and `@precision` for improved accuracy in warning classification.
…references for clarity and added cleanup listeners for model disposal to manage markers and dirty flags effectively.
…links for 'Invalid Type' errors. Introduced a constant for PlayCanvas attribute documentation URL to improve user guidance on attribute types.
…ion link assignment for 'Invalid Type' errors. Updated the constant for PlayCanvas attribute documentation URL and improved code readability.
…version 1.10.0 and adjust package.json accordingly. Remove outdated version from devDependencies.
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.
Pull Request Overview
This PR enhances the Code Editor's error handling for ESM attributes by providing more detailed error information with quick fixes. It upgrades the attribute parser dependency and transforms basic parsing errors into rich, actionable feedback with precise line/column positioning and suggested corrections.
- Enhanced error serialization with detailed location information and severity levels
- Added quick fix functionality for attribute errors with Monaco editor integration
- Upgraded
@playcanvas/attribute-parserfrom v1.9.0 to v1.10.0
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/workers/esm-script.worker.ts | Added error serialization logic to convert parsing errors into detailed diagnostic information |
| src/code-editor/monaco/intellisense/attribute-autofill.ts | Integrated quick fix actions and improved error marker handling with memory cleanup |
| package.json | Moved attribute-parser from devDependencies to dependencies and upgraded to v1.10.0 |
…ility. Updated the matching criteria to use position instead of message for better accuracy in identifying errors.
This PR significantly improves the DX when working with ESM attributes in the Code Editor. Now when attributes errors are generated, precise and contextual information is presented with a suggested editor "Quick Fix" that will fix the issue where applicable.
This update depends on the additional data generated by playcanvas/attribute-parser#53 and should not be merge until the attribute-parser PR has been merged and published.
This PR relates to playcanvas/attribute-parser#53 but focuses solely on the code editor