adrianlee44 / atom-aligner

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

Doesn't support ruby 1.9 hashes + CSS? #16

Closed kaievns closed 9 years ago

kaievns commented 9 years ago

Hey guys, firstly, thank you for an awesome plugin! Secondly, thought I'll report an issue.

Apparently it doesn't work in ruby 1.9 syntax hashes. Which is a bit of a bummer. Try something like this

stuff = {
  oh: 1,
  noooo: 2
}

Shouldn't be too hard to support, i mean, it's practically the same as the javascript hashes.

Also, a feature request, can you make CSS/LESS work as well?

Thanks!

adrianlee44 commented 9 years ago

I have added support for CSS and LESS in aligner-css. You can find the package on Atom package manager.

adrianlee44 commented 9 years ago

As for the Ruby syntax, ruby grammar in language-ruby needs to be updated first to represent : correctly.

I have opened a PR, atom/language-ruby#87 to address this issue. Once that's merged, I'll update aligner-ruby

kaievns commented 9 years ago

Ah sweet! Thank you for the fix and a quick update! Looking forward for the ruby update!

On 27 Mar 2015, at 7:42 pm, Adrian Lee notifications@github.com wrote:

As for the Ruby syntax, ruby grammar in language-ruby needs to be updated first to represent : correctly.

I have opened a PR, atom/language-ruby#87 to address this issue. Once that's merged, I'll update aligner-ruby

— Reply to this email directly or view it on GitHub.

lee-dohm commented 9 years ago

As I commented directly on the pull request, this would break expectations for at least some people's syntax themes, mine included. If you wish to customize the colorization of the colon to be different than the rest of the symbol declaration, you can always add something like this to your styles.less:

.punctuation.definition.constant.ruby {
  color: red;
}

Now, this will change the colorization of all colons in symbol declarations. If you wanted to be able to colorize colons in hash key symbol declarations separately from all other symbol declarations, then I would support adding to the current scope definition in language-ruby with something like this:

{
  'captures':
    '1':
      'name': 'punctuation.definition.constant.hashkey.ruby'

So that you could differentiate it from other symbol declarations without breaking other people's themes.

adrianlee44 commented 9 years ago

@lee-dohm, the original intension was to distinguish the colon between :foo and foo: so the package can align the colon accordingly. I think the second suggestion of adding hashkey to the scope will do.

Will open another PR on language-ruby to address this issue.

lee-dohm commented 9 years ago

:+1:

adrianlee44 commented 9 years ago

@lee-dohm, just to clarify. Do you mean adding hashkey to both 1.5 and 1.6 syntax scope?

Since I'm trying to distinguish the colon between :foo and foo:, adding hashkey to both syntax scopes won't be useful to me. I was wondering if you have any suggestions.

Thanks for your help! :)

lee-dohm commented 9 years ago

I'm suggesting adding hashkey to only the Ruby 1.9+ hash syntax scope, the one that allows the colon after the symbol name. And it should be added only in the case of the colon appearing after the symbol name.

adrianlee44 commented 9 years ago

Opened atom/language-ruby#88 to address this issue

adrianlee44 commented 9 years ago

@MadRabbit, 1.9 syntax hashes should work now with aligner-ruby v1.2.0 and Atom v0.190.0.

kaievns commented 9 years ago

em, i'm afraid i don't see the aligner-ruby in the list of available packages

adrianlee44 commented 9 years ago

@MadRabbit Have you updated Atom to v0.190.0?

kaievns commented 9 years ago

yup

adrianlee44 commented 9 years ago

hm... I'm not sure why it's not showing up for you. I'm on Atom v0.190.0 and was able to find aligner-ruby v0.12.0. Maybe try restarting Atom, uninstall existing aligner-ruby and reinstall it?

kaievns commented 9 years ago

well that's the thing, i don't have it installed, and I don't see it on the list of available packages either

adrianlee44 commented 9 years ago

I have reverted Atom requirement and bumped the version to v1.2.1. Let me know if you see the package at all.

kaievns commented 9 years ago

ah, all working now! sorry, don't know what was the problem, but now i see the aligner-ruby and works perfectly!

much appreciated!