justinmahar / SublimeCSAutocompletePlus

CoffeeScript autocompletions and more!
172 stars 12 forks source link

Specify return types in CoffeeComplete Plus Custom Types.sublime-settings #21

Open Iristyle opened 11 years ago

Iristyle commented 11 years ago

As it stands, return types may be specified in CoffeeComplete Plus.sublime-settings like this

{
  // Map function names to types.
  "coffee_autocomplete_plus_function_return_types": 
  [
    {
      "function_names": ["$", "jQuery"],
      "type_name": "$"
    }
  ]
}

Even though it's a bit more work to specify return types on custom types, I think that it's more appropriate. IMHO, return types belong in the same file with the definitions found in CoffeeComplete Plus Custom Types.sublime-settings

So to use jQuery as an example

{"name":"add", "args": [{"name": "selector"}]}

Would become something like

{"name":"add", "args": [{"name": "selector"}], "returns": "$"}

A little more tedious indeed, but a lot more flexible. (I'm baking out all the completions for AngularJS right now and find this to be a bit of an issue.)