简体   繁体   English

如何在vim + eclim中显示java函数的参数?

[英]How to show arguments of java function in vim + eclim?

I have configured vim + eclim OK.我已经配置了 vim + eclim OK。 Now I can use Ctrl+X and Ctrl+U complete functions.现在我可以使用 Ctrl+X 和 Ctrl+U 完成功能。 But there is no arguments hint.但是没有参数提示。 For example,例如,

FileInputStream fins = new FileInputStream(/* what arguments can be used here? eclipse will show those but eclim not */);

how to show arguments hint in vim + eclim?如何在 vim + eclim 中显示参数提示?

Resurrecting this old question, since I stumbled on this.复活这个老问题,因为我偶然发现了这一点。

You can use eclim to lookup the java docs of the class and look through the list of constructors that way using the :JavaDocSearch command.您可以使用 eclim 查找类的 Java 文档,并使用:JavaDocSearch命令以这种方式查看构造函数列表。

Because the command uses a browser to render the javadocs, you'll need to add to your .vimrc :因为该命令使用浏览器来呈现 javadoc,所以您需要添加到您的.vimrc

let g:EclimBrowser = 'browser-executable-name'

Replacing browser-executable-name with your console-based browser of choice.用您选择的基于控制台的浏览器替换browser-executable-name Example: lynx , links , w3m示例: lynxlinksw3m

Then navigate over FileInputStream with your cursor and run the command :JavaDocSearch and it will pop up the java doc for the class.然后用光标导航FileInputStream并运行命令:JavaDocSearch ,它将弹出该类的 Java 文档。

Or enter the class name manually: :JavaDocSearch java.io.FileInputStream或者手动输入类名: :JavaDocSearch java.io.FileInputStream

You can use the YouCompleteMe (YCM) plugin with options您可以使用带有选项的 YouCompleteMe (YCM) 插件

let g:ycm_add_preview_to_completeopt = 1
let g:ycm_autoclose_preview_window_after_insertion = 1

Note that this does not work for your Constructor invocations.请注意,这不适用于您的构造函数调用。 But at least prototypes for method calls will be shown.但至少会显示方法调用的原型。

Also, if you don't like the auto-popup of YCM, it can be switched off.另外,如果您不喜欢 YCM 的自动弹出功能,可以将其关闭。

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

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