adrianlee44 / atom-aligner

Easily align multi-line with support for different operators and custom configurations
https://atom.io/packages/aligner
MIT License
77 stars 3 forks source link

Align RSpec to eq #64

Closed wbotelhos closed 7 years ago

wbotelhos commented 8 years ago

I could not align the eq values like I was doing on https://github.com/jarod2d/sublime_valign Is it possible?

From:

expect(user.name).to eq 'John Doe'
expect(user.email).to eq 'johndoe@example.org'

To:

expect(user.name).to  eq 'John Doe'
expect(user.email).to eq 'johndoe@example.org'
adrianlee44 commented 8 years ago

Do you use a language pack for RSpec? If so, can you link it here.

wbotelhos commented 8 years ago

I don't, just your plugin.

adrianlee44 commented 8 years ago

Oh sorry. I meant do you use any other packages for syntax highlighting when editing RSpec files.

wbotelhos commented 8 years ago

No, I don't.

It should be working?

adrianlee44 commented 7 years ago

Not sure if you are still using aligner since it has been a while. Aligner relies on language packages to tokenize text so it can align the correct tokens. Without a rspec language package, Aligner will not work properly.

Going to close this for now. Please let me know if this is still an issue.

wbotelhos commented 7 years ago

Hi,

What package do I need plus this one?

Maybe it?: https://atom.io/packages/language-rspec (still not working)

Just now I'm talking about align eq, not :, = etc...

expect(1).to eq 1
expect(2).to      eq 2

to

expect(1).to eq 1
expect(2).to eq 2

Thanks.

adrianlee44 commented 7 years ago

It looks like language-rspec doesn't tokenize/highlight eq at the moment. I have submitted a PR to do so. If that PR is accepted, I'll be able to add support for eq through aligner-ruby, https://atom.io/packages/aligner-ruby

adrianlee44 commented 7 years ago

Updating aligner-ruby to v1.6.0 and language-rspec to the latest version should align eq properly now.

wbotelhos commented 7 years ago

Hi @adrianlee44 ,

First, thank you for you job.

I think I'm doing something wrong, because it still does not works for me:

expect(1).to eq 1
expect(2).to      eq 2

Maybe it is my setup?

screen shot 2017-05-18 at 2 05 57 pm screen shot 2017-05-18 at 2 05 45 pm screen shot 2017-05-18 at 2 05 38 pm

Sorry about that. And thank you again.

adrianlee44 commented 7 years ago

When you do Select -> Select Grammar, is it showing Ruby or Rspec?

wbotelhos commented 7 years ago

You are awesome!

It was Ruby on Rails, my bad @adrianlee44 .

Thank you very much! <3