question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in code completion when case-sensitive completions are disabled

See original GitHub issue

Description

What steps will reproduce the problem?

When I disabled case-sensitive completion (really, enabled case-insensitive completion) and typed import os. (which triggered automatic dot completion), the below error was triggered. Clearly, it expects a string to normalize case of, while in fact its operating on a dict.

Furthermore, completion, help, introspection etc. stopped working completely thereafter; I had to completely restart Spyder to get it back. Since this has been a very frequent outcome of virtually any LSP-related problem I’ve reported (as well as most others I’ve seen), is there a way to attempt to restart the completion server either manually or automatically without doing a full Spyder restart? We should really handle this more gracefully…

Traceback

  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'

Versions

  • Spyder version: 4.0.0.dev0 a411d61d7
  • Python version: 3.7.2
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 8.1

Dependencies

pygments >=2.0    :  2.3.1 (OK)
qdarkstyle >=2.6.4:  2.6.5 (OK)
sphinx >=0.6.6    :  1.8.4 (OK)
pyls >=0.19.0     :  0.21.5 (OK)
nbconvert >=4.0   :  5.4.0 (OK)
pandas >=0.13.1   :  0.24.1 (OK)
numpy >=1.7       :  1.15.4 (OK)
sympy >=0.7.3     :  1.3 (OK)
cython >=0.21     :  0.29.4 (OK)
qtconsole >=4.2.0 :  4.4.3 (OK)
IPython >=4.0     :  7.2.0 (OK)
matplotlib >=2.0.0:  3.0.2 (OK)
pylint >=0.25     :  2.2.2 (OK)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ccordoba12commented, Feb 21, 2019

Are you referring to something other than the #8816 I just submitted?

No, I’m referring to #8609.

This is a known issue

I meant that me and @steff456 are aware of these bugs. You are a core-dev, not a simple user, so please consult us in private if there’s a need to open an issue about this or not. For us, issue #8609 was enough.

0reactions
CAM-Gerlachcommented, Feb 21, 2019

No, I’m referring to #8609.

Sorry, I had no indication there that the underlying issue there was not an issue with the Automatic Code Completion feature, but rather that they were all the old options from the previous architecture.

please consult us in private if there’s a need to open an issue about this or not

Will do for any issues going forward, thanks. 👍 I actually had been doing on Gitter for most issues recently, but I wasn’t sure if I was annoying you and cluttering it up by asking you there first all the time and I didn’t always hear back since you’re very busy.

And I also mentioned on issue #7724 that we needed to figure out what to do with the old Editor preferences.

Right; as I mentioned above I failed to see it buried on #8647 's timeline, sorry. If I hadn’t missed seeing that, I wouldn’t have considered posting this since that does make it clear. Its generally a good practice to put the issue reference in the body of the PR post, as we have been done on most other PRs referencing a meta issue, to keep things organized and avoid it being missed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Case-insensitive code completion
Hi,How can I enable case-insensitive code completion in AppCode please? I have the latest EAP and I can't find any options to do...
Read more >
Disable case sensitive auto-completion, while "smartcase ...
Now, when the popup menu opens up, noignorecase will be turned on and only case-sensitive completions will be listed.
Read more >
Disabling Automatic Code Completion makes completion, analysis ...
However, when it is turned off, completion, calltips and even code/style ... Error in code completion when case-sensitive completions are disabled #8815.
Read more >
MacOS - tab completion to be case insensetive - terminal zsh
On the terminal, I want tab completions to ignore case-sensitive files / directories. i.e both cd Documents and cd documents should work. Most ......
Read more >
IntelliJ IDEA 12 code completion without capitalisation
You can disable the case sensitivity of the code completion in the settings menu: File -> Settings -> Editor -> Code completion ->...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found