Repository navigation
fix: include embedded script and style errors in getAnnotations - #6015
Merged
Merged
Conversation
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.
This file contains hidden or 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
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.
Types of changes
Proposed changes
Follow-up to #5994.
Errors in
<script>and<style>blocks are copied onto the HTML model underembedded-javascriptandembedded-cssmarker 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 theembedded-*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
noerrproperty, 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
npm run testto verify the unit tests pass