Skip to content

fix: XML syntax annotations land on the error line - #6006

Open
Yahiro025 wants to merge 2 commits into
ajaxorg:masterfrom
Yahiro025:cursor/fix-xml-error-annotation-line-3479-6e21
Open

fix: XML syntax annotations land on the error line#6006
Yahiro025 wants to merge 2 commits into
ajaxorg:masterfrom
Yahiro025:cursor/fix-xml-error-annotation-line-3479-6e21

Conversation

@Yahiro025

@Yahiro025 Yahiro025 commented Sep 9, 2026

Copy link
Copy Markdown

Issue #, if available: Fixes #3479

Description of changes:

XML mode gutter errors/warnings were shown on the wrong line, especially with multi-line tags and blank lines.

Cause:

  • SAX linePattern used .+, so blank lines were not counted.
  • The locator is 1-based and was passed to Ace as row without converting to 0-based.
  • Attribute warnings were reported with the locator still at the opening <.

Fix: Restore the in-tree XML worker (same approach as coffee/xquery workers) and:

  1. Match blank lines in the SAX locator (.* instead of .+).
  2. Convert locator.lineNumber to Ace 0-based row.
  3. Update the locator while scanning a start tag, and before end-tag errors.
  4. Point kitchen-sink at the local worker; keep worker-xml from being overwritten when copying ace-legacy-linters into the build.

Tests in src/mode/xml_worker_test.js cover the kitchen-sink GIF cases and blank-line/multi-line cases.

Note: aware that built-in linters may move toward ace-linters long-term; this keeps the in-tree worker correct while it remains used.

Drafted with Cursor (Grok); reviewed before opening.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

  • No backwards incompatible changes were made to Ace's public interface which is defined through the main typings file (ace.d.ts) and its references.

Open kitchen-sink @ b6a756acc90b4a59b82b523bf4b53bb0123c5a87

cursoragent and others added 2 commits September 9, 2026 11:07
Restore the built-in XML worker and fix SAX locator mapping so gutter
warnings/errors land on the line that contains the syntax problem,
including multi-line tags and blank lines.

Fixes ajaxorg#3479

Co-authored-by: Bennett Payoyo <Yahiro025@users.noreply.github.com>
Add locator assertions for the reporter’s query-tag (actual-single.gif)
and later place-tag (actual.gif) extra-character-after-attribute cases.

Co-authored-by: Bennett Payoyo <Yahiro025@users.noreply.github.com>
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.

XML Syntax Error Indication on a Wrong Line

2 participants