eclipse - eclipse中如何获取选中单词的长度?

标签 eclipse

当我检查代码的命名规则时。如果我得到的变量或函数名称的字母数超过允许的错误。我手动计算总字符数或必须将粘贴复制到 Notpad++ 中。是否有任何选项可以在 Eclipse 中查找所选字符的数量。

最佳答案

Eclipse 没有像 NotePad++ 那样提供显示文本选择长度的方法。

Bug 73904: Show length of selection in status box于 2004 年 (!!!) 提出以添加此功能,但仍未实现。

好消息是someone has written a plugin named getStringLength做你想做的,正如 Eclipse Bug Report 的评论中提到的:

Eclipse plugin that add the selected text counter on the right side of the column and row position in the Eclipse status bar. After you double click the text, this plug-in will show the length of text you selected in the eclipse status bar; in the case you select more than one row it will show the number of rows selected, like Notepad++ do.

坏消息是我无法让它正常工作。将插件添加到 Eclipse 的 dropins 文件夹后,状态栏会按照描述进行更新,但细节未对齐且无法正确呈现:

selTextLen

通过仔细测试,我发现该插件确实在更新所选文本的长度,但状态栏上的条目几乎无法辨认。尽管如此,在没有其他任何东西的情况下,还是值得一试——也许你在你的环境中会有更好的运气。让我们知道它是否适合您。

关于eclipse - eclipse中如何获取选中单词的长度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49365111/

相关文章:

java - Eclipse 中的 LinkedIn 身份验证问题

html - 显示不会内联阻塞

java - Eclipse 导出可运行的 jar,其中主类位于库 jar 中

java - 当前正在使用 eclipse,无法退出 Debug模式

java - ListView 中的 Admob 广告

java - eclipse ide 调试器中的 Step out 在哪里?

java - Android 4.3 启动 Activity 时 native 崩溃

java - 如何实现 Idempiere 版本 5.1

java - 如何在 eclipse 中添加gradle?

Eclipse:编辑长行编辑器窗口后自动滚动到行首