Skip to content
Luc Bourlier edited this page May 15, 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.

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

Completion Proposals

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

Note that the completion text replaces the characters following the caret position until the end of the word (this working mode is also known as completion overwrites).

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.

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

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

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

URI Refactoring

The route editor supports in-place renaming of sections of URIs.

It is activated by selecting the part of the uri to modify, and using the Refactoring>Rename action in the context menu, or the key shortcut Alt+Shift+R. The refactoring support searches of all the URIs with the equivalent subpath, and allows to update them all at once.

Route Preference Page for Syntax Coloring Preview