Full Pycharm Tutorial (--pycharm) code highlighting and error mechanism for editor features

Source: Internet
Author: User
Tags change settings

1. Code highlighting

When you enter code in the edit box, Pycharm will analyze it in the background. The IDE can intelligently identify keywords, variables, strings, annotations, etc., and display them in different font colors. The Pycharm symbol color scheme is defined in Colors and Fonts Settings (ctrl+alt+s→IDE settings→editor→color and Fonts).

Let's start with the programming language, choose Python here, and then set the character color scheme according to your personal habits. However, the color scheme that comes with pycharm here is immutable, and we need to create a copy first and then change:

The current change settings are displayed in real time in the preview window until you are satisfied. Click Apply to close the Settings dialog box.

For more information, see Configuring Colors and Fonts.

2. Trigger Mark

Back in the Code section, if you want to know the number of times a symbol has been used, simply position the cursor on one of the symbols, the same symbol in the other location is highlighted, and the corresponding occurrence flag (stripe) is displayed in the right slot, and if you hover over the stripes, the mouse pointer The pycharm will give you more information:

3. Code Error hints

If Pycharm discovers an error during code analysis, it prompts you in the following way:

The error code is marked with a wavy red line, and a detailed error message is given when the mouse hovers over the wavy line.

The title bar's filename is also marked with a wavy red line, and the table of contents in the item window will have the same tag.

An error ID is displayed at the corresponding position in the right slot, and a detailed error message is given when the mouse pointer hovers over it.

These error identifiers can also serve as navigation, helping us to quickly define where errors occur.

Displays the status identification of the entire file at the top of the right slot. Green belt Everything is OK, yellow means there are some warnings, red means there are errors.

Of course, the color scheme of this error mechanism can also be changed, set in the General page of the Font and Color Settings dialog box (ctrl+alt+s→IDE settings→editor→colors and Fonts→general ):

4. Goodbye, handsome.

Attention to the lower left corner of the handsome guy head:

His name is Hector-the-inspector, responsible for the code error Correction check, click on the Avatar, will pop up a window, there is the code of the highlight degree adjuster:

If you are confident in your programming level, you can drag left to syntax or Hector Avatar None. In syntax position, the system will only give the syntax error highlighting, Hector Avatar only half. In the none position, the code correction function is completely closed, programming faster, but also more error-prone, corresponding to the Hector Avatar disappears.

However, this change is only valid for the current file.

If you want to change the code error correction mechanism, click the Configure inspections link for more information about the code error correction mechanism, refer to Codes Inspection tutorial in coding inspections.

Full Pycharm Tutorial (--pycharm) code highlighting and error mechanism for editor features

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.