简体   繁体   English

IntelliJ 快速修复错误,无需将 cursor 置于高亮区域下方

[英]IntelliJ quick fix for errors without placing the cursor under the highlighted area

Is it possible to enable quick fix for errors anywhere in the line?是否可以在线路中的任何位置启用快速修复错误?

In the image below I opened quick fix (control+1, Eclipse KeyMap) while having the cursor at the start of the line: ( int part)在下图中,我打开了快速修复(control+1, Eclipse KeyMap),同时在行的开头有 cursor:int部分)

在此处输入图像描述

What I want, is that if I have the cursor in the int part of the line, solution will be included in the quick fix list:我想要的是,如果我在该行的int部分有 cursor,解决方案将包含在快速修复列表中:

在此处输入图像描述

I tried to find a solution in the official IntelliJ but I was unable to find if there is any setting for this.我试图在官方 IntelliJ 中找到解决方案,但我无法找到是否有任何设置。

I put Java as tag because I am only trying to find the solution for the java editor of IntelliJ.我把Java作为标签,因为我只是想为 IntelliJ 的 java 编辑器找到解决方案。

With other words I am looking to do what Eclipse does:换句话说,我希望做 Eclipse 所做的事情:

在此处输入图像描述

No, it's not possible.不,这是不可能的。 Quick fixes are context sensitive and are suggested depending on where the caret is located.快速修复是上下文相关的,建议根据插入符号所在的位置。 The quick fixes are different for different parts of the line and there is no option to provide all possible fixes for the current line.快速修复对于生产线的不同部分是不同的,并且没有为当前生产线提供所有可能修复的选项。 A feature request is welcome .欢迎提出功能请求。

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

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