Skip to content

Commit

Permalink
Fix issue #761, show detail information in completion candidate.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Nov 3, 2023
1 parent b50ccc5 commit 2d6ca13
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/handler/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ def process_response(self, response: dict) -> None:
# The key keyword combines the values ​​of 'label' and 'detail'
# to handle different libraries provide the same function.
key = f"{label}_{detail}"
display_label = label[:self.file_action.display_label_max_length] + " ..." if len(label) > self.file_action.display_label_max_length else label

# Get display label.
detail_label = f"{label} {detail}" # some language need show "detail" content, such as, rust
if len(detail_label) > self.file_action.display_label_max_length:
display_label = detail_label[:self.file_action.display_label_max_length] + " ..."
else:
display_label = detail_label

if display_new_text:
text_edit = item.get("textEdit", None)
Expand Down

0 comments on commit 2d6ca13

Please sign in to comment.