Is there any easy way to communicate with IDEA from a separate process? e.g. from another process tell IDEA to open a class at a specific line or something?
As some background, when working on Scala and continuous testing, sbt is really handy...
the main issue is rendering working/failing tests - then on failures navigating to the source code in IDEA.
I raised http://youtrack.jetbrains.net/issue/SCL-1724 to track this idea.
I was wondering about writing a little web page renderer of the output of the sbt test results; where clicking on a line in a stack trace on a failed test case could then tell IDEA to open a class at a specific line.
Atlassian IDE Connector does just that for integration with the web - you click on a link in Fisheye and the file is opened in IDEA.
It's open source - have a look
Awesome, thanks! Taking a look at the code now...
Look for IdeHttpServerHandler and startHttpServer() in ThePluginApplicationComponent
Awesome thanks! So I guess IDEA itself has no remote API - you have to write your own plugin which has an embedded HTTP server that does this part for you right? Thanks again!
One sample usage:
If you have an open IDEA with the connector you should see a nice icon.
If not, open the html source and look for this:
<img class="ide-icon tb_right_mid"
title="Open file activecluster/trunk/src/main/java/org/apache/activecluster/Cluster.java in IDEA"
onclick="this.src='http://localhost:51235/file?file=activecluster/trunk/src/main/java/org/apache/activecluster/Cluster.java&id=' + Math.floor(Math.random()*1000);"
alt="Open in IDE"
fantastic stuff! I was just looking at the code trying to figure out what a URL would look like. Great stuff!
Am a bit confused; having a quick look at the Atlassian IDE connector for IDEA, its got code for talking to Fisheye URLs etc. I'm not sure how to find the fisheye code that renders a web page that creates links which open a file in IDEA? Or is it that the Atlassian IDE connector providers URLs which the fisheye code renders? i.e. the Atlassian IDE connector itself responds to HTTP requests and then opens files in IDEA?
Any chance of a pointer in the right direction please?
Fisheye (by itself ) forges an URL in the format as in my comment above, esp see the <img> and onClick parts.
Connector responds to http requests on localhost and serves an image, as a side effect opens files specified in URL params or does other nice stuff.
It needs to be <img> because it is the only simple solution we know that would not cause Cross-Site Scripting problem.
There is a (very early stage) plugin for JIRA that does something similar, see: https://studio.plugins.atlassian.com/source/browse/OCSTAJ/trunk/src/main/java/com/atlassian/ocstaj/jira/StackTraceWikiRenderer.java?r=143793
It's very early stage, so don't tell anyone ;-)
It renders HTML page with links that when clicked would send a <img> request to IDE Connector on localhost to display a stack trace.
On the second thought, if you want to render a html page with a stack trace with clickable links, the project I pointed you to does exactly that :-)
The accompanying functionality of the Atlassian IDE Connector is already commited to the plugin sources, it will be included in the version about to be released next week.
You might extract the code as a separate plugin for IDEA or advise users to install the IDE Connector (of course I advise the latter ;-) )
The code I pointed you to scans a html page for something that looks like a stacktrace and adds the links when it finds one.
I dare to say just copy-paste the methodt and you are done ;-)
It's work in progress, so stay tuned for changes.