[SAOC 2025] Improving Error Messages and LSP Integration Weekly Update #6

Iskaban10 sourishjana10 at gmail.com
Mon Oct 27 14:51:57 UTC 2025


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

This week I continued working on the PR. [#PR 
21979](https://github.com/dlang/dmd/pull/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
```c
file.d(31): Error in std.typecons.typecons_d_toObject
```
I have used *funcdecl.toPrettyChars()*. The desired output is
```c
file.d(31): Error in int foo(int num)
```
The code is in this 
[branch](https://github.com/Iskaban10/dmd/tree/improve-error-msg).


More information about the Digitalmars-d mailing list