zeroc-ice / vscode-slice

Slice syntax highlighter for Visual Studio Code
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Emit Diagnostics without Spans #38

Closed InsertCreativityHere closed 9 months ago

InsertCreativityHere commented 9 months ago

In slicec, diagnostics can optionally have a span attached to them. This span describes where the error occurred (file name line #, etc.) The language server uses this information to publish the diagnostic in the correct file.

However, not all diagnostics have spans. For example, io errors (the user said to compile b̵l̴o̸p̴b̴l̴o̸p̶.slice and it doesn't exist). There is no 'location' to this error, so slicec can't associate a span with it.

However, the language server always expects a span to be present, and ignores any diagnostics without one. This is sub-optimal, since often these errors are usually about very serious problems.

Instead of ignoring these errors, the server should check:

We might want to consider consolidating multiple errors into a single dialogue. Or keep them all separate. Idk what other extensions do.