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

Problem with LESS &:extend() #159

Closed
mandulaj opened this issue Dec 22, 2014 · 3 comments
Closed

Problem with LESS &:extend() #159

mandulaj opened this issue Dec 22, 2014 · 3 comments
Assignees

Comments

@mandulaj
Copy link

Hi, I found a problem when beautifying LESS files
When I have something like this:

.some_class {
   &:extend(.some_other_class);
  //... some more code
}

atom-beautify adds a space between the &: and the extend so the result looks like this:

.some_class {
   &: extend(.some_other_class);
  //... some more code
}

The resulting code does not compile 😞
This does not happen for &:hover
My best guess is that the extend keyword is not on some list of verbs whereas hover is. I set atom to beautify my code on save, now I had to disable it because of this problem.
Thank you in advance!

@Glavin001 Glavin001 self-assigned this Dec 27, 2014
@Glavin001 Glavin001 added the bug label Dec 27, 2014
@Glavin001
Copy link
Owner

I've seen similar problems before, you are definitely on the right track with extend keyword not being on the list.

LESS uses the same beautifier as SASS:
https://github.com/Glavin001/atom-beautify/blob/master/lib/language-options.coffee#L190-L192

They use prettydiff:
https://github.com/Glavin001/atom-beautify/blob/master/lib/langs/less-beautify.coffee#L2

Here's Prettydiff:
https://github.com/austincheney/prettydiff

And looks like there is a closed issue!
prettydiff/prettydiff#31

I'll give it shot sometime this weekend and test your sample code. Hopefully this can be resolved quickly. Thanks!

@Glavin001 Glavin001 added this to the My Christmas List milestone Dec 27, 2014
@Glavin001 Glavin001 removed this from the My Christmas List milestone Dec 28, 2014
Glavin001 added a commit that referenced this issue Dec 28, 2014
@Glavin001 Glavin001 added this to the My Christmas List milestone Jan 1, 2015
@Glavin001
Copy link
Owner

Published to v0.18.0. Happy New Year! 😃

@mandulaj
Copy link
Author

mandulaj commented Jan 2, 2015

Happy New Year to you too! And thank you! Now I can enable beautify again 😄

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

2 participants