简体   繁体   中英

How to use the copied line reference after “Copy Reference” in Android Studio or Intellij IDEA

In Android Studio we can Use Copy Reference (ctrl+alt+shift+C) and it gives a reference to current line but I'm not sure how to use this reference as a click-able link in the comment of another file.

I'm looking for a way to easy navigate to that reference inside IDE so JavaDoc link functions which works outside IDE can't be useful.

This is the fastest way I found to navigate to that reference in Android Studio:

Select the pasted reference in the comment and ctrl+shift+N then hit Enter . It auto fills the box so doesn't need to copy the address, this will navigate to the referenced line.

Since the functionality is already there it seems a good candidate for writing a plugin to detect address automatically and turns it to links.

Update:
You can record a macro and make this almost automatic. Edit>Macros and this keystroke sequence:
End Shift+Home Ctrl+Shift+N Assign a keybinding to your macro in setting>keymap for example ctrl+shft+G . The caret must be in the line you've pasted the reference of course.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM