fix(parse/html): fix disabled vue error message#9879
Conversation
🦋 Changeset detectedLatest commit: 55184f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis change updates the HTML parser's Vue-related diagnostic messages to be accurate. The original error message referenced a non-existent 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
crates/biome_html_parser/src/syntax/parse_error.rs (1)
113-114: Please remove the stale TODO + commented-out diagnostic.Keeping this commented block around is now confusing, since this fix explicitly avoids pointing users at that option.
♻️ Proposed tidy-up
pub(crate) fn disabled_vue(p: &HtmlParser, range: TextRange) -> ParseDiagnostic { - // TODO: uncomment when the parser option is implemented - // p.err_builder("Vue syntax isn't enabled. Is this supposed to be a .vue file?", range).with_hint(markup!("Remove it or enable the parsing using the "<Emphasis>"html.parser.vue"</Emphasis>" option.")) p.err_builder("Vue syntax isn't enabled. Is this supposed to be a .vue file? HTML-as-Vue is not yet supported.", range).with_hint(markup!("Remove it or rename this file to have the "<Emphasis>".vue"</Emphasis>" file extension.")) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_html_parser/src/syntax/parse_error.rs` around lines 113 - 114, Remove the stale TODO and the commented-out diagnostic lines that reference p.err_builder(...).with_hint(markup!(...)) (including the Emphasis and the literal "html.parser.vue") from parse_error.rs so the code no longer contains the confusing commented block; simply delete the two commented lines and the TODO comment so the file contains no leftover reference to the old Vue-syntax hint.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/funny-geese-refuse.md:
- Line 5: Replace the current sentence on line 5 so it follows changeset policy:
start with "Fixed [`#ISSUE_NUMBER`](issue link):", remove the forward-looking
"2.5" claim, correct "non-existant" to "non-existent", and avoid
developer-facing details by describing the user-facing fix (e.g., "Fixed
[`#NNN`](link): error message referenced non-existent `html.parser.vue` option
when Vue syntax was disabled"). Ensure the sentence uses the required issue-link
format and is written for end users.
In `@crates/biome_html_parser/src/syntax/parse_error.rs`:
- Around line 112-116: The user-facing diagnostic string in disabled_vue
(function disabled_vue) was changed but no test snapshots were updated; add or
update parser snapshot tests that exercise the Vue-disabled diagnostic so they
lock the new message and hint ("Vue syntax isn't enabled. Is this supposed to be
a .vue file? HTML-as-Vue is not yet supported." and the hint about renaming to
".vue"), e.g. add a parser fixture that triggers disabled_vue and refresh the
corresponding snapshot file(s) used by the parser tests (the parser error
fixtures / snapshots for HTML/Vue cases) so CI captures the updated diagnostic
text and hint; ensure the test asserts the full diagnostic message and hint
exactly as emitted by disabled_vue.
---
Nitpick comments:
In `@crates/biome_html_parser/src/syntax/parse_error.rs`:
- Around line 113-114: Remove the stale TODO and the commented-out diagnostic
lines that reference p.err_builder(...).with_hint(markup!(...)) (including the
Emphasis and the literal "html.parser.vue") from parse_error.rs so the code no
longer contains the confusing commented block; simply delete the two commented
lines and the TODO comment so the file contains no leftover reference to the old
Vue-syntax hint.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6b999cd1-cd37-4416-b8a1-76f4173b30de
⛔ Files ignored due to path filters (4)
crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/upper-case-2.html.snapis excluded by!**/*.snapand included by**crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/upper-case-html-tag-2.html.snapis excluded by!**/*.snapand included by**crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/upper-case-html-tag-4.html.snapis excluded by!**/*.snapand included by**crates/biome_html_formatter/tests/specs/prettier/vue/vue/template-dom.html.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (2)
.changeset/funny-geese-refuse.mdcrates/biome_html_parser/src/syntax/parse_error.rs
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Tweaked the vue disabled error message to no longer reference a parser option that is not exposed publicly.
related to #8415
Test Plan
snapshots
Docs