-
Notifications
You must be signed in to change notification settings - Fork 32
Route Editor
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
- Completion Proposals
- Hyperlinking
- Quick Assist to "add route entry"
- Syntax Highlighting
- URI Refactoring
You can use CTRL+SHIFT+F
(COMMAND+SHIFT+F
on Mac OSX) to format your route file.
You can modify the spaces between columns in the corresponding preference page.
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).
Note that the controller method completion only shows methods that return Action
or Result
, to minimize the noise.
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.
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.
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.
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
Also it has preference page for syntax coloring.
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.