XML editor stops highlighting syntax errors when you move cursor to a correct line
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 15
### What happened
The XML editor stops highlighting syntax errors when you move the cursor to a line that is correct (well-formed).
This may cause that important syntax errors go unnoticed until you run the application. It may seem improbable to overlook errors like that, but when you're quickly editing files with most lines well-formed, it's not (indeed it has happened to me a few days ago).
### How to reproduce
It's very easy to reproduce. Simply write this code:
```xml
```
Here, the tag `` is unclosed. If you put the cursor in that line, the error is highlighted:

However, if you move the cursor to a well-formed line, the editor stops highlighting it:

### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Debian GNU/Linux 11.5 (Bullseye)
### JDK
OpenJDK Runtime Environment (build 17.0.4+8-Debian-1deb11u1)
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
I've tested this in versions 13, 14 and 15 and they all are affected.
### Are you willing to submit a pull request?
No
### Code of Conduct
Yes
Contributor guide
Research direction
Start by reproducing the behavior in the NetBeans XML editor with the minimal malformed document from the issue, moving the cursor between the unclosed tag and a well-formed line. Trace the editor's syntax-error highlighting entry point and verify that the error remains visible after the cursor moves; done means the supplied reproduction consistently highlights the unclosed tag.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100