@@ -45,6 +45,7 @@ def __init__( self, user_options ):
45
45
self ._environment_for_file = {}
46
46
self ._environment_for_interpreter_path = {}
47
47
self ._sys_path_for_file = {}
48
+ self .signature_triggers .SetServerSemanticTriggers ( [ '(' , ',' ] )
48
49
49
50
50
51
def SupportedFiletypes ( self ):
@@ -187,12 +188,40 @@ def _GetExtraData( self, completion ):
187
188
188
189
def ComputeCandidatesInner ( self , request_data ):
189
190
with self ._jedi_lock :
191
+ completions = self ._GetJediScript ( request_data ).completions ()
190
192
return [ responses .BuildCompletionData (
191
193
insertion_text = completion .name ,
192
194
# We store the Completion object returned by Jedi in the extra_data
193
195
# field to detail the candidates once the filtering is done.
194
196
extra_data = completion
195
- ) for completion in self ._GetJediScript ( request_data ).completions () ]
197
+ ) for completion in completions ]
198
+
199
+
200
+ def ComputeSignaturesInner ( self , request_data ):
201
+ with self ._jedi_lock :
202
+ signatures = self ._GetJediScript ( request_data ).call_signatures ()
203
+
204
+ active_signature = 0
205
+ active_parameter = 0
206
+ for index , signature in enumerate ( signatures ):
207
+ if signature .index is not None :
208
+ active_signature = index
209
+ active_parameter = signature .index
210
+ break
211
+
212
+ return {
213
+ 'activeSignature' : active_signature ,
214
+ 'activeParameter' : active_parameter ,
215
+ 'signatures' : [
216
+ {
217
+ 'label' : s .description + '( ' + ', ' .join (
218
+ [ p .description [ 6 : ] for p in s .params ] ) + ' )' ,
219
+ 'parameters' : [
220
+ { 'label' : p .description [ 6 : ] } for p in s .params
221
+ ],
222
+ } for s in signatures
223
+ ]
224
+ }
196
225
197
226
198
227
def DetailCandidates ( self , request_data , candidates ):
0 commit comments