mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-17 22:09:37 +08:00
Script.complete: sorting with underlines as last arguments
This commit is contained in:
+3
-2
@@ -86,7 +86,7 @@ class Script(object):
|
|||||||
"""
|
"""
|
||||||
An auto completer for python files.
|
An auto completer for python files.
|
||||||
|
|
||||||
:return: list of Completion objects.
|
:return: list of Completion objects, sorted by name and __ comes last.
|
||||||
:rtype: list
|
:rtype: list
|
||||||
"""
|
"""
|
||||||
path = self.module.get_path_until_cursor()
|
path = self.module.get_path_until_cursor()
|
||||||
@@ -146,7 +146,8 @@ class Script(object):
|
|||||||
c = [api_classes.Completion(
|
c = [api_classes.Completion(
|
||||||
c, needs_dot, len(like), s) for c, s in completions]
|
c, needs_dot, len(like), s) for c, s in completions]
|
||||||
|
|
||||||
return c
|
return sorted(c, key=lambda x: (x.word.startswith('__'),
|
||||||
|
x.word.lower()))
|
||||||
|
|
||||||
def _prepare_goto(self, goto_path, is_like_search=False):
|
def _prepare_goto(self, goto_path, is_like_search=False):
|
||||||
""" Base for complete, goto and get_definition. Basically it returns
|
""" Base for complete, goto and get_definition. Basically it returns
|
||||||
|
|||||||
Reference in New Issue
Block a user