@@ -78,6 +78,7 @@ function! s:StdioGetCompletions(partial, opts, Callback) abort
78
78
\ ' WantDocumentationForEveryCompletionResult' : wantDoc,
79
79
\ ' WantSnippet' : wantSnippet,
80
80
\ ' WantMethodHeader' : ' true' ,
81
+ \ ' WantKind' : ' true' ,
81
82
\ ' WantReturnType' : ' true'
82
83
\}
83
84
let opts = {
@@ -117,6 +118,7 @@ function! s:StdioGetCompletionsRH(Callback, wantDocPopup, response) abort
117
118
\ ' word' : word,
118
119
\ ' menu' : menu ,
119
120
\ ' icase' : 1 ,
121
+ \ ' kind' : s: ToKind (cmp .Kind),
120
122
\ ' dup' : g: OmniSharp_completion_without_overloads ? 0 : 1
121
123
\}
122
124
if a: wantDocPopup
@@ -132,6 +134,20 @@ function! s:StdioGetCompletionsRH(Callback, wantDocPopup, response) abort
132
134
call a: Callback (completions, a: wantDocPopup )
133
135
endfunction
134
136
137
+ function ! s: ToKind (roslynKind)
138
+ " Values defined in:
139
+ " https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Abstractions/Models/v1/Completion/CompletionItem.cs#L104C6-L129C28
140
+ let variable = [' Color' , ' Event' , ' Field' , ' Keyword' , ' Variable' , ' Value' ]
141
+ let function = [' Constructor' , ' Function' , ' Method' ]
142
+ let member = [' Constant' , ' EnumMember' , ' Property' , ' TypeParameter' ]
143
+ let typedef = [' Class' , ' Enum' , ' Interface' , ' Module' , ' Struct' ]
144
+ return
145
+ \ index (variable, a: roslynKind ) >= 0 ? ' v' :
146
+ \ index (function , a: roslynKind ) >= 0 ? ' f' :
147
+ \ index (member, a: roslynKind ) >= 0 ? ' m' :
148
+ \ index (typedef , a: roslynKind ) >= 0 ? ' t' : ' '
149
+ endfunction
150
+
135
151
function ! s: CBGet (opts, completions, ... ) abort
136
152
let s: last_completions = a: completions
137
153
let s: complete_pending = 0
0 commit comments