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

Coffeescript support #31

Closed
Glavin001 opened this issue Jun 15, 2014 · 7 comments
Closed

Coffeescript support #31

Glavin001 opened this issue Jun 15, 2014 · 7 comments
Assignees
Labels

Comments

@Glavin001
Copy link
Owner

See https://github.com/derekchiang/Coffee-Formatter

@karolyi karolyi changed the title Coffeescript suport Coffeescript support Jun 15, 2014
@Glavin001 Glavin001 self-assigned this Aug 4, 2014
@ericrange
Copy link

just open a coffeescript file and press ctrl alt b... nothing happens

@Glavin001
Copy link
Owner Author

It "works" in some files. For instance:

Before

hello   derek how is  it going?
for c, i in "Hello  World!"
  k = 1+1-  2>=3<=  4>5   <6

  for c, i  in "Hello  World"
    k = (a,b)-> if b?  return a

f  =  b()[0]
for c, i in "Hello World"
  f(b())

After

hello derek how is it going?
for c, i in "Hello  World!"
  k = 1 + 1 - 2 >= 3 <= 4 > 5 < 6

  for c, i in "Hello  World"
    k = (a, b) -> if b? return a

f = b()[0]
for c, i in "Hello World"
  f(b())

The problem is not Atom Beautify's support of CoffeeScript Beautification -- it is always beautifying when requested. The problem is that Coffee-Formatter seems to be not to work in all cases and misses quite a lot of indentation and other problems unless it is very obvious (see above example).

@Glavin001
Copy link
Owner Author

The source code is in Literate CoffeeScript and looks fairly well documented. If you have some known issues that you'd like to beautify / format however it is currently not working, potentially submitting a Pull Request to the Coffee-Formatter would be great.

@v3ss0n
Copy link

v3ss0n commented May 29, 2015

it uses default indentation for editor instead of default identation for coffeescript package?

Right now beautify makes 4 spaces indent , making linters unhappy.

@Glavin001
Copy link
Owner Author

it uses default indentation for editor instead of default identation for coffeescript package?

I'm not quite sure what you mean by default indentation for coffeescript package. I am not sure if CoffeeScript itself has a recommended default indentation size, however for Atom Beautify all settings are extracted from user configuration and can easily be changed to be what you want, such as the default indentation for coffeescript package as you described.

You can see the order of prioritized configurations at https://github.com/Glavin001/atom-beautify#configuration
In addition to .jsbeautifyrc you are able to use .editorconfig and Atom package settings for Atom Beautify, which provides the easiest view and descriptions for each option.

Right now beautify makes 4 spaces indent , making linters unhappy.

Then you can simply change it: see https://github.com/Glavin001/atom-beautify#configuration

@ironyinabox
Copy link

screen shot 2016-06-06 at 2 31 25 pm
and yet, it's still beautifying with 2 spaces of indent. What gives?

@Glavin001
Copy link
Owner Author

@ironyinabox please create a new issue and follow the Issue template structure.

More specifically, be sure to add a link to the required debug.md Gist which includes debugging information that answers our most commonly asked questions: https://github.com/Glavin001/atom-beautify/blob/master/ISSUE_TEMPLATE.md#how-to-create-debugmd-gist
Thank you.

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

No branches or pull requests

4 participants