Skip to content

fix: include embedded script and style errors in getAnnotations - #6015

Merged
knolleary merged 1 commit into
mainfrom
fix/monaco-embedded-annotations
Oct 20, 2026
Merged

knolleary merged 1 commit into
mainfrom
fix/monaco-embedded-annotations

Conversation

@Steve-Mcl

Copy link
Copy Markdown
Contributor

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Follow-up to #5994.

Errors in <script> and <style> blocks are copied onto the HTML model under embedded-javascript and embedded-css marker owners. getAnnotations() only returned markers owned by the model's own language, so any node that checks the editor for errors on save never saw them. A broken script or style block in an HTML editor didn't mark the node as invalid.

getAnnotations() now also returns the embedded-* markers for the same model.

Tested in the editor with a Dashboard ui-template (in PR 2291) - an error in <script> or <style> now marks the node as invalid on save, and fixing it clears the error.
The Function node still reports its own errors as before.

NOTE:
A potential follow up is whether we want this behaviour on the template node. Currently the core template node doesn't have a noerr property, so editor errors never mark it as invalid, with or without this fix. Whether it should is a separate decision (if at all), since mustache tags in non-HTML formats like JSON would show as errors and could flag working flows.

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

Errors in <script> and <style> blocks are copied onto the HTML model with
"embedded-*" marker owners, but getAnnotations only returned markers owned
by the model's own language. Nodes that check the editor for errors before
saving never saw them, so a broken script or style block didn't mark the
node invalid.
@Steve-Mcl
Steve-Mcl requested a review from knolleary October 17, 2026 09:24
@knolleary
knolleary merged commit 9e6089e into main Oct 20, 2026
3 checks passed
@knolleary
knolleary deleted the fix/monaco-embedded-annotations branch October 20, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants