@@ -193,6 +193,27 @@ def test_snippets_completion(config, workspace):
193193 com_position = {'line' : 1 , 'character' : len (doc_snippets )}
194194 completions = pyls_jedi_completions (config , doc , com_position )
195195 assert completions [0 ]['insertText' ] == 'defaultdict($0)'
196+ assert completions [0 ]['insertTextFormat' ] == lsp .InsertTextFormat .Snippet
197+
198+
199+ def test_completion_with_class_objects (config , workspace ):
200+ doc_text = 'class FOOBAR(Object): pass\n FOOB'
201+ com_position = {'line' : 1 , 'character' : 4 }
202+ doc = Document (DOC_URI , workspace , doc_text )
203+ config .capabilities ['textDocument' ] = {
204+ 'completion' : {'completionItem' : {'snippetSupport' : True }}}
205+ config .update ({'plugins' : {'jedi_completion' : {
206+ 'include_params' : True ,
207+ 'include_class_objects' : True ,
208+ }}})
209+ completions = pyls_jedi_completions (config , doc , com_position )
210+ assert len (completions ) == 2
211+
212+ assert completions [0 ]['label' ] == 'FOOBAR'
213+ assert completions [0 ]['kind' ] == lsp .CompletionItemKind .Class
214+
215+ assert completions [1 ]['label' ] == 'FOOBAR object'
216+ assert completions [1 ]['kind' ] == lsp .CompletionItemKind .TypeParameter
196217
197218
198219def test_snippet_parsing (config , workspace ):
0 commit comments