Sublime Forum

ST2: CoffeeComplete Plus

#1

I’ve been using CoffeeScript for a few months now and one thing I’ve been missing like crazy is autocompletions. Real autocompletions.

Well, they’re finally here. Autocompletions for CoffeeScript. It’s called CoffeeComplete Plus, or CC+.

This isn’t your run-of-the-mill hard-coded autocompletion plugin. This plugin scans your coffee files and determines which methods and properties you have been defined, even adds tap stops for parameters, and displays them in a sexy list for you to pick and choose. It does a ton of other things, like hide “private” members prefixed with an underscore, supports built-in types like Array, Math and Object, allows for custom types like jQuery (which is provided out of the box), and supports type hinting for method return values, or for the times the plugin is stumped.

Autocomplete looks like this:

○ property1
○ propertyTwo
○ someOtherProperty
● methodOne()
● methodTwo(arg1, arg2)
● theLastMethod(arg1, arg2, arg3)
Ⱶ○ inheritedProperty1
Ⱶ○ inheritedPropertyTwo
Ⱶ● inheritedMethod1()
Ⱶ● inheritedMethod2(arg1, arg2)

It also has a Goto Definition feature that allows you to jump to any class, method or variable definition. Even between files. Hells yeah. (Do this using ctrl+alt+d, or holding ctrl+alt and clicking on the name in the code.)

It’s also highly configurable.

Check it out, play around with it, and let me know what you think.

You can view the README here: http://bit.ly/13wHIoS

0 Likes

#2

Thumbs up!

0 Likes

#3

Big thanks! Realy awesome work!

0 Likes

#4

Wow, this is fantastic, I’ve been hanging out for something like this for so long!

If anyone wants to have the complete pop up automatically, you can add this to your user preferences:

[code]“auto_complete_triggers”:

	{"characters": ".@", "selector": "source.coffee"}
][/code]

Two questions:
Is it possible to autocomplete constructors somehow?
Is it possible to make properties in a custom type point to another custom type? I’m making a createjs custom type, and I’d to set up autocomplete for things like [Shape].graphics(.drawRect, .beginFill, etc)

0 Likes

#5

[quote=“AlexanderOcias”]
Is it possible to autocomplete constructors somehow?
Is it possible to make properties in a custom type point to another custom type? I’m making a createjs custom type, and I’d to set up autocomplete for things like [Shape].graphics(.drawRect, .beginFill, etc)[/quote]

These are both on my to-do list. I have some refactoring to do before either of these can be realized. Properties and methods will eventually have a type property defined in custom types. These will be used to look up the suggestions for chained calls. This will be particularly helpful when chaining jQuery calls, and for the case you mentioned.

0 Likes