简体   繁体   English

IntelliJ :(键盘快捷方式)跳转到下一个/上一个建议

[英]IntelliJ: (Keyboard shortcut to) jump to next / previous suggestion

I know how to jump to the next and previous error ( F2 , see SO Link , jetbrains.com ), but is there a way to easily jump between suggestions ? 我知道如何跳转到下一个和上一个错误F2 ,请参阅SO Linkjetbrains.com ),但是有没有一种方法可以轻松地在建议之间跳转?

If possible, I would really love to have a keyboard shortcut for this, as I am currently learning Kotlin and IntelliJ often has nice suggestions on how to improve the code. 如果可能的话,我真的很想拥有一个键盘快捷键 ,因为我目前正在学习Kotlin,而IntelliJ经常对如何改进代码提出很好的建议。 If there is no keyboard shortcut to jump between suggestions, is there at least any other way? 如果没有键盘快捷键可在建议之间跳转,至少还有其他方法吗?

With suggestion I mean things like the following (Ignore the "nonsense code")): 在建议下,我的意思是类似以下内容(忽略“废话”)):

IntelliJ中的示例建议

F2 also works to navigate between warnings. F2还可以在警告之间导航。 If there are errors in the file, it will jump to the next error. 如果文件中有错误,它将跳至下一个错误。 If not, it will jump to the next warning. 如果不是,它将跳至下一个警告。

Adding to yole's answer: if you want to jump backwards you can use Shift + F2 instead. yole的回答是:如果您想向后跳,可以改用Shift + F2

Additionally you can alter the severity of each inspection (or inspection group) using the settings menu File | Settings | Editor | Inspections 另外,您可以使用设置菜单“ File | Settings | Editor | Inspections更改”来更改每个检查(或检查组)的严重性。 File | Settings | Editor | Inspections File | Settings | Editor | Inspections or directly using the intention action context menu ( ALT + ENTER or similar) when dealing with a highlighted element (be it warning, error, information, etc.). 在处理突出显示的元素(警告,错误,信息等)时进行File | Settings | Editor | Inspections或直接使用意图操作上下文菜单( ALT + ENTER或类似内容)。

Note that some inspections are not enabled by default and many allow customization to your needs (eg class naming conventions, etc.). 请注意,默认情况下未启用某些检查,并且许多检查允许根据您的需要进行自定义(例如,类命名约定等)。

I did once increase the severity of all the inspections and switch them back one by one as needed or even turned many off (or switched them to "weak warnings"), just to easily jump back and forth between them. 我曾经提高所有检查的严重性,并根据需要将它们逐一切换,甚至关闭了许多(或将它们切换为“弱警告”),只是为了在它们之间轻松地来回跳转。 I can't recommend that approach anymore ;-) (too many highlightings then... but it may help to find out about inspections you consider more helpful). 我不能再推荐这种方法了;-)(那时太多的重点...但是它可能有助于找出您认为更有用的检查方法)。

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

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