6

I'll commonly be writing in a jupyter notebook and need a function signature/docstring, so I'll do something like type out print() and then with the cursor between the parentheses press shift+tab. Is there something comparable in pycharm?

I have General-Code Completion settings on, and as I'm typing "print" in pycharm it will show me the signature, but as soon as I type the opening parenthesis the signature/docs go away. I find myself often writing the function name, looking at the doc, then writing the () and maybe one arg, before having to go to a newline or something and rewrite the function name so I get the docstring again. What is a better workflow for this?


EDIT: Based on feedback, some extra images are below. ctrl+space was suggested, but that isn't giving me what I'm hoping for.

If I type the function name without parentheses, I see this: enter image description here

which is perfect. But when I hit left parenthesis the description goes away, and if I hit ctrl+space as suggested I get: enter image description here

after one ctrl+space, and: enter image description here after two ctrl+space. Clearly both aren't the same, they're offering auto complete for other things. Is there some setting I need to change?

Also, ctrl+P doesn't do anything for me - maybe I unbound the default at some point?

Andrew
  • 459
  • 5
  • 15

6 Answers6

2

I believe Ctrl+Q is what you were after? (Most likely you would have found it by now though :))

Type in a function and within parenthesis press Ctrl+Q and it will show you the method's documentation.

factorThis
  • 74
  • 5
1

While in the parenthesis press Ctrl + Space and you would get all the related suggestions.

Obaid Ur Rehman
  • 324
  • 2
  • 15
  • 1
    I've added some detail to the post addressing this. Ctrl+P and Ctrl+Space don't seem to do it. I should also say I'm on mac which can change things a little, but I think I'm still using the equivalent binding. – Andrew Mar 22 '19 at 20:24
  • 1
    I'm unsure as I never use mac but try Ctrl+alt+Space – Obaid Ur Rehman Mar 23 '19 at 15:34
  • 1
    I've been testing everything on my windows machine too just in case (if I see it working on windows, I can look up the command to map on mac). ctrl+alt+space doesn't do it either, it offers me auto complete options that are the same as ctrl+space twice. What is bound to your ctrl+alt+space, maybe it isn't the default command? – Andrew Mar 23 '19 at 15:37
  • 1
    Can you upload a screenshot of what Shift+tab in Jupyter's does ? – Obaid Ur Rehman Mar 24 '19 at 09:00
1

It does not exist. I know people like PyCharm, but I cannot figure out why when features like this are missing. So many other pluses to PyCharm, but this missing one hurts. The workaround is not close to an efficient workflow.

AngusE
  • 13
  • 1
  • 6
1

enter image description here

I think this is what you are looking for, Press CTRL+j in parenthesis for mac. Please wait for 2 sec to load.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
0

Try cmd + B on the function and it takes you to the function location that you are trying to inspect. Not quite like the Jupyter shift + tab but gets the job done

dippas
  • 58,591
  • 15
  • 114
  • 126
Iman Haji
  • 1
  • 1
0

Hit F1 once you're in the parentheses

Tom
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 29 '23 at 02:01