apache / apache/netbeans

Incorrect auto-indent on Groovy files

Open
#4,557 0 comments 0 reactions 0 assignees View on GitHub
Groovy kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 15 release candidate

### What happened

The auto-indent feature of NetBeans operates incorrectly for Groovy source files.

### How to reproduce

This is a Groovy file. In both examples below, when your cursor is at position "E" and you hit the return key, the cursor should be moved to the position marked as "C". NetBeans puts the cursor in position "I" instead. This formatting bug does not exist in Java.

```
static void meth() {
if (cond)E
I C
}

static void meth2() {
if (cond)
abcdE
C I
}

```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Fedora Linux

### JDK

17

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

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

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the NetBeans Groovy editor using the two examples in the report, then compare the behavior with Java indentation. Done means pressing Return at each marked E places the cursor at C rather than I in both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.