This page hasn't been translated yet. You can help us translate this page.

Extensions

Code Formatting

Clang Format

Clang Format is used to format the C/C++ and Java codes. You can click Actions->Format Code or press the shortcut Ctrl+Shift+I to format the codes. If you have selected a part of the code, only the selection (and its necessary adjacent codes) will be formatted.

See also Setup Clang Format .

Program

The path to the clang-format executable, or simply clang-format if it’s in the PATH environment variable.

Arguments

The arguments passed to clang-format. It should NOT contain -i (the in-place modification option).

Style

The Clang Format style. The content here is the same as the content of a .clang-format file.

You can read Clang-Format Style Options documentation or search for other materials to learn how to write the styles.

YAPF

YAPF is used to format the Python codes. You can click Actions->Format Code or press the shortcut Ctrl+Shift+I to format the codes. If you have selected a part of the code, only these lines will be formatted.

See also Setup YAPF .

Program

The program of YAPF. It could be one of:

  • yapf: You should be able to run yapf in the command line. The arguments can be empty.
  • A Python interpreter, i.e. python, python2, etc. or the path to an interpreter. The arguments should be -m yapf.

Note that you need to use Python 2 to format Python 2, use Python 3 to format Python 3 . So you may need to choose the correct Python interpreter.

Arguments

The arguments passed to the YAPF program. This should be -m yapf if the program is a Python interpreter. It should NOT contain -i (the in-place modification option).

Style

The YAPF Format style. The content here is the same as the content of a .style.yapf file. You can check all possible configurations by running yapf --style-help, read the documentation or search for other materials to learn how to write the styles.

Language Server

See also Setup Language Server .

Use Linting with Language Server

Use language server to lint errors, warnings, hints, etc.

You can hover over the squiggles to see the tooltips for the explanation of the errors/warnings.

Delay in Linting

Update linting if you haven’t been typing for delay milliseconds.

Path to LSP executable

The path to the language server program, or the name if it’s in the PATH environment variable.

Arguments for Language Server

Additional arguments for the language server program. See the documentation of the language server program you are using for more information.

For example, if you are using pyls for Python, you probably want to use python as the language server program, and use -m pyls as the arguments.

Competitive Companion

See also Setup Competitive Companion .

Open New Tabs

Open a new tab when a problem is parsed.

If this is disabled, when parsing a problem, the test cases in the current tab will be replaced by the new test cases.

Connection Port

Usually, you don’t have to modify this setting. The default port 10045 is supported by Competitive Companion, so if you are using the default port, you don’t have to add custom ports in Competitive Companion. However, in case of port conflicts, etc., you can change the port and add custom ports in Competitive Companion.

Use the time limit from Competitive Companion

Use the time limit parsed by Competitive Companion as the time limit of the corresponding tab.

Head Comments

The head comments are added at the head of the code when parsing a problem.

Content of the head comments

The content of the head comments. You can use the following place holders:

Time format for the head comments

The format of the ${time} place holder in the head comments. You can read the Qt documentation for available expressions:

CF Tool

You can use CF Tool to submit your solutions to Codeforces .

To submit a solution, you have to either parse a problem by Competitive Companion from Codeforces or manually set the problem URL of a tab in the context menu of it.

See also Setup CF Tool .

Path

The path to the cf executable file, or simply cf if it’s in the PATH environment variable.

Show toast messages for submission verdicts

Show a toast message when the verdict of a submission is determined.

A toast message is a “system notification”, which is visible outside of CP Editor.

This is useful if you want to get the verdict of the previous problem when reading/solving the next problem.

WakaTime

WakaTime can help you to track your time usage.

See also Setup WakaTime .

Enable WakaTime

Use WakaTime to track your time usage.

Path

The path to the wakatime executable file, or simply wakatime if it’s in the PATH environment variable.

Api Key

Can be found at WakaTime Settings .

It can be empty if you have the global wakatime config file ~/.wakatime.cfg.

Use Proxy

Use Network Proxy to send data to WakaTime.


Изменено September 19, 2021: feat: add wakatime extension (#204) (b63c72f7)