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

Quick fix for variable assignment is "sometimes" dependent on the semicolon

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

Description

I like to use CTRL+ 2, L to create a local assignment. This works in most cases but sometimes I need to add a semicolon to make this fix available.

Example for existing code from org.eclipse.e4.ui.css.swt.dom.ToolItemElement
````

private SelectionListener selectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ToolItemElement.this.isSelected = getToolItem().getSelection();
doApplyStyles();
}
};

````

Now I want to introduce a dispose check.
````
private SelectionListener selectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getToolItem() ---> CURSOR HIER
ToolItemElement.this.isSelected = getToolItem().getSelection();
doApplyStyles();
}
};

````

Ctrl+1 or CTRL+ 2, L does not work until I add a semicolon. In other scenarios this works without a semicolon and the quickfix also adds a semicolon.

@jjohnstn could that changed that is always is avaiable?

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.