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

Fix for pasting snippet with main method to Package Explorer #1416

Merged
merged 1 commit into from
May 22, 2024

Conversation

iloveeclipse
Copy link
Member

After introducing implicit types via
eclipse-jdt/eclipse.jdt.core#2066 the snippet that contains only main() method is recognized as
ImplicitTypeDeclaration that does not inherit AbstractTypeDeclaration but common super class AbstractUnnamedTypeDeclaration.

Make sure we don't fail with CCE and don't generate extra main method that wraps around pasted main method.

Fixes #1414

@iloveeclipse iloveeclipse changed the title Fix for pasting snippet with main method to to Package Explorer Fix for pasting snippet with main method to Package Explorer May 22, 2024
@trancexpress
Copy link
Contributor

Seems to work. Personally I don't miss randomly pasting code into the Package Explorer (its always a mistake when I do this, I forgot to select a package to paste into), but I guess the exception is bad and should be fixed.

After introducing implicit types via
eclipse-jdt/eclipse.jdt.core#2066 the snippet
that contains only main() method is recognized as
ImplicitTypeDeclaration that does not inherit AbstractTypeDeclaration
but common super class AbstractUnnamedTypeDeclaration.

Make sure we don't fail with CCE and don't generate extra main method
that wraps around pasted main method.

Fixes eclipse-jdt#1414
@iloveeclipse iloveeclipse merged commit 5d4cf1f into eclipse-jdt:master May 22, 2024
8 of 9 checks passed
@iloveeclipse iloveeclipse deleted the issue_1414 branch May 22, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pasting snippet to Package Explorer does not work anymore
2 participants