Skip to content

Indentation (and newline-and-indent) super slow #125

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
benma opened this issue Feb 22, 2013 · 8 comments
Closed

Indentation (and newline-and-indent) super slow #125

benma opened this issue Feb 22, 2013 · 8 comments

Comments

@benma
Copy link

benma commented Feb 22, 2013

Hi there

I have a major issue with indentation in this mode. For any medium-sized code file, hitting [TAB] or [RET] takes a second or even more to complete, which unfortunately makes this feature completely useless. I revert to manually indent because it takes too long to cycle the indentations to pick the correct one.

What could be going wrong? I ran the latest haskell-mode with no other packages interfering.

Thanks!

@ivan-m
Copy link
Contributor

ivan-m commented Feb 23, 2013

Which actual mode? haskell-indentation or haskell-indent?

Another option is haskell-simple-indent which doesn't have any indentation cycle.

@benma
Copy link
Author

benma commented Feb 23, 2013

The mode is haskell-indentation. haskell-indent is fast, but it does not indent the way I like it (for exaple, line up correctly in do block after newline, which haskell-indentation does correctly, but too slow). simple-indent is also no solution, because the only things I really need from a haskell mode are syntax highlighting and good indentation.

@ivan-m
Copy link
Contributor

ivan-m commented Feb 27, 2013

I use (and now and then fight with :p) haskell-indentation as well, but haven't noticed any noticeable lags myself; maybe it's just having trouble parsing your file?

@benma
Copy link
Author

benma commented Feb 27, 2013

I just noticed that it only happens when I have many lines in a where-clause, e.g.:

someFunction = foo
    where
        -- a few hundred lines of definitions here

Are you familiar with the code-base of haskell-indentation.el?

@ivan-m
Copy link
Contributor

ivan-m commented Mar 6, 2013

Nope, not at all :)

@chrisdone
Copy link
Member

I don't use any of the indentation modes, if someone wants to take ownership of this issue, please do. Otherwise @benma should notify the author of the mode and close this. See also: #145.

@kuribas
Copy link
Contributor

kuribas commented Aug 13, 2013

I am the (original) author of haskell-indentation.el. What it does is, it traces back to the beginning of the expression by looking at the indentation, and then it parses the whole expression. It's slow, but it's also more accurate (usually). If you have an expression of a hundred lines long, then it will take much longer to find the correct indentation. I don't see an easy solution for this. Make sure that you use the byte-compiled version of haskell-indentation.

@gracjan
Copy link
Contributor

gracjan commented Mar 25, 2015

We have just merged new, improved version of haskell-indentation that hopefully is faster in cases like this one. Therefore I'm closing this issue.

Should you experience problems with new haskell-indentation do not hessitate to open new issues.

@gracjan gracjan closed this as completed Mar 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants