Skip to content
Mirco Dotta edited this page May 13, 2013 · 14 revisions

Route files are responsible of translating HTTP request into Action.

Below follows the set of features that are currently supported for Route files.

Syntax Highlighting

Syntax Highlighting for

  • HTTP method
  • URI static part
  • URI dynamic part
  • Action package part
  • Action class part
  • Action method name part
  • Action method arguments part
  • Comments

Route Syntax Highlighting Preview

Also it has preference page for syntax coloring.

Route Preference Page for Syntax Coloring Preview

Auto Formatting

You can use CTRL+SHIFT+F (COMMAND+SHIFT+F on Mac OSX) to format your route file.

Route Formatter Preview

You can modify the spaces between columns in the corresponding preference page.

Route Preference Page for Formatter Preview

Hyperlinking

Using Ctrl/Cmd+Click, the hyperlink support allows to open the declaration of action methods. It will be directed to the appropriate controller method, by matching the argument types.

Route Hyperlinking Preview

Hyperlinking to Scala methods is available in the nightly builds, and will be part of 0.2.0.

Completion

Each section of a route entry has appropriate completion proposals. Just hit Ctrl-Space or CMD-Space to trigger completion.

HTTP Methods completion

Route HTTP completion

URI completion

Route URI completion

Controller's methods completion

Route Action completion

Note that the controller method completion only shows methods that return Action or Result, to minimize the noise.

Quick Assist to "add route entry"

This feature allows to quickly add a route entry to an existing controller method, either in Java or Scala. To trigger the quick assist, press Ctrl-1 (or CMD-1 on Mac OS) while the caret is on a method definition. If the method definition returns an Action (or Result for Java), you should see a menu offering to add an entry to any route file in the project.

Route Quick assist

After choosing the routes file, the editor is put in a special linked mode that allows easy TAB-navigation between the different sections of a route entry. Each entry is populated with a sensible default.

Route Quick assist

Clone this wiki locally