dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Fix issue 22920: Improve errors when missing import paths

Open ljmf00 opened this issue 3 years ago • 4 comments

This patch introduces errorSupplemental() to the import paths error to display
extra information about them. These error messages are out of sync with `-J`
flag, which have similar purposes. This patch make `-I` behave similarly to
`-J` flag in terms of errors, improving consistency among other error messages
and add some alignment to the main error.

It also improves the message for missing `object.d` file and give better hints
about configured import paths.

This change is particularly crucial for DMD as a library, since error
interfaces writes to a diagnostic handler rather than directly to `stderr`.

Signed-off-by: Luís Ferreira <[email protected]>

ljmf00 avatar Mar 24 '22 17:03 ljmf00

Thanks for your pull request, @ljmf00!

Bugzilla references

Auto-close Bugzilla Severity Description
22920 enhancement Improve errors when missing import paths

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#13885"

dlang-bot avatar Mar 24 '22 17:03 dlang-bot

How does this improve the error message - the import path is unrelated to the location of the import? Please include such information in the commit title / message (the same applies to your other PR's btw) - see e..g rule 7 in this article

MoonlightSentinel avatar Mar 24 '22 18:03 MoonlightSentinel

How does this improve the error message - the import path is unrelated to the location of the import? Please include such information in the commit title / message (the same applies to your other PR's btw) - see e..g rule 7 in this article

Sometimes I forgot to add a proper description but this one in specific is still in draft. I strive to do it tho. Thank for the heads up :)

ljmf00 avatar Mar 24 '22 19:03 ljmf00

@ljmf00 Any updates on this PR?

RazvanN7 avatar Sep 05 '22 09:09 RazvanN7