Eclipse 的“syso”快捷方式不起作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26539670/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:07:01  来源:igfitidea点击:

Eclipse's 'syso' Shortcut is Not Working?

eclipseautocompleteidesettings

提问by Scoutdrago3

I have been having this problem for a while and I have been constantly searching for an answer everywhere and finally chose to just ask it here. All the other posts I have seen don't fix my problem and I have tried doing the following:

这个问题我已经有一段时间了,我一直在到处寻找答案,最后选择在这里提问。我看到的所有其他帖子都没有解决我的问题,我尝试执行以下操作:

  • Changed the binding of the shortcut

  • Made sure that is was checked under templates

  • Made sure all my settings were correct

  • Autocompletion on

  • 更改了快捷方式的绑定

  • 确保在模板下检查

  • 确保我所有的设置都是正确的

  • 自动完成

When I type sysoand press Ctrl + Space, instead of instantly giving me the insertion or shortcut I want, it just opens the 'Intelligent Proposals' menu and I have to press Ctrl + Space again in order to get to the 'Template Proposals' menu where I can actually double click "'syso' - print to standard out" and then it gives me the full System.out.println. It really does mess with flow and is very annoying.

当我输入syso并按 Ctrl + Space 时,它​​不会立即给我我想要的插入或快捷方式,而是打开“智能提案”菜单,我必须再次按 Ctrl + Space 才能进入“模板提案”菜单我实际上可以双击“'syso' - 打印到标准输出”,然后它会给我完整的System.out.println. 它确实扰乱了流程并且非常烦人。

Any fixes to my problem? Thanks,

我的问题有什么解决办法吗?谢谢,

  • Sa'id
  • 说过

回答by Abhineet Kumar

I was facing the same problem and figured it out after playing around with some settings. So, here's what you should do:

我遇到了同样的问题,并在尝试了一些设置后弄清楚了。所以,这是你应该做的:

  1. Go to Windows->Preferences-Java->Editor->Content Assist->Advanced.
  2. Check on the box saying- Java Proposals.
  3. Uncheck the box saying- Java Proposals (Code Recommenders).
  1. 转到Windows->首选项-Java->编辑器->内容辅助->高级。
  2. 选中“Java 提案”框。
  3. 取消选中框说 - Java Proposals (Code Recommenders)。

Hope it helps.

希望能帮助到你。

回答by Chandrayya G K

Check this. Select any string then press Ctrl + Space eclipse detects the context.

检查这个。选择任何字符串然后按 Ctrl + Space eclipse 检测上下文。

enter image description here

在此处输入图片说明

回答by sattik

I had exactly the same problem in Eclipse with the 'Template Proposals' menu popping up instead of completing the sysout shortcut. In my case, a plug-in installed recently was to blame. I unchecked all the templates for the plug-in in Preferences/(plug-in)/Templates - and this did the trick for me. Now the selection menu doesn't pop up any more, and syso + CTRL-SPACE works again as it should.

我在 Eclipse 中遇到了完全相同的问题,弹出“模板建议”菜单而不是完成 sysout 快捷方式。就我而言,罪魁祸首是最近安装的插件。我在 Preferences/(plug-in)/Templates 中取消选中插件的所有模板 - 这对我有用。现在选择菜单不再弹出,并且 syso + CTRL-SPACE 再次正常工作。

回答by Olga H

Go to Windows-Preferences-Java-Editor-Templates

转到Windows-首选项-Java-Editor-Templates

  1. Here you can check if you have "syso" already and if so just check the box.
  2. If you do not have check box with "syso"-create new "New.." , type name: syso, give your description if you want to, and enter the Pattern: System.out.println();, press OK
  3. Press "Apply" , then "OK"
  4. Check if it works!
  1. 在这里您可以检查您是否已经有“syso”,如果有,只需选中该框。
  2. 如果您没有带有 "syso"-create new "New.." 的复选框,请输入名称:syso,如果需要,请提供您的描述,然后输入模式:System.out.println(); ,按确定
  3. 按“应用”,然后“确定”
  4. 检查它是否有效!

Also, if it still does not work for you, go to Windows-Preferences-Java-Editor-Content Assist -Favorites

此外,如果它仍然不适合您,请转到 Windows-Preferences-Java-Editor-Content Assist -Favorites

Here, press "New Type" -enter: System.out.println();, press OK , press Apply.

在这里,按“新类型”-输入:System.out.println(); ,按确定,然后按应用。

I hope it helped! :)

我希望它有帮助!:)

回答by PbxMan

In my case it didn't work because ctrl+space was being used by another program Ubuntu(I-Bus) in my case ref. hereTry changing ctrl-space by another key combination in general->keys to find out if this is causing the problem and try sysout instead.

就我而言,它不起作用,因为在我的情况下,另一个程序 Ubuntu(I-Bus) 正在使用 ctrl+space。在这里尝试通过其他组合键更改 ctrl-space 以查看是否是导致问题的原因,然后尝试使用 sysout。

回答by Dupree

What worked for me was capitalizing the S in Sysout. Hope this helps.

对我有用的是将 Sysout 中的 S 大写。希望这可以帮助。

回答by Varsheeth T V

Only for those who are using eclipse editor;

仅适用于使用eclipse 编辑器的人

Check you are using syso -> ctrl+spacein a valid coding area. I mean, you can't have a SOP statement inside class, it can be inside a function only, i.e. either inside main()or any user defined methods.

检查您是否在有效的编码区域中使用syso -> ctrl+space。我的意思是,您不能在类内部使用 SOP 语句,它只能在函数内部,即内部main()或任何用户定义的方法。

回答by Vaibhav Tanavde

  • Step 1: Type sysout
  • Step 2: Click Ctrl + space
  • Step 3: Double click on sysout-printto standard out option.
  • 第 1 步:键入 sysout
  • 第二步:点击 Ctrl + space
  • 第 3 步:双击sysout-print标准输出选项。

回答by Shuyu

I have both Chinese and English language input. Ctr + space could also mean switch language input. So make sure you are under English input

我有中文和英文两种语言输入。Ctr + space 也可能意味着切换语言输入。所以请确保您在英文输入下