4 days ago

[SAOC 2025] Improve error messages and LSP integration Weekly Update #6

This week I continued working on the PR. #PR 21979.

I made changes in frontend.h and errors.d to pass some tests which were failing. These were advised by my mentor. Also created a fail-compilation test for lsp diagnostics name diag-lsp.d. I am currently trying to come up with a solution to resolve the issue of printing eror-supplemental messages along with their respective JSON error objects which are otherwise being printed separately.

I also tried a new way to print the logical location of errors like in gcc or g++. The attempt was to use a global const(char)* variable to store the current function name in scope and to output it in case it threw an error. However the output is printing something like this instead of the function name

file.d(31): Error in std.typecons.typecons_d_toObject

I have used funcdecl.toPrettyChars(). The desired output is

file.d(31): Error in int foo(int num)

The code is in this branch.