Fix error action for any error on the line?

Answered

Right now Fix Error (alt-enter) only works if your caret is over the error-cause word.  For example,If my caret is right after the semicolon and I hit alt-enter to call up quick fix, nothing happens.  I have to go back to the erroring section (in red), hit alt-enter, get the 'introduce field quick-fix', be moved to where that field is introduced.  When I tab once to actually introduce the field, my caret is left up at the declaration, rather than being returned to the (now-correct) use of this.schema.  I can't use the quick fix after 'this.schema' because at that point IntelliJ doesn't have enough information to infer the type (as it can once I assign a variable to this.schema, thus triggering the error).

It would be great if alt-enter could be triggered anywhere on the line.  There's only one error; I should be able to hit alt-enter after the semicolon.  Moving back to the error (and eventually back from where the field is introduced) really breaks the rhythm of coding.  It's the most irritating thing about working with IntelliJ.  Allowing alt-enter anywhere on a line with errors would be a big productivity boost.

Finally, once the quick fix has been applied, the caret should be returned to where the alt-enter was triggered so that we can get on with the coding thought we were finishing.

 

1 comment
Comment actions Permalink

There's no such functionality currently. You can vote for https://youtrack.jetbrains.com/issue/IDEA-135910

0

Please sign in to leave a comment.