Home > PlayIdeaLauncher

PlayIdeaLauncher

PlayIdeaLauncher is a project mainly written in ..., based on the MIT license.

An applescript that adds an idea:// protocol to OSX that can be used with the play.editor property in Play! Framework

"Open file from errors pages" launcher for IntelliJ

In your Play! application's application.conf file you'll find this section of commented out code

# Open file from errors pages 
# ~~~~~ 
# If your text editor supports opening files by URL, Play! will 
# dynamically link error pages to files 
# 
# Example, for textmate: 
# play.editor=txmt://open?url=file://%s&line=%s

Wouldn't it be cool to be able to replace txmt:// with idea://?

This little applescript does just that by adding a custom idea:// protocol that launches the script when called by Play!. The script is fed the file path and the line number from the error page and passes this on to IntelliJ's internal xml-rpc based file opener server.

Prerequsites

You need to have xmlrpc located in /usr/local/bin/xmlrpc

If you install it with brew install xmlrpc-c this location is the default. If your xmlrpc executable is located elsewhere you have to alter the path inside PlayIdeaLauncher using the AppleScript Editor.

Installation

  1. Download the application
  2. Place it on your path and chmod it to be executable.

I like to place it in ~/bin, but it can go anywhere on the $PATH.

Usage

The next step is to uncomment and alter the play.editor property in your Play! application and replace txmt with idea

Then that portion of the application.conf file should look like this

# Open file from errors pages 
# ~~~~~ 
# If your text editor supports opening files by URL, Play! will 
# dynamically link error pages to files 
# 

play.editor=idea://open?url=file://%s&line=%s

If you now click on a line in a Play! error page, IntelliJ will open on that line in the file containing the error.

Enjoy!

Previous:TestRepository