Annoying, unnecessary method return type errors in IntelliJ IDEA

已回答

When writing a method, IntelliJ IDEA highlights everything I type, because what I have written doesn't match the function return type. I'm going to give the return value in the end of the function, I don't need to see that every line I write (unit) isn't Boolean.

Above is a picture of the problem. I was going to write more code below, but the error highlighting makes me question if the last line has something incorrect, because I'm a beginner coder.

I have tried to disable the inspection for this in the settings, but have not found a matching inspections. Even if there is a way to disable this highlighting, I don't want to disable all type mismatch errors, because the others are very useful, it's only the function return type error that is very annoying. Does it not annoy others???

I'm coding in Scala, and am using IntelliJ IDEA 2024.2.0.2 (Community Edition)

 

1

The purpose of error highlighting is exactly to remind coders about the error as long as it is detected in the first place until it gets corrected. Maybe you can temporarily disable the highlighting before finishing the whole block of code, and enable it back when its done.

-1

请先登录再写评论。