# Buggy code
def parse_lsp_config(self, config):
    """Parse and load LSP server editor capabilities."""
    sync_options = config["textDocumentSync"]
    completion_options = config["completionProvider"]
    signature_options = config["signatureHelpProvider"]
    range_formatting_options = config["documentOnTypeFormattingProvider"]
    self.open_close_notifications = sync_options["openClose"]
    self.sync_mode = sync_options["change"]
    self.will_save_notify = sync_options["willSave"]
    self.will_save_until_notify = sync_options["willSaveWaitUntil"]
    self.save_include_text = sync_options["save"]["includeText"]
    self.enable_hover = config["hoverProvider"]
    self.auto_completion_characters = completion_options["triggerCharacters"]
    self.signature_completion_characters = signature_options["triggerCharacters"]
    self.lsp_go_to_definition_enabled = config["definitionProvider"]
    self.find_references_enabled = config["referencesProvider"]
    self.highlight_enabled = config["documentHighlightProvider"]
    self.formatting_enabled = config["documentFormattingProvider"]
    self.range_formatting_enabled = config["documentRangeFormattingProvider"]
    self.formatting_characters.append(range_formatting_options["firstTriggerCharacter"])
    self.formatting_characters += range_formatting_options["moreTriggerCharacter"]


# Traceback (AttributeError)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\lsp\client.py", line 230, in on_msg_received
handler(resp['result'], req_id)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\lsp\providers\document.py", line 117, in process_document_completion
LSPRequestTypes.DOCUMENT_COMPLETION, {'params': response})
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\codeeditor.py", line 690, in handle_response
handler(params)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\codeeditor.py", line 790, in process_completion
self.completion_widget.show_list(completion_list, position)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\base.py", line 159, in show_list
self.update_current()
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\base.py", line 222, in update_current
completion_label = completion.lower()
AttributeError: 'dict' object has no attribute 'lower'

# Fixed code
def parse_lsp_config(self, config):
    """Parse and load LSP server editor capabilities."""
    sync_options = config["textDocumentSync"]
    completion_options = config["completionProvider"]
    signature_options = config["signatureHelpProvider"]
    range_formatting_options = config["documentOnTypeFormattingProvider"]
    self.open_close_notifications = sync_options["openClose"]
    self.sync_mode = sync_options["change"]
    self.will_save_notify = sync_options["willSave"]
    self.will_save_until_notify = sync_options["willSaveWaitUntil"]
    self.save_include_text = sync_options["save"]["includeText"]
    self.enable_hover = config["hoverProvider"]
    self.auto_completion_characters = completion_options["triggerCharacters"]
    self.signature_completion_characters = signature_options["triggerCharacters"]
    self.go_to_definition_enabled = config["definitionProvider"]
    self.find_references_enabled = config["referencesProvider"]
    self.highlight_enabled = config["documentHighlightProvider"]
    self.formatting_enabled = config["documentFormattingProvider"]
    self.range_formatting_enabled = config["documentRangeFormattingProvider"]
    self.formatting_characters.append(range_formatting_options["firstTriggerCharacter"])
    self.formatting_characters += range_formatting_options["moreTriggerCharacter"]