Open Nightenom opened 2 years ago
Also another thing which seems heavily related, might be even the same bug.
Working states: Targeting method: Targeting whole statement using text selection: Targeting the "new" keyword:
Broken state: Targeting the the class name:
@CsCherrYY You can test it with File f = new File(new String());
, and try to peek code actions when the cursor is in new
or in String
This is still an issue after 2 yrs
I think the issue is with the ExtractTempRefactoring
API in JDT. It relies on the selection being an expression and it seems to fail to retrieve it under certain circumstances : https://github.com/eclipse-jdt/eclipse.jdt.ui/blob/b83ffe1bbcad393d4e35874d1ecc6af59f90874f/org.eclipse.jdt.core.manipulation/refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java#L1058-L1063 .
FATALERROR: An expression must be selected to activate this refactoring.
Context: <Unspecified context>
code: none
Data: null
Given a short (static/nonstatic, probably visibility independent) method with just return statement and ctor call there are no quick actions available. Log is empty - no stacktraces nor errors. High reproducibility (will try to provide 100% repro case if this is not enough)
Current Result
Only lower method has quick actions.
Expected Result
Both methods have quick actions.
Environment