File tree Expand file tree Collapse file tree 2 files changed +36
-3
lines changed
Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,9 @@ and complete members."
216216 . ,(omnisharp--t-or-json-false
217217 omnisharp-auto-complete-want-importable-types))
218218
219- (WordToComplete . ,(thing-at-point 'symbol )))
219+ (WordToComplete . ,(thing-at-point 'symbol ))
220+
221+ (WantKind . t ))
220222
221223 (omnisharp--get-request-object)))
222224
@@ -672,15 +674,45 @@ is a more sophisticated matching framework than what popup.el offers."
672674 (when required-namespace-import
673675 (omnisharp--insert-namespace-import required-namespace-import)))))
674676
677+ (defun omnisharp--convert-auto-complete-kind-to-popup-symbol-value (kind )
678+ (pcase kind
679+ ; ; auto-complete's recommended rules
680+ ; ;; Symbol
681+ (" Keyword" " s" )
682+ ; ;; Function, Method
683+ (" Method" " f" )
684+ (" Function" " f" )
685+ (" Constructor" " f" )
686+ ; ;; Variable
687+ (" Field" " v" )
688+ (" Variable" " v" )
689+ (" Property" " v" )
690+ ; ;; Constant
691+ ; ;; Abbreviation
692+ (" Value" " a" )
693+ ; ; original rules
694+ (" Text" " " )
695+ (" Class" " t" )
696+ (" Interface" " i" )
697+ (" Enum" " e" )
698+ (" Module" " m" )
699+ (" Unit" " u" )
700+ (" Snippet" " " )
701+ (" Color" " " )
702+ (" File" " f" )
703+ (" Reference" " r" )))
704+
675705(defun omnisharp--convert-auto-complete-result-to-popup-format (json-result-alist )
676706 (mapcar
677707 (-lambda ((&alist 'DisplayText display-text
678708 'CompletionText completion-text
679709 'Description description
680710 'Snippet snippet
681- 'RequiredNamespaceImport require-ns-import))
711+ 'RequiredNamespaceImport require-ns-import
712+ 'Kind kind))
682713 (popup-make-item display-text
683714 :value (propertize completion-text 'Snippet snippet 'RequiredNamespaceImport require-ns-import)
715+ :symbol (omnisharp--convert-auto-complete-kind-to-popup-symbol-value kind)
684716 :document description))
685717 json-result-alist))
686718
Original file line number Diff line number Diff line change @@ -251,7 +251,8 @@ expected output in that buffer"
251251 (RequiredNamespaceImport . nil )
252252 (DisplayText . " Verbosity Verbose - display text" )
253253 (Description . , description )
254- (CompletionText . , completion-text ))])
254+ (CompletionText . , completion-text )
255+ (Kind . " Verbose" ))])
255256 (converted-popup-item
256257 (nth 0
257258 (omnisharp--convert-auto-complete-result-to-popup-format
You can’t perform that action at this time.
0 commit comments