Skip to content

Commit

Permalink
Use first line of detail string in completion menu
Browse files Browse the repository at this point in the history
Fixes remaining issue in #16

Some servers send multiline detail strings in completion suggestions.
Split to just the first line to avoid ugly characters and long menu.
  • Loading branch information
natebosch committed Jun 28, 2017
1 parent 8f4196b commit 8278065
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.2.2-dev
# 0.2.2

- Completion Improvements:
- Bug fix: Don't leave an extra character when completing after typing 3
Expand All @@ -9,6 +9,7 @@
list.
- Use the `triggerCharacters` suggested by the server instead of `.`
exclusively.
- Use only the first line of suggestion detail in completion menu
- Bug Fix: Send and allow a space before header content.

# 0.2.1
Expand Down
2 changes: 1 addition & 1 deletion autoload/lsc/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function! s:CompletionItem(completion_item) abort
let item.kind = s:CompletionItemKind(a:completion_item.kind)
endif
if has_key(a:completion_item, 'detail') && a:completion_item.detail != v:null
let item.menu = a:completion_item.detail
let item.menu = split(a:completion_item.detail, "\n")[0]
endif
if has_key(a:completion_item, 'documentation')
\ && a:completion_item.documentation != v:null
Expand Down

0 comments on commit 8278065

Please sign in to comment.