Skip to content

Commit

Permalink
Put private members or internal methods in the bottom in completion.
Browse files Browse the repository at this point in the history
  • Loading branch information
edelvalle committed Jul 30, 2017
1 parent 55739e2 commit abde9f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions super_elixir/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def on_query_completions(self, view, prefix, locations):
return completions

def _sort_by_frequency_in_view(self, buffer, completions):
for completion in completions:
completion['count'] = buffer.count(completion['name'])

completions.sort(key=lambda c: (-c['count'], c['name']))
completions.sort(key=lambda c: (
-buffer.count(c['name']),
len(c['name']) - len(c['name'].strip('_')),
c['name'],
))
return completions

def on_hover(self, view, point, hover_zone):
Expand Down

0 comments on commit abde9f2

Please sign in to comment.