suve/GHActions-FPC

Improve handling "wrong number of parameters" errors

Closed this issue · 1 comments

suve commented

When a function is called with the wrong number of parameters, the compiler generates a message like this:

/example/error.pas(9,41) Error: Wrong number of parameters specified for call to "SomeFunc"
/example/error.pas(3,10) Error: Found declaration: SomeFunc(SmallInt):SmallInt;

Currently, the Action handles each compiler message independently, so it will generate two separate annotations.

Having the "Found declaration:" annotation attached to an error-free line isn't very helpful. It would be more useful if the "Found declaration" error was detected and somehow merged with the previous "wrong number of parameters" error, resulting in a single annotation, which could look something like this:

/example/error.pas(9,31): Error
Wrong number of parameters specified for call to "SomeFunc"
Found declaration in /example/error.pas(3,10): SomeFunc(SmallInt):SmallInt;

suve commented

Implemented in 68fdd29 and released in v0.3.2.