eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

QuickFix for adding missing annotation attributes should generate SingleMemberAnnotation if applicable

Open
#334 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
22h 47m
Merged PRs (30d)
28

Description

If you have an annotation of the form:

```java
public @interface MyAnnotation {
String value();
}
```

Then you can apply it to java code like this:

```java
@MyAnnotation("my string")
public class MyClass {
}
```

However, if you apply the QuickFix suggested when you have not filled in the required value:

```java
@MyAnnotation
public class MyClass {
}
```

Then it will do this instead:

```java
@MyAnnotation(value = "")
public class MyClass {
}
```

I think it'd be nice if the QuickFix used the compact syntax when it's able to.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.