apache / apache/netbeans

XML editor stops highlighting syntax errors when you move cursor to a correct line

Open
#4,908 2 comments 0 reactions 0 assignees View on GitHub
kind:bug needs:triage XML
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:

![error-highlighted](https://user-images.githubusercontent.com/2098654/199734631-9b918e2b-a8f3-46f6-83c5-d875a3793cef.png)

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

![error-not-highlighted](https://user-images.githubusercontent.com/2098654/199734671-997c44bb-98ef-4f67-9ad9-ed3f20e3e4cd.png)

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.