New file templates?

After upgrading today I now have some file templates that seem quite bogus:

Scala Class:

package ${PACKAGE_NAME};
public scala class ${NAME} { }



Scala Trait:

package ${PACKAGE_NAME};
public scala trait ${NAME} { }



Scala Object:

package ${PACKAGE_NAME};
public scala object ${NAME} { }



Clearly these will never compile. And these templates seem to be built in -- I cannot delete them.
0
Avatar
Permanently deleted user

Yeah I just noticed them, too. Whats up with these?

0

This is IDEA bug. I moved file templates from J2EE (Scala is not J2EE... :)) to just templates. But IDEA bug needs you to do next steps, possibly this will be fixed in next EAPs, but I'm not sure:
1. Remove all files which has "Scala" in name from folder: .IntelliJIdea10/config/fileTemplates
2. Invalidate caches in IDEA's file menu.

I hope this steps will be only for nightly builds, and with next EAP this will be fixed.

Best regards,
Alexander Podkhlayuzin.

0
Avatar
Permanently deleted user

Now that I've updated to the EAP I can no longer create new scala files.

2011-01-19 22:52:30,520 [3881620]  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(902,243),absolute(894,235),button=1,modifiers=Button1,clickCount=1] on frame0
java.lang.IllegalArgumentException: Argument 0 for @NotNull parameter of com/intellij/ide/fileTemplates/JavaTemplateUtil.setPackageNameAttribute must not be null

...

Do I need the templates back again?

0

Now there are two new scala class buttons in the menu. You should choose the first one right after new Java class. Other buttons doesn't work (there shouldn't be these buttons). This is a bug. Do not use them.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

I only seem to have those "other" buttons that dont' work:

ScreenHunter_01 Jan. 20 09.13.gif

So I'm just creating files with .scala extension for now and filling in the empty buffer.

0
Avatar
Permanently deleted user

Hmm, the menu from the breadcrumbs is different:

ScreenHunter_02 Jan. 20 09.34.gif

0

It seems it's IDEA's focus/action system bug.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

It all seems to be working now (latest eap, latest plugin)

0

i fixed the broken templates by deleting them, but i still have duplicate entries in the context menue. the good ones (top) and bad ones (a bit lower). using both newest nightly/eap of plugin/idea

0

Have you invalidated the IDEA's caches?

0

I have removed the files, and invalidated caches, but the entries are still there (#103.59 / #0.4.534).

0

Entries duplication if fixed now.

0

Correction - I still see the entries when using the latest nighly build (#0.4.542).
Was the fix perhaps integrated in a later build, or is this still broken?

0

We have two copies of plugin.xml file now, and I previously forgot to update one of them.

You may add <createFromTemplateHandler implementation="org.jetbrains.plugins.scala.ScalaCreateFromTemplateHandler"/> element to extensions or just wait for the next build.

0

Hi Pavel,

I can confirm that this is (finally) fixed for me using the plugin nightly build #0.4.550.
Perhaps the plugin could automatically remove such obsolete file templates? Not all users will take the effort to go to these forums to find out how to do this.

Thanks,
Taras

0

Since 0.4.589 version (released) Scala plugin suggests to perform required actions automatically:

screenshot1.png

0

请先登录再写评论。