Copy location in code: is there a plugin doing such a thing?
Hi there,
I often need to tell a colleague "Go to class X, line Y", but I'd rather be
able to send a message with a link that gets opened in IDEA.
I know there's nothing that handles this right now, but is there a way to
copy the cursor location as a line of a stacktrace? The other person could
then use pclip (the clipboad to console thing) to print that in IDEA's
console, creating a link to the line of code I wanted to point to.
Is there a plugin capable of copying the location? Or is it even possible
with the current API?
Thx,
Andrei
请先登录再写评论。
Andrei, I'm almost sure there is enough info in the API.
And if somebody decides to write such a plugin that would
be a big help. Just one little, single use plugin.
r.
Andrei Oprea wrote:
Here's how I solved the problem without a plugin, you might find it good
enough for your use cases as well.
- create an external tool with "echo" for the program and "at
$FileClass$.xX($FileName$:$LineNumber$)" for the parameters. Be sure you
check the open console option. You can, optionally, assign a shortcut to the
external tool.
- invoking the external tool anywhere in the code will create a link to that
line in the run window
- if you want to copy the link automatically, create a macro that invokes
the external tool and then copies the content to the clipboard (or one line
of it, it works if you use the arrow keys for navigation and arrow key +
shift for selection).
This doesn't care about the method name (I just put xX so that the line
results in a link), IDEA will jump to the specified line in the given class.
PClip-ing that gives someone else the desired link.
HTH,
Andrei
"Richard Nemec" <rndzank@attbi.com> wrote in message
news:bu1811$2r2$1@is.intellij.net...
>
>
>
be
to
could
possible
Your external tool works fine on WinXp if I modify it like this:
Program: cmd
Parameters: /c echo at $FileClass$.xX($FileName$:$LineNumber$)
But I cannot paste into the console. Where can I find PClip? Is it
platform specific?
Thx,
Tim
"Andrei Oprea" <andrei_oprea@hotmail.com> wrote in message
news:bu2019$1fi$1@is.intellij.net...
>
the
that
line
>
class.
>
>
>
rather
>
>
You can get pclip from here http://wwweickel.in.tum.de/pub/sw/UnxUtils.html.
Set it up as an external tool and you'll get hiperlinks in IDEA's run window
if you have a stacktrace (or similar content) in the clipboard.
HTH,
Andrei
"Tim Haley" <ymaraner@yahoo.com> wrote in message
news:bu447b$bc0$1@is.intellij.net...
>
>
>
>
>
invokes
way
IDEA's
>
>
Cool.
I used to be a *nix guy. Maybe this will give me a reason to start using
the utilities again. I miss a lot of them.
thx,
Tim
"Andrei Oprea" <andrei_oprea@hotmail.com> wrote in message
news:bu453q$d68$1@is.intellij.net...
http://wwweickel.in.tum.de/pub/sw/UnxUtils.html.
window
>
>
good
you
to
to
+
line
person
>
>