zls
zls copied to clipboard
Convert translate-c failure into diagnostics
Code that uses @cImport and refers to non existent files doesn't report any diagnostics which makes debugging much harder.
const c = @cImport({
@cInclude("non/existent/file.h");
});
the error logs contain
error: (default): zig translate-c process failed, code: 1, stderr: '/home/techatrix/.cache/zls/cimport.h:1:10: 'non/existent/file.h' file not found
It should be fairly simple to convert the errors into diagnostics with textDocument/publishDiagnostics.
The same could also be applied to regular @import.