Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't offer extract to constant unless expression is final and static #1182

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

jjohnstn
Copy link
Contributor

@jjohnstn jjohnstn commented Feb 9, 2024

What it does

Suppresses extract to constant quick assist proposals unless the selected expression is all static and final.

How to test

See original issue or new tests.

Author checklist

- fixes eclipse-jdt#1180
- add new logic to QuickAssistProcessor.getExtractVariableProposal()
- add new tests to AssistQuickFixTest
@jjohnstn jjohnstn self-assigned this Feb 9, 2024
@jjohnstn jjohnstn added the bug Something isn't working label Feb 9, 2024
@jjohnstn jjohnstn added this to the 4.31 M3 milestone Feb 9, 2024
@jjohnstn jjohnstn merged commit dc8daea into eclipse-jdt:master Feb 9, 2024
4 of 7 checks passed
@jjohnstn jjohnstn deleted the constanterror branch February 9, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Extract to constant" quick assist should not be offered for non-constants
1 participant