justinmahar / SublimeCSAutocompletePlus

CoffeeScript autocompletions and more!
172 stars 12 forks source link

Bug: Method name disappears when it starts with a $ #25

Closed Iristyle closed 11 years ago

Iristyle commented 11 years ago

A lot of the AngularJS functions start with $. Assume a simple class Foo

class Foo
  $doIt: () ->
    return ''

Let's use it in class Test...

When I type @foo. and TAB on $doIt, the completion is an empty set of parens () like below.

class Test
  # [Foo] foo
  constructor: (@foo) ->
    # Try to start autocomplete here... poof
    @foo.()
Iristyle commented 11 years ago

As I now remember, I ran into this previously in another context with the escaping business.

What was odd was that properties were working fine, but methods were not. So I needed something like this.

{
  "name": "Scope",
  "enabled": true,
  "constructors": [],
  "static_properties": [],
  "static_methods": [],
  "instance_properties": [
    {"name": "$id"}
  ],
  "instance_methods": [
    {"name": "\\$apply", "args": []}
  ]
}

So I took a look at your code, and see you're already handling this, but you missed a line in get_method_completion_insertion -- sending PR.