`syso` 插入快捷键在 Eclipse 中无法正常工作。

huangapple go评论63阅读模式
英文:

syso insertion shortcut not working in Eclipse

问题

我目前在 MacOS Catalina 上运行最新版本的 Eclipse(我认为是 2020-06)。我无法使用键盘快捷方式,即输入 syso,然后按 Control+Space,这将会被替换为 System.out.println()。我还尝试过 SysosysoutSysout,但都没有效果。我已经检查了我的按键绑定偏好设置,Control+Space 绑定到了内容辅助命令。此外,如果我输入 syso 并按下 Control+Space,会出现一个框,上面写着“没有默认建议”。如果我继续按下这个组合键,这个消息会变成“没有模板建议”,然后是“没有 SWT 模板建议”,再然后是“没有链式模板建议”,最后是“没有 Java 建议”,然后又回到原始消息。在内容辅助和内容辅助 > 高级 中都出现了相同的情况。重新安装并没有解决这个问题。

我知道有其他讨论同样问题的主题。然而,我尝试了提到的方法,但都没有奏效。

更新:这真的很奇怪。在创建一个新文件时,这个快捷方式有效。我不确定旧文件和新文件之间有什么区别。两者都是标准的 .java 文件。

英文:

I'm currently running the latest version of Eclipse (2020-06, I believe) on MacOS Catalina. I am unable to use the shortcut where you type syso, then press Control+Space, which results in the text being replaced by System.out.println(). I have also tried Syso, sysout, and Sysout to no effect. I have checked my keybind preferences and Control+Space is bound to the content assist command. Further, if I do type syso and press Control+Space, I get a box saying "No Default Proposals". If I continue pressing it, this message changes to "No Template Proposals", then "No SWT Template Proposals", then "No Chain Template Proposals", and finally "No Java Proposals" before cycling back to the original message. Identical behavior is also seen with sysout, Syso, and Sysout. This occurs with the default preferences in Content Assist and Content Assist>Advanced. A reinstall didn't fix this issue.

I am aware of other topics dealing with the same issue. However, I tried the approaches mentioned, none of which worked.

Update: This is quite odd. Upon creating a new file, the shortcut works. I'm not sure what the difference was between the new file and the old one. Both were standard .java files.

答案1

得分: 1

从内容辅助>高级>检查Java提案。(Eclipse IDE企业版Java和Web开发人员-2022-12)。初次使用可能不起作用。创建一个新类并使用CTRL+空格键。建议将会显示。

英文:

From content assist>advanced> check Java proposals. (Eclipse IDE Enterprise Java and Web Developers - 2022-12). For the first time, it might not work. Create a new class and use CTRL+Spacebar. The suggestions will show up

huangapple
  • 本文由 发表于 2020年8月16日 23:35:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/63438725.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定