Skip to content

Conversation

@marklundin
Copy link
Contributor

@marklundin marklundin commented Aug 6, 2025

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.

image

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

…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.
@marklundin marklundin requested review from Copilot and slimbuck August 7, 2025 08:14
Copy link
Contributor

Copilot AI left a 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-parser from 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.
@marklundin marklundin requested a review from mvaligursky August 7, 2025 08:28
@marklundin marklundin merged commit f82c3f8 into main Aug 7, 2025
3 checks passed
@marklundin marklundin deleted the feat-code-editor-parsing branch August 7, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants