Coder Social home page Coder Social logo

Comments (9)

aponxi avatar aponxi commented on July 21, 2024

You mean auto indenting and such? It doesn't have that option as it is highly difficult to tell what the scope is in the written text. It is like writing 1000 words without any punctuation and line break and trying to tell where the sentences end and paragraphs begin.

However:

  • if you are talking about eliminating trailing spaces there is another sublime plugin for that https://github.com/SublimeText/TrailingSpaces
  • If you are talking about converting tabs to spaces, then sublime can do that with a click.
  • if you want to convert javascript to coffeescript, js2coffee can convert into a nicely formatted coffeescript.

Does this help? :)

from sublime-better-coffeescript.

enginespot avatar enginespot commented on July 21, 2024

hmm... how to say, for examply , currently I am using webstorm , when I write coffeescript code , it can format my coffeescript code by the command "Code--> Reformat Code"
then the code style of coffeescript will be better

for http://jsbeautifier.org/ it can change js to a better style , so I think maybe Coffeescript can also change to a better style

from sublime-better-coffeescript.

aponxi avatar aponxi commented on July 21, 2024

Well look at this answer on Stack Overflow:

CoffeeScript code that runs properly should already be "beautiful", since most of it's characteristics are not optional.

If it runs, then it has proper indentation. Any other beauties can be indentations with tabs, with 2 spaces, 4 spaces, additional line breaks after a line break (after functions maybe) and spaces after a comma if there is none.

If that is what you are looking for, just tidying up, then it is a rather simple enhancement to make. And I will write it down in the to-do list.

Is that what you are looking for? If not please tell me what webstorm does when you reformat code.

from sublime-better-coffeescript.

enginespot avatar enginespot commented on July 21, 2024

it is not long word to description, so I put screenshot of webstorm , hope it helps
1
2
3
4

http://www.jetbrains.com/webstorm/webhelp/coffeescript-support.html

from sublime-better-coffeescript.

aponxi avatar aponxi commented on July 21, 2024

Okay! Thank you for the screenshots!

I will add this feature!

from sublime-better-coffeescript.

lavrton avatar lavrton commented on July 21, 2024

May be useful:
https://github.com/derekchiang/Coffee-Formatter
https://github.com/derekchiang/Sublime-CoffeeScript-Formatter

from sublime-better-coffeescript.

enginespot avatar enginespot commented on July 21, 2024

Hi lavrton
I have tried above tools, but it does not work well.

from sublime-better-coffeescript.

zakdances avatar zakdances commented on July 21, 2024

I think what @enginespot is describing is the case where you copy and paste some coffeescript from another source which is indented with 2 spaces (or a 2 space tab) but you want 4 spaces (or a 4 space tab). I've run into this same issue many times, and it is annoying because Sublime Text's indentation options don't correct this.

However, the Indentation: Reindent Lines command does attempt to apply the desired correction, and sometimes it succeeds.

from sublime-better-coffeescript.

lavrton avatar lavrton commented on July 21, 2024

I think there are only two ways to implement this.

  1. Someone should create own nodejs package for coffee formating. Then use it simular to coffeescript compiler with some configuration.
  2. Wait until some IDE project will publish free formating tool for coffeescripts.

from sublime-better-coffeescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.