Repository: spyder-ide/spyder

Issue:
IndexError in Kite completitons 
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

type rang and click on the tab on the keyboard for auto-completion. Spyder rises and error. 

I think it is related to kite.

### Traceback
```python-traceback
  File "C:\Users\kalho\Desktop\spyder\spyder\spyder\plugins\completion\kite\client.py", line 112, in perform_request
    response = converter(response)
  File "C:\Users\kalho\Desktop\spyder\spyder\spyder\plugins\completion\kite\providers\document.py", line 198, in process_signature
    signature = signatures[0]
IndexError: list index out of range
```

## Versions

* Spyder version: 4.0.0.dev0 417360c7b
* Python version: 3.7.3
* Qt version: 5.9.7
* PyQt5 version: 5.9.2
* Operating System: Windows 10

### Dependencies

```
cloudpickle >=0.5.0          :  1.2.2 (OK)
pygments >=2.0               :  2.4.2 (OK)
qtconsole >=4.5.5            :  4.5.5 (OK)
nbconvert >=4.0              :  5.6.0 (OK)
sphinx >=0.6.6               :  2.2.0 (OK)
pylint >=0.25                :  2.3.1 (OK)
psutil >=0.3                 :  5.6.3 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  18.1.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.5.0;<2.0.0:  1.5.0 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  None (NOK)
cython >=0.21                :  None (NOK)
IPython >=4.0                :  7.8.0 (OK)
matplotlib >=2.0.0           :  None (NOK)
pandas >=0.13.1              :  None (NOK)
numpy >=1.7                  :  None (NOK)
scipy >=0.17.0               :  None (NOK)
pyls >=0.28.2;<0.29.0        :  0.28.3 (OK)
rtree >=0.8.3                :  0.8.3 (OK)
```



Discussion:
@dalthviz, please take a look at this one.
> click on tab on the keyboard for auto-completyion

So you deactivated completions on the fly?
No, even if I do not click tab still the same error appears.

like typing 

`for i in range(10):`

![vug_cpmpletion](https://user-images.githubusercontent.com/22060413/64926213-f2f96980-d7f2-11e9-9e8f-631d883d8e71.gif)


The error does not appear if I deactivate Kite. 

Resolving patch:
diff --git a/spyder/plugins/completion/kite/providers/document.py b/spyder/plugins/completion/kite/providers/document.py
--- a/spyder/plugins/completion/kite/providers/document.py
+++ b/spyder/plugins/completion/kite/providers/document.py
@@ -195,19 +195,22 @@ def process_signature(self, response):
                 signatures = call['signatures']
                 arg_idx = call['arg_index']
 
-                signature = signatures[0]
                 parameters = []
                 names = []
-                logger.debug(signature)
-                for arg in signature['args']:
-                    parameters.append({
-                        'label': arg['name'],
-                        'documentation': ''
-                    })
-                    names.append(arg['name'])
-
-                func_args = ', '.join(names)
-                call_label = '{0}({1})'.format(call_label, func_args)
+
+                logger.debug(signatures)
+                if len(signatures) > 0:
+                    signature = signatures[0]
+                    logger.debug(signature)
+                    for arg in signature['args']:
+                        parameters.append({
+                            'label': arg['name'],
+                            'documentation': ''
+                        })
+                        names.append(arg['name'])
+
+                    func_args = ', '.join(names)
+                    call_label = '{0}({1})'.format(call_label, func_args)
 
                 base_signature = {
                     'label': call_label,


Test patch: