Skip to content

Add hscTypecheckRenameWithDiagnostics, for HLS (Issue #24996)

Tackles issue #24996 (closed) , is ready for review.

Very small change, only exports another identifier from the driver module, should not break any user programs. The key part of this patch is in de79511c32.

I am improving HLS to use structured diagnostics, and so the logging approach mentioned in the linked issue is no longer sufficient. In order to get the GhcMessages directly, I'd rather be able to run hscTypecheckRename with runHsc' instead of runHsc, which returns Messages GhcMessage.

This patch modifies GHC to have both hscTypecheckRename and hscTypecheckRenameWithDiagnostics. It also modifies runHsc to use runHsc', to make sure that neither falls out of sync with the other.

As a workaround until this patch lands, on HLS I am copying parts of GHC's driver code to recreate hscTypecheckRenameWithDiagnostics locally. Once this function is in GHC we can drop the copied code in future versions of HLS.

Edited by Dylan Thinnes

Merge request reports