# Buggy code
def __init__(self, parent, plugins=["lsp", "kite", "fallback"]):
    SpyderCompletionPlugin.__init__(self, parent)
    self.clients = {}
    self.requests = {}
    self.language_status = {}
    self.started = False
    self.req_id = 0
    self.collection_mutex = QMutex()

    for plugin in plugins:
        if plugin in self.BASE_PLUGINS:
            Plugin = self.BASE_PLUGINS[plugin]
            plugin_client = Plugin(self.main)
            self.register_completion_plugin(plugin_client)


# Traceback (TypeError)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1219, in handle_go_to_definition
def_range = position['range']
TypeError: string indices must be integers

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\logging\__init__.py", line 1034, in emit
msg = self.format(record)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\logging\__init__.py", line 880, in format
return fmt.format(record)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\logging\__init__.py", line 619, in format
record.message = record.getMessage()
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\logging\__init__.py", line 380, in getMessage
msg = msg % self.args
ValueError: incomplete format
Call stack:
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\Scripts\spyder-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\app\start.py", line 196, in main
mainwindow.main()
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\app\mainwindow.py", line 3646, in main
mainwindow = run_spyder(app, options, args)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\app\mainwindow.py", line 3529, in run_spyder
app.exec_()
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\completion\languageserver\client.py", line 343, in on_msg_received
handler(resp['result'], req_id)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\completion\languageserver\providers\document.py", line 195, in process_go_to_definition
{'params': result})
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\completion\languageserver\plugin.py", line 279, in receive_response
self.COMPLETION_CLIENT_NAME, req_id, response)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\completion\plugin.py", line 138, in receive_response
self.gather_and_send(request_responses)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\completion\plugin.py", line 189, in gather_and_send
response_instance.handle_response(req_type, responses)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 915, in handle_response
handler(params)
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1236, in handle_go_to_definition
"Error when processing go to definition")
File "C:\Users\Amin\Anaconda3\envs\spyder-beta\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 946, in log_lsp_handle_errors
logger.error('%', 1, stack_info=True)
Message: '%'
Arguments: (1,)

# Fixed code
def __init__(self, parent, plugins=["lsp", "kite", "fallback"]):
    SpyderCompletionPlugin.__init__(self, parent)
    self.clients = {}
    self.requests = {}
    self.language_status = {}
    self.started = False
    self.req_id = 0
    self.collection_mutex = QMutex(QMutex.Recursive)

    for plugin in plugins:
        if plugin in self.BASE_PLUGINS:
            Plugin = self.BASE_PLUGINS[plugin]
            plugin_client = Plugin(self.main)
            self.register_completion_plugin(plugin_client)