{"action":"created","issue":{"url":"https://api.github.com/repos/scala-ide/scala-ide-play2/issues/253","labels_url":"https://api.github.com/repos/scala-ide/scala-ide-play2/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/scala-ide/scala-ide-play2/issues/253/comments","events_url":"https://api.github.com/repos/scala-ide/scala-ide-play2/issues/253/events","html_url":"https://github.com/scala-ide/scala-ide-play2/pull/253","id":107679624,"number":253,"title":"twirl library update in play2 plugin","user":{"login":"wpopielarski","id":11613003,"avatar_url":"https://avatars.githubusercontent.com/u/11613003?v=3","gravatar_id":"","url":"https://api.github.com/users/wpopielarski","html_url":"https://github.com/wpopielarski","followers_url":"https://api.github.com/users/wpopielarski/followers","following_url":"https://api.github.com/users/wpopielarski/following{/other_user}","gists_url":"https://api.github.com/users/wpopielarski/gists{/gist_id}","starred_url":"https://api.github.com/users/wpopielarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpopielarski/subscriptions","organizations_url":"https://api.github.com/users/wpopielarski/orgs","repos_url":"https://api.github.com/users/wpopielarski/repos","events_url":"https://api.github.com/users/wpopielarski/events{/privacy}","received_events_url":"https://api.github.com/users/wpopielarski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-09-22T09:51:32Z","updated_at":"2015-09-25T09:11:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala-ide/scala-ide-play2/pulls/253","html_url":"https://github.com/scala-ide/scala-ide-play2/pull/253","diff_url":"https://github.com/scala-ide/scala-ide-play2/pull/253.diff","patch_url":"https://github.com/scala-ide/scala-ide-play2/pull/253.patch"},"body":"Because Play2.4 is using Twirl version 1.1.1 lib to process templates\r\nin contrary to Play2.3 which uses Twirl version 1.0.4 there is a need\r\nto deliver Twirl functionalities as plugins to Scala IDE Play2 Plugin.\r\nSo now it is possible to choose a Play version in Play Plugin preference\r\npage and then correct Twirl delivers appropriate implementation of\r\ntemplate parser and compiler.\r\n\r\nImplementation notes:\r\n - there is one global setting for Play version. So if user wants to\r\n   work on projects of more than one Play version it is recommended to\r\n   do it in different workspaces. The bottleneck is Twirl parser to\r\n   which is quite hard to pass the project settings (in future cosider\r\n   thread local?)\r\n - every Twirl version has its counterpart template plugin. Code is\r\n   duplicated so far and it is result of the lack of abstraction\r\n   for Twirl's main functionalities. Maybe in future we would need\r\n   to improve it.\r\n\r\nUsage notes:\r\n - code generated by `TwirlCompiler.compileVirtual(...)` method is\r\n   different from generated by `TwirlCompiler.compile(...)`. The\r\n   main diff is the use of `Html` in place of `HtmlFormat.Appendable`."},"comment":{"url":"https://api.github.com/repos/scala-ide/scala-ide-play2/issues/comments/143166589","html_url":"https://github.com/scala-ide/scala-ide-play2/pull/253#issuecomment-143166589","issue_url":"https://api.github.com/repos/scala-ide/scala-ide-play2/issues/253","id":143166589,"user":{"login":"sschaef","id":488530,"avatar_url":"https://avatars.githubusercontent.com/u/488530?v=3","gravatar_id":"","url":"https://api.github.com/users/sschaef","html_url":"https://github.com/sschaef","followers_url":"https://api.github.com/users/sschaef/followers","following_url":"https://api.github.com/users/sschaef/following{/other_user}","gists_url":"https://api.github.com/users/sschaef/gists{/gist_id}","starred_url":"https://api.github.com/users/sschaef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschaef/subscriptions","organizations_url":"https://api.github.com/users/sschaef/orgs","repos_url":"https://api.github.com/users/sschaef/repos","events_url":"https://api.github.com/users/sschaef/events{/privacy}","received_events_url":"https://api.github.com/users/sschaef/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T09:11:56Z","updated_at":"2015-09-25T09:11:56Z","body":"I got the following exception when I tried to open a `*.scala.html` file:\r\n```\r\njava.util.NoSuchElementException: None.get\r\n\tat scala.None$.get(Option.scala:347)\r\n\tat scala.None$.get(Option.scala:345)\r\n\tat org.scalaide.play2.templateeditor.processing.TemplateProcessingProvider$.templateProcessing(TemplateProcessingProvider.scala:22)\r\n\tat org.scalaide.play2.templateeditor.lexical.TemplateParsing$.handleTemplateCode(TemplateParsing.scala:34)\r\n\tat org.scalaide.play2.templateeditor.lexical.TemplatePartitionTokeniser.getScalaCommentAndPlainRegions(TemplatePartitionTokeniser.scala:29)\r\n\tat org.scalaide.play2.templateeditor.lexical.TemplatePartitionTokeniser.tokenise(TemplatePartitionTokeniser.scala:71)\r\n\tat org.scalaide.play2.templateeditor.sse.lexical.TemplateTextRegionsComputer.tokens$lzycompute(TemplateRegionParser.scala:97)\r\n\tat org.scalaide.play2.templateeditor.sse.lexical.TemplateTextRegionsComputer.tokens(TemplateRegionParser.scala:95)\r\n\tat org.scalaide.play2.templateeditor.sse.lexical.TemplateTextRegionsComputer.<init>(TemplateRegionParser.scala:127)\r\n\tat org.scalaide.play2.templateeditor.sse.lexical.TemplateRegionParser.reset(TemplateRegionParser.scala:83)\r\n\tat org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.resetParser(BasicStructuredDocument.java:2433)\r\n\tat org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser._core_reparse_text(StructuredDocumentReParser.java:354)\r\n\tat org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.core_reparse(StructuredDocumentReParser.java:752)\r\n\tat org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.reparse(StructuredDocumentReParser.java:1401)\r\n\tat org.eclipse.wst.sse.core.internal.text.StructuredDocumentReParser.reparse(StructuredDocumentReParser.java:1333)\r\n\tat org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.updateModel(BasicStructuredDocument.java:2713)\r\n\tat org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalReplaceText(BasicStructuredDocument.java:1923)\r\n\tat org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText(BasicStructuredDocument.java:2423)\r\n\tat org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.set(BasicStructuredDocument.java:2935)\r\n\tat org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.setDocumentContent(ResourceTextFileBuffer.java:580)\r\n\tat org.eclipse.core.internal.filebuffers.ResourceTextFileBuffer.initializeFileBufferContent(ResourceTextFileBuffer.java:288)\r\n\tat org.eclipse.core.internal.filebuffers.ResourceFileBuffer.create(ResourceFileBuffer.java:247)\r\n\tat org.eclipse.core.internal.filebuffers.TextFileBufferManager.connect(TextFileBufferManager.java:112)\r\n\tat org.eclipse.ui.editors.text.TextFileDocumentProvider.createFileInfo(TextFileDocumentProvider.java:559)\r\n\tat org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:478)\r\n\tat org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4233)\r\n\tat org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:237)\r\n\tat org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1480)\r\n\tat org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:169)\r\n\tat org.eclipse.wst.sse.ui.StructuredTextEditor.doSetInput(StructuredTextEditor.java:1943)\r\n\tat org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3220)\r\n\tat org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)\r\n\tat org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)\r\n\tat org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:2157)\r\n\tat org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)\r\n\tat org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2153)\r\n\tat org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3238)\r\n\tat org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3265)\r\n\tat org.eclipse.wst.sse.ui.StructuredTextEditor.init(StructuredTextEditor.java:2620)\r\n\tat org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:390)\r\n\tat org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:305)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)\r\n\tat org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)\r\n\tat org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)\r\n\tat org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)\r\n\tat org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)\r\n\tat org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)\r\n\tat org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)\r\n\tat org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)\r\n\tat org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)\r\n\tat org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)\r\n\tat org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)\r\n\tat org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:715)\r\n\tat org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:95)\r\n\tat org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)\r\n\tat org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)\r\n\tat org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)\r\n\tat org.eclipse.swt.widgets.Display.syncExec(Display.java:4590)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)\r\n\tat org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)\r\n\tat org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)\r\n\tat org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)\r\n\tat org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)\r\n\tat org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)\r\n\tat org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)\r\n\tat org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)\r\n\tat org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)\r\n\tat org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)\r\n\tat org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)\r\n\tat org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)\r\n\tat org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)\r\n\tat org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)\r\n\tat org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:488)\r\n\tat org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:454)\r\n\tat org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:705)\r\n\tat org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:392)\r\n\tat org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1145)\r\n\tat org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3210)\r\n\tat org.eclipse.ui.internal.WorkbenchPage.access$23(WorkbenchPage.java:3125)\r\n\tat org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:3107)\r\n\tat org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)\r\n\tat org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3102)\r\n\tat org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3066)\r\n\tat org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3056)\r\n\tat org.eclipse.ui.ide.IDE.openEditor(IDE.java:541)\r\n\tat org.eclipse.ui.ide.IDE.openEditor(IDE.java:500)\r\n\tat org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:360)\r\n\tat org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:167)\r\n\tat org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:268)\r\n\tat org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:233)\r\n\tat org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)\r\n\tat org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)\r\n\tat org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)\r\n\tat org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)\r\n\tat org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)\r\n\tat org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:853)\r\n\tat org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)\r\n\tat org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)\r\n\tat org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:178)\r\n\tat org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:850)\r\n\tat org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1142)\r\n\tat org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1249)\r\n\tat org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:278)\r\n\tat org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:272)\r\n\tat org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:313)\r\n\tat org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)\r\n\tat org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)\r\n\tat org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)\r\n\tat org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)\r\n\tat org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)\r\n\tat org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)\r\n\tat org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)\r\n\tat org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)\r\n\tat org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)\r\n\tat org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)\r\n\tat org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)\r\n\tat org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)\r\n\tat org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)\r\n\tat org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)\r\n\tat org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)\r\n\tat org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)\r\n\tat org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)\r\n\tat org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:497)\r\n\tat org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)\r\n\tat org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)\r\n\tat org.eclipse.equinox.launcher.Main.run(Main.java:1465)\r\n\tat org.eclipse.equinox.launcher.Main.main(Main.java:1438)\r\n```"}}