1

When my cursor is over a command, I get its documentation. But if I right click the command and go to its definition, there I see the true state of affairs. Note how the parameters value and amount are reversed.

enter image description here In my code, I've always been passing amount, then value for this particular method, because that's what the documentation had always shown. Then one day I noticed the documentation for some commands was different from how I remembered it.

This method is from a redis package for python (https://github.com/andymccurdy/redis-py), and in that page they specifically note this change of argument order from version 2.X to 3.X. My IDE shows me the 2.X documentation, but uses the code of 3.X. I created a virtual environment, activated it, and installed the latest version of this package. A pip freeze inside my env confirms this: redis==3.5.0. And my IDE is set to use this env (bottom left corner in VSCode for mac).

Any idea what's going on here and how to fix this? Also, in case it's worth mentioning, when I was taking those screenshots, I noticed that if I hold down cmd while the incorrect documentation is showing, the correct documentation appears above it. I'm not sure what that does, never held cmd while hovering over a method before.

Peter Parker
  • 2,121
  • 1
  • 17
  • 23
  • I wonder if this isn't related to the [file content cache](https://stackoverflow.com/questions/45216264/clear-file-content-cache-in-visual-studio-code). I'm not sure what deleting this will achieve so maybe read up on it first before trying. – PeptideWitch May 01 '20 at 04:54
  • Thanks @PeptideWitch, but unfortunately it didn't do the trick. – Peter Parker May 01 '20 at 09:43
  • Which language server are you using? Jedi or MPLS? – Brett Cannon May 06 '20 at 22:26
  • @BrettCannon It's showing Microsoft as the language server. There's also a Jedi Enabled tick box and that is checked. And the Auto Update Language Server tick box is also checked. – Peter Parker May 07 '20 at 06:00
  • If `"python.jediEnabled": true`, then you're using Jedi. You can be extra sure by changing the `"python.languageServer"` setting to be in sync. If the problem persists then it's a bug in Jedi, otherwise it's a bug in MPLS. – Brett Cannon May 07 '20 at 20:27
  • @BrettCannon You're right! I unchecked the jedi box, and chose Microsoft as the language server, then I got the correct documentation. And if I check the jedi box and choose jedi as the language server, then I get the old documentation. Thank you for your help Bret. It's a dangerous bug. I wanted to backup one table into another and then delete the original. All the keys and values would have been swapped, and since keys have to be unique, all entries with the same value would have been lost except one. – Peter Parker May 10 '20 at 07:59
  • Please do report the bug to Jedi so they can possibly look into it. – Brett Cannon May 12 '20 at 20:30

0 Answers0