apache / apache/netbeans

Allow to check and/or validate XML files on save

Open
#4,909 0 comments 0 reactions 0 assignees View on GitHub
Contribution welcome Editor kind:feature XML
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

NetBeans allows to perform certain actions when a file is saved. For example, reformatting it or removing tailing white-spaces:

![image](https://user-images.githubusercontent.com/2098654/199737660-d110ee8e-1a7b-4203-bbfa-4e358bd7f66e.png)

In the specific case of XML files, I think it would be really useful to automatically check that the file is well-formed. If we could also enable/disable the validation separately, it would be even better.

### Use case/motivation

Checking/validating XML files manually, after every edition, is repetitive and distracting. So much, that sometimes you forget to make that checks and some errors go unnoticed.

### Related issues

This feature request is inspired by the issue #4908, in which syntax errors are not being highlighted anymore when you move the cursor to a well-formed line.

If we had a feature like the one described here, I guess the impact of an issue like that would be very low, because the errors would be shown in the _Output_ panel after saving the file.

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start by reviewing NetBeans' existing actions that run on save and the XML editor behavior described in issue #4908. Determine how XML well-formedness checking and optional validation should be configured, then verify that save-time errors appear in the Output panel without blocking unrelated save actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.