3

After updating Spyder to 4.0.0, I cannot see any checkbox to turn on or off the "Real-time code analysis"

Here we can see the menu steps that cannot be found anymore: How to suppress a certain warning in Spyder editor? Which contains: You need to go to [Tools > Preferences > Editor > Code Introspection/Analysis and deactivate the option called Real-time code analysis]

For versions up to 4.1.3 inclusive, there are the following problems, probably only on Windows:

  • I am not able to turn on the warnings that e.g. show which variables are unknown. Normally, if i move code to a separate function, I find out all the needed parameters for the function by just scrolling through the red lines in the code.

  • Even the normal code completion does not work. First, nothing is popping up after 3 letters entered after the dot. And then, when Spyder seems to start searching, it is not reacting anymore.

questionto42
  • 7,175
  • 4
  • 57
  • 90
  • If code completion and linting are not working for you, that's a bug. Please report it [here](https://github.com/spyder-ide/spyder/issues) and add a screenshot of your problem. – Carlos Cordoba Dec 09 '19 at 16:14
  • I have seen your comment only now. I have added the comments below to a new link https://github.com/spyder-ide/spyder/issues/10993 – questionto42 Dec 09 '19 at 19:10

3 Answers3

5

(Spyder maintainer here) Code analysis options in Spyder 4 were significantly expanded and moved to a new entry in our preferences called Completion and linting, as shown below:

enter image description here

To deactivate all linting (which was called before "Real-time code analysis"), you need to turn off the option called Enable basic linting in the screenshot above.

Please update to version 4.1.4 or higher to avoid the mentioned bug on Windows.

questionto42
  • 7,175
  • 4
  • 57
  • 90
Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
  • Now I have used the linting to add the needed passed parameters, but the linting has not disappeared, with error "Undefined Name '....' (pyflakes E), although that variable is a passed parameter to the function in which I use it. I do not know if this is still related to the question, but the linting does at least not work as it had before, I expected any underline to go away as soon as the variable is known in the function. Probably I have to change something in the pyflakes setup to refresh automatically? Thank you. – questionto42 Dec 09 '19 at 18:36
  • I have set linting - "Enable basic linting" and "Underline errors and warnings" of and on again, all of the red lines are gone, also where they still should be, and red x circles on the left show the same "undefined name …" error at positions where the parameter is definitely already known. – questionto42 Dec 09 '19 at 18:45
  • The problems have not disappeared, though I had a working linting for a while. Spyder has crashed 3 times today, linting worked only sometimes, and now linting is there, but without refreshing, that means not disappearing when I have already added the missing parameter. – questionto42 Dec 10 '19 at 19:10
  • 1
    I get false warnings every time I rename a variable. It flags me that "old variable name" is assigned to but never use. Coupled with all the crashes I get everyday, I honestly don't know what I'm waiting for to switch to a different IDE... – redguy Mar 02 '20 at 09:51
  • 1
    Linting and code completion are still not working for me. I raised an issue on the Spyder Github site and was told it would be fixed in 4.1.2. I have now upgraded and even done a "factory reset" but no luck. In the status bar it says "LSP Python: Ready" which I believe means the linting engine is running, and I have all settings for linting and code completion turned on, but nothing happens. – Mark Kortink Apr 22 '20 at 01:12
  • In version 4.1.4, linting still does not work, code completion does. See the new screenshots. – questionto42 Jul 24 '20 at 20:29
  • Sorry to hear that. You need to give us a way to reproduce those errors though. Otherwise, we won't be able to fix them. – Carlos Cordoba Jul 24 '20 at 20:54
2

The problems have been fixed by Spyder version 4.1.4, please just update your Spyder. Use the update steps on https://github.com/spyder-ide/spyder/releases.

ccordoba12 on GitHub has the good news, see again: https://github.com/spyder-ide/spyder/issues/10993#issuecomment-647616536

We had a long time trying to figure out why code completion and linting were failing. However, I think we finally nailed the issue: it was a problem that only appeared on Windows and @OverLordGoldDragon was critical in providing us a reproducible use case with which I could finally fix it. The fix will be available in our next version (4.1.4), to be released by the end of this week or early during the next one.

questionto42
  • 7,175
  • 4
  • 57
  • 90
1

Workaround for versions 4.0.0 till 4.1.3

result of github help: start spyder in debug mode with

spyder --debug-info verbose --debug-output file

see https://github.com/spyder-ide/spyder/issues/10993#issuecomment-563414784

The debug mode gives back all the code analysis features. You can probably drop the --debug-output file (untested). For versions 4.0.0 till 4.1.4 you need to start Spyder always like this, else the missing linting returns (at least on Windows). This bug was fixed with Spyder 4.1.4.

questionto42
  • 7,175
  • 4
  • 57
  • 90