Python Code Insight
Here we speak about the Python code insight only, as the sections about code completion or navigation relate to the all the languages supported in PyCharm.
- Syntax highlighting
The PyCharm editor respects highlighting of the keywords, comments, parameters, type hints etc. The particular highlighting colors are defined in the Editor | Color Scheme page of the Settings/Preferences dialog.
- Code completion
PyCharm supports Code completion.
As PyCharm indexes your whole project on each startup, it allows you to autocomplete any existing entity wherever it is defined.
- Navigating to declaration
PyCharm allows you to navigate to a location where a particular named code reference has been first declared.
This is done most easily: just put the caret at the symbol in question in the editor and press Ctrl+B:
Refer to the Navigating to Declaration or Type Declaration of a Symbol section for details, and the entire Navigating Through the Source Code section to learn about the other types of navigation.
- Suggesting expressions
Consider the following code:
def f(x: str): print(chr(x.index('o')) * 42 + 'xxx')
Press Ctrl+Shift+P and see:
- Checking regular expressions
If your code contains a regular expression, there is an intention action to check it: just put the caret at the regular expression in question and press Alt+Enter. The RegExp checker shows up, and you have to type the string. If your string doesn't match, the background is red; if it does - green:
Read this section for details.
- Viewing reference documentation
With PyCharm, you don’t need to surf the web every time you stumble across some alias, or search your whole application for a method declaration you can’t remember. Just put the caret on a keyword you want to look up, and hit Ctrl+Q:
See Viewing Inline Documentation for details.