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

"Correct Indentation" results in ClassCastException in log #231

Closed
davidmichaelkarr opened this issue Nov 17, 2016 · 2 comments
Closed

"Correct Indentation" results in ClassCastException in log #231

davidmichaelkarr opened this issue Nov 17, 2016 · 2 comments

Comments

@davidmichaelkarr
Copy link

Using Neon.1a & 2.9.2.xx-201611160028-e46.

I associated "Jenkinsfile" with the groovy editor. When I select the entire file and press Ctrl+i, nothing happens, but I see this in the log:

Caused by: java.lang.ClassCastException: org.eclipse.jdt.internal.core.CompilationUnit cannot be cast to org.codehaus.jdt.groovy.model.GroovyCompilationUnit
at org.codehaus.groovy.eclipse.refactoring.actions.FormatGroovyAction.run(FormatGroovyAction.java:70)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:249)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:118)
... 55 more

@eric-milles
Copy link
Member

Ugh, looks like the file did not get considered as groovy by the compiler. Can you send your steps for mapping a file type to the groovy editor so I can take a look at it?

@davidmichaelkarr
Copy link
Author

I went into Preferences, then "File Associations", underneath "General"->"Editors". I clicked "Add", entered "Jenkinsfile" for the entire file type", then selected "Groovy Editor" for the associated editor.

In the editor view, the tab icon has a lowercase "g" icon, and in the code area, I see keywords and some values in violet/purple. The right-click context menu has a "Groovy refactor" submenu.

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

No branches or pull requests

2 participants