jyp / dante

389 stars 52 forks source link

Fix dante gets stuck on imports #162

Closed soupi closed 3 years ago

soupi commented 3 years ago

This is related to issue #129 I believe.

While writing an import statement with an explicit import list, dante gets stuck waiting for ghci while sending an import statement that contains unbalanced parenthesis.

For example, starting with a simple program like: a = 1

And then adding an import slowly like this import Data.Int (In, dante will call ghci with that exact (partial) statement and ghci will not respond, and dante will wait indefinitely or until killed.

The solution described in this PR:

Make sure that each import statement will first be checked to make sure the parens are balanced before sending it to ghci.

Please let me know if there's anything that needs changing in order to merge this PR, I don't know elisp.