1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Merge pull request #2369 from github/second-wait

Block on async parsing thread after timeout
This commit is contained in:
Timothy Clem 2019-02-06 08:58:51 -08:00 committed by GitHub
commit e15553a97c

View File

@ -85,7 +85,8 @@ parseToAST parseTimeout language Blob{..} = bracket (liftIO TS.ts_parser_new) (l
Just (Succeeded ast) -> Just ast <$ trace ("tree-sitter: parsing succeeded " <> blobPath)
Nothing -> do
trace $ "tree-sitter: parsing timed out " <> blobPath
Nothing <$ liftIO (TS.ts_parser_set_enabled parser (CBool 0))
liftIO (TS.ts_parser_set_enabled parser (CBool 0))
Nothing <$ liftIO (wait parsing)
toAST :: forall grammar . (Bounded grammar, Enum grammar) => TS.Node -> IO (Base (AST [] grammar) TS.Node)