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

allow other than scala.html templates #158

Open
gaydenko opened this issue Jun 26, 2013 · 1 comment
Open

allow other than scala.html templates #158

gaydenko opened this issue Jun 26, 2013 · 1 comment

Comments

@gaydenko
Copy link

On attempt to open scala.txt template I get

java.lang.IllegalArgumentException: Expected to open file with extension scala.html, found some.scala.txt.
    at org.scalaide.editor.CompilationUnitProvider.getFile(CompilationUnitProvider.scala:29)
    at org.scalaide.editor.CompilationUnitProvider.fromEditor(CompilationUnitProvider.scala:19)
    at org.scalaide.play2.templateeditor.TemplateConfiguration.getTextHover(TemplateConfiguration.scala:125)
@vnicolici
Copy link

I have the same issue. Please remove this validation.

My reason for renaming it to .scala.txt is that the template engine doesn't have a mkString equivalent for Html, and using the mkString from String results in undesired escaping of apostrophes.

And no, the Html helper doesn't seem to help when your template text is multi line and contains curly braces, like this:

  @serieArray = {
      @chart.series.map { serie => {
          {
              type: 'area',
              name: '@serie.description',
              pointInterval: @chart.interval * 1000, // seconds
              pointStart: @toJavascript(chart.date),
              data: @serie.values
          }
      } }.mkString(",")
  }

After fighting it for a few hours I switched to txt to be able to use the mkString function without escaping.

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