starfixdev / starfix

Utility to easily open and operator on source code via url links from your browser
Apache License 2.0
26 stars 21 forks source link

idea: open stacktrace links #7

Open maxandersen opened 4 years ago

maxandersen commented 4 years ago

Imagine the following:

you run an app or build in your terminal, ie. mvn package and an error occurs and a stacktrace is shown.

Exception in thread "main" java.lang.NoClassDefFoundError: com/atlassian/fugue/Effect
        at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.doCreate(DefaultHttpClientFactory.java:68)
        at com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.create(DefaultHttpClientFactory.java:35)
        at com.atlassian.jira.rest.client.internal.async.AsynchronousHttpClientFactory.createClient(AsynchronousHttpClientFactory.java:63)

now in iterm2 you can actually setup regular expression to turn these stacktraces into hyperlinks.

would be interesting if we could support something like:

ide://open-stack-trace?stackline="com.atlassian.httpclient.apache.httpcomponents.DefaultHttpClientFactory.doCreate(DefaultHttpClientFactory.java:68)"

which would tell the IDE to search for DefaultHttpClientFactory.java and open it on line 68.

Not all editors would support this but at least eclipse, netbeans and vscode should technically be capable of doing it.

maxandersen commented 4 years ago

A MVP version of this would be, having this stacktrace in console:

2020-09-03_10-46-45

have a click on one of the lines, ie: at dev.jbang.cli.BaseScriptCommand.prepareScript(BaseScriptCommand.java:128)

would have startfix search for BaseScriptCommand.java, if one found turn that into a ide://open-file?file=<path to BaseScriptCommand.java and if mulitple open web page shwoing the multiple choices for the user then to choose.

furter out we could imagine using ide specific methods to just ask the IDE to locate this in its current open projects.

fahad-israr commented 4 years ago

Smart selction rules ? Start with iterminal