Skip to content
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

Array indentation seems broken #33

Closed
j0ni opened this issue Mar 14, 2014 · 9 comments · Fixed by #59
Closed

Array indentation seems broken #33

j0ni opened this issue Mar 14, 2014 · 9 comments · Fixed by #59

Comments

@j0ni
Copy link

j0ni commented Mar 14, 2014

Multiline array literals get formatted like this:

  $nodes = [
            '10.116.1.72',
            '10.116.1.73'
            ]

which seems quite broken. I think they should look like this:

  $nodes = [
    '10.116.1.72',
    '10.116.1.73'
  ]
@swsnr
Copy link
Contributor

swsnr commented Mar 14, 2014

It's always been like that, and we'll not touch the existing indentation code before #7.

With #7, these things should be fixed then.

@j0ni
Copy link
Author

j0ni commented Mar 14, 2014

@lunaryorn sounds right, thanks.

@swsnr
Copy link
Contributor

swsnr commented Mar 14, 2014

@j0ni You're welcome! Please report any other indentation flaws you find. While we won't fix them immediately, they show us what we need to look for when implementing SMIE.

@bbatsov
Copy link
Contributor

bbatsov commented Mar 14, 2014

@lunaryorn This particular SMIE code can be borrowed directly from ruby-mode. I guess we'll be able to borrow from them heavily given the fact that the puppet lang shares some common ground with Ruby.

@swsnr
Copy link
Contributor

swsnr commented Mar 14, 2014

@bbatsov I hope so. I actually made my living here by borrowing from Ruby Mode. The string expansion stuff is also conveniently stolen from Ruby Mode ;)

@bbatsov
Copy link
Contributor

bbatsov commented Mar 14, 2014

I’m well aware of that. :-) I’ve been following @dgutov’s work on ruby-mode closely over the past year or so. He’s one of the best hackers in the community, so borrowing from his work is always a good idea. One can certainly do much worse. :-)

Cheers,
Bozhidar

On Friday, March 14, 2014 at 8:00 PM, Sebastian Wiesner wrote:

@bbatsov (https://github.com/bbatsov) I hope so. I actually made my living here by borrowing from Ruby Mode. The string expansion stuff is also conveniently stolen from Ruby Mode ;)


Reply to this email directly or view it on GitHub (#33 (comment)).

@swsnr
Copy link
Contributor

swsnr commented Mar 14, 2014

@bbatsov Yeah, indeed. It's a well-written mode, and there's a lot to learn from it.

@swsnr swsnr added this to the 0.4 milestone Mar 14, 2014
@dgutov
Copy link

dgutov commented Mar 15, 2014

😊

Thanks, but ruby-mode still has its share of warts. There's old indentation code left, a few commands still use it even with SMIE integration enabled, and the SMIE grammar is far from perfect, making the indentation code in places more complex than is probably has to be. Sexp movement is also not always intuitive because of that.

@askreet
Copy link
Contributor

askreet commented Jul 29, 2015

Aw, just saw this after fixing this indentation locally. Can I convince you to accept a pull request addressing this while you're working out the details of SMIE?

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

Successfully merging a pull request may close this issue.

5 participants