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

Switch to using coffee-fmt package for beautifying CoffeeScript #192

Closed
shprink opened this issue Jan 24, 2015 · 7 comments
Closed

Switch to using coffee-fmt package for beautifying CoffeeScript #192

shprink opened this issue Jan 24, 2015 · 7 comments

Comments

@shprink
Copy link

shprink commented Jan 24, 2015

Hi,

Your plugin do not support CoffeeScript but still format it when saving (On save enabled).

it screws my doc block:

###
@ngdoc directive
@name wordpress-hybrid-client:wphcLoader
@restrict E
@description
A simple loader
@example
<pre>
</pre>
###

to this:

###
@ngdoc directive
@name wordpress - hybrid - client: wphcLoader
@restrict E
@description
A simple loader
@example
       < pre >
</pre >
###

When your plugin is disabled it is fine.

Thanks

@Glavin001 Glavin001 self-assigned this Jan 24, 2015
@Glavin001 Glavin001 added this to the v1.0.0 milestone Jan 24, 2015
@shprink
Copy link
Author

shprink commented Jan 24, 2015

Actually it seems that you support CoffeeScript but I do not see any specific options for it in the settings.

@shprink
Copy link
Author

shprink commented Jan 24, 2015

A really good feature would be to be able to activate/desactivate a specific file format. For instance this plugins https://github.com/atom/language-coffee-script seems to handle coffeescript better.

Cheers

@Glavin001
Copy link
Owner

CoffeeScript beautification support comes from https://github.com/derekchiang/Coffee-Formatter which is unfortunately not actively maintained. I am open to any alternatives.

For instance this plugins https://github.com/atom/language-coffee-script seems to handle coffeescript better.

That supports CoffeeScript beautification?

@sterpe
Copy link

sterpe commented Feb 9, 2015

@Glavin001, @shprink I've been working on an npm module for coffee script reformatting, (like changing tabs to arbitrary # of spaces or vice versa). It's built on top of coffee-scripts own tokenizer (which is still pretty ambiguous). Still very much beta, but it does at least transform the above docblock correctly.

Maybe you guys could check it out see how it performs.

https://www.npmjs.com/package/coffee-fmt

@Glavin001
Copy link
Owner

Great @sterpe ! I would love to support this and switch from Coffee-Formatter to your Coffee-fmt. Let me know once you think it's at an acceptable state for switching over and what the Node API is that I can use (see https://github.com/Glavin001/atom-beautify/blob/master/lib/langs/coffeescript-beautify.coffee ). Thanks!

@Glavin001 Glavin001 changed the title CoffeeScript problem Switch to using coffee-fmt package for beautifying CoffeeScript May 3, 2015
@Glavin001
Copy link
Owner

Hey @sterpe, what is the status of coffee-fmt? If you are confident that it can replace Coffee-Formatter than I can support that. Let me know what you think 😃.

@Glavin001
Copy link
Owner

Published to v0.26.0

coffee-fmt is now the default CoffeeScript beautifier, deprecating Coffee-Formatter. Thanks for the awesome work so far, @sterpe !

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

3 participants