Skip to content

Stop blocking me from typing my code #985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mrkkrp opened this issue Nov 10, 2015 · 6 comments
Closed

Stop blocking me from typing my code #985

mrkkrp opened this issue Nov 10, 2015 · 6 comments

Comments

@mrkkrp
Copy link
Contributor

mrkkrp commented Nov 10, 2015

Sometimes I get blocked and I cannot enter newlines. Message in minibuffer says:

Illegal token: import

I believe it's haskell-indentation-mode. My opinion is that it should never block user from typing.

Not sure to reproduce this reliably, but I'll find out when I have time.

@geraldus
Copy link
Contributor

Same here with

Illegal token: where

@Shimuuar
Copy link
Contributor

Also see #861 and #962

@mgsloan
Copy link

mgsloan commented Nov 10, 2015

Yeah, it's pretty shocking to me that something like "intelligent" indent would have the possibility of throwing an exception and refusing to do anything. This should just be a guess, requiring valid code before the point is absurd.

Instead of rewriting the whole thing to not use exceptions, how about catching them? Then, log them and fall back on a very simple indent scheme like just using the current line's indent.

@mrkkrp
Copy link
Contributor Author

mrkkrp commented Nov 12, 2015

@mgsloan, In my case I'm pretty sure code before point was valid Haskell.

@mgsloan
Copy link

mgsloan commented Nov 12, 2015

Yeah, I guess my point is that "code before the point is valid Haskell" is not a reasonable requirement for automatic indentation.

@gracjan
Copy link
Contributor

gracjan commented Nov 20, 2015

haskell-indentation-mode should work for any unicode character string, trying to make sense out of it as much as it can.

It should never throw any kind of exceptions.

The proposed solutions seem to be to catch exceptions and cover up then. I think it should never throw in the first place. Note that there are only three places where haskell-indentation-mode throws:

It should not be too hard to invent something sensible for each of these places to do instead of throwing exception.

Any takers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants