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