Skip to content

Commit

Permalink
Completion sorting now sorts, sections, not labels
Browse files Browse the repository at this point in the history
  • Loading branch information
pappasam committed May 23, 2020
1 parent 9eee181 commit fdc0b99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jedi_language_server/jedi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@ def complete_sort_name(name: Completion) -> str:
Should be passed to the sortText field in CompletionItem. Strings sort a-z,
a comes first and z comes last.
Additionally, we'd like to keep the sort order to what Jedi has provided.
For this reason, we make sure the sort-text is just a letter and not the
name itself.
"""
if name.type == "param" and name.name.endswith("="):
# params directly associated with filling out current function sig
return f"a{name.name}"
return f"z{name.name}"
return f"a"
return f"z"

0 comments on commit fdc0b99

Please sign in to comment.