hazel icon indicating copy to clipboard operation
hazel copied to clipboard

Fix the stacked error holes for cases with multiple branches

Open pigumar1 opened this issue 4 months ago • 4 comments

This pull request fixes the "stacked error holes" issue for case expressions with multiple branches: image

This is what'll happen in the current Hazel. The reason is that the ids of | for each rule is added to M.error_ids before the type checking (I believe at the stage of parsing), so they can be error-wrapped. Yet the ids of the rules point to the info of the whole case expression, so when the whole case expression is erroneous, multiple error holes will occur.

This pull request tries to fix this by filtering out all the unrepresentative ids in M.error_ids, such that the ids of | for each rule will be filtered out. image

Not sure if there is a better way to do this though.

pigumar1 avatar Apr 14 '24 14:04 pigumar1