简体   繁体   English

如何在Android Studio或Intellij IDEA中的“复制参考”后使用复制的线参考

[英]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. 在Android Studio中,我们可以使用复制参考 (ctrl+alt+shift+C) ,它提供对当前行的引用,但我不确定如何将此引用用作另一个文件的注释中的可点击链接。

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. 我正在寻找一种方法来轻松导航到IDE中的引用,因此在IDE外部工作的JavaDoc链接函数JavaDoc

This is the fastest way I found to navigate to that reference in Android Studio: 这是我在Android Studio中导航到该引用的最快方法:

Select the pasted reference in the comment and ctrl+shift+N then hit Enter . 在注释中选择粘贴的引用,然后 ctrl + shift + N,然后按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 . End Shift+Home Ctrl+Shift+N在设置>键盘映射中为宏指定键绑定,例如ctrl + shft + G. The caret must be in the line you've pasted the reference of course. 当然,插入符号必须在您粘贴参考的行中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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