Description
As a follow-up to #7703, I'm trying to investigate more scenarios where excessive editor error highlighting interferes with editing or renders it less convenient. Seems like many of these have to do with anonymous functions, as in many cases they are passed as function arguments, which are usually expected to be quite short. However in callback or promise heavy code they may end up to be very long and span multiple lines or even pages.
Another case I've found is when there are excess or missing arguments in a function call, though here it would highlight the whole function call expression, which would include all the bodies of all the anonymous functions passed as arguments, and may span as many lines or pages as the call would.
Edit: removed an incorrect example!
Reduced test cases
This one happens with the function()
syntax as well:
Excess arguments:
function func(f: () => void) {
}
func(() => {
let x = 1;
return;
}, 42);
func(function () {
let x = 1;
return;
}, 42);
Missing arguments:
function func(f: () => void, n: number) {
}
func(() => {
let x = 1;
return;
});
func(function () {
let x = 1;
return;
});