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

Add quick fix for sealed class within empty switch expression. #3345

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

rgrunber
Copy link
Contributor

@rgrunber rgrunber commented Dec 17, 2024

@jjohnstn I noticed you did a loooot of good refactoring in the local corrections subprocessor. However I want to properly implement that later, because it's a bit of a manual process. I basically need to go to every copied implementation in the JDT-LS local subprocessor, confirm the base processor in jdt.core.manipulation does things identically (ie. JDT-LS hasn't added any hacks for odd reasons), and if so, delegate to it and reduce duplication. Is it ok if I leave some of those abstract methods unimplemented for now ? We don't currently call them in JDT-LS and it appears they're only called from JDT UI's LocalCorrectionsSubProcessor (which we don't use).

Screencast.from.2024-12-17.17-12-46.mp4

- When a sealed class is the target of an empty switch expression, add
  all the types it permits as case statements
- Add testcase
- Use upstream version of 'addTypeAsPermittedSubTypeProposal'

Signed-off-by: Roland Grunberg <[email protected]>
@rgrunber rgrunber force-pushed the quickfix-sealed-in-switch branch from 25c9dea to 1410490 Compare December 18, 2024 04:48
@rgrunber rgrunber merged commit 0c184be into eclipse-jdtls:master Dec 18, 2024
7 checks passed
@rgrunber rgrunber deleted the quickfix-sealed-in-switch branch December 18, 2024 15:37
@@ -1130,4 +1127,131 @@ public static void addValueForAnnotationProposals(IInvocationContext context, IP
}
}

/* (non-Javadoc)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a todo, I'll probably be implementing all of these in a later PR. It'll be a lot of manual verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant