From 5737cd5686b82c9dfe633f5e96e6eb3780fe2b48 Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Fri, 10 Jul 2020 12:45:49 +0400 Subject: [PATCH] Fix tree traversal breaking on errors --- tools/lsp/squirrel/src/Tree.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/lsp/squirrel/src/Tree.hs b/tools/lsp/squirrel/src/Tree.hs index 02f71058e..c45ab4632 100644 --- a/tools/lsp/squirrel/src/Tree.hs +++ b/tools/lsp/squirrel/src/Tree.hs @@ -213,7 +213,9 @@ traverseMany visitors orElse = go case tree of Tree (Right (r, union)) -> do union' <- traverse go union - return $ Tree (Right (orElse r, union')) + return $ Tree $ Right (orElse r, union') + Tree (Left err) -> do + return $ Tree $ Left $ fmap orElse err -- | Make a tree out of a layer and an info. mk :: (Functor f, Element f fs) => info -> f (Tree fs info) -> Tree fs info