Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconstruct for support-object branch #192

Open
wants to merge 6 commits into
base: hugo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/faq/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ You need to install a [Language Server program](https://microsoft.github.io/lang

### My code gets TLE on every first execution after compilation.

It's probably because your anti-virus software is scanning your program. A possible solution is to [set the output directory of the executable files](../preferences/language/\_index.md#c-executable-file-path) (for example, you can set it to `D:/cpeditor-executables/${basename}`), and add that directory (`D:/cpeditor-executables` in the example) in the whitelist of your anti-virus software.
It's probably because your anti-virus software is scanning your program. A possible solution is to [set the output directory of the executable files](../preferences/language/\_index.md#executable-file-path) (for example, you can set it to `D:/cpeditor-executables/${basename}`), and add that directory (`D:/cpeditor-executables` in the example) in the whitelist of your anti-virus software.
2 changes: 1 addition & 1 deletion content/docs/faq/_index.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ You need to install a [Language Server program](https://microsoft.github.io/lang

### My code gets TLE on every first execution after compilation.

It's probably because your anti-virus software is scanning your program. A possible solution is to [set the output directory of the executable files](../preferences/language/\_index.ru.md#c-executable-file-path) (for example, you can set it to `D:/cpeditor-executables/${basename}`), and add that directory (`D:/cpeditor-executables` in the example) in the whitelist of your anti-virus software.
It's probably because your anti-virus software is scanning your program. A possible solution is to [set the output directory of the executable files](../preferences/language/\_index.ru.md#executable-file-path) (for example, you can set it to `D:/cpeditor-executables/${basename}`), and add that directory (`D:/cpeditor-executables` in the example) in the whitelist of your anti-virus software.
2 changes: 1 addition & 1 deletion content/docs/faq/_index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ CF Tool 需要在使用前进行配置。请在终端中执行 `cf config` 以

### 我的代码每次首次运行时都超时。

这很可能是因为你的杀毒软件在扫描你的程序。一个可能的解决方法是,[设置可执行文件的输出目录](../preferences/language/\_index.zh.md#c-可执行文件路径)(例如,你可以将其设置为 `D:/cpeditor-executables/${basename}`),然后将这个目录(在上面的例子中,即 `D:/cpeditor-executables`)加到杀毒软件的白名单中。
这很可能是因为你的杀毒软件在扫描你的程序。一个可能的解决方法是,[设置可执行文件的输出目录](../preferences/language/\_index.zh.md#可执行文件路径)(例如,你可以将其设置为 `D:/cpeditor-executables/${basename}`),然后将这个目录(在上面的例子中,即 `D:/cpeditor-executables`)加到杀毒软件的白名单中。
38 changes: 18 additions & 20 deletions content/docs/preferences/extensions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ Clang Format is used to format the C/C++ and Java codes. You can click Actions->

**See also** [Setup Clang Format](../../setup/\_index.md#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](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) 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 <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only these lines will be formatted.
Expand All @@ -33,20 +19,32 @@ YAPF is used to format the Python codes. You can click Actions->Format Code or p

#### Program

The program of YAPF. It could be one of:
- Clang Format:

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

- YAPF:

- `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`.
The program of YAPF. It could be one of:

Note that [you need to use Python 2 to format Python 2, use Python 3 to format Python 3](https://github.com/google/yapf#python-versions). So you may need to choose the correct Python interpreter.
- `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](https://github.com/google/yapf#python-versions). 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).
The arguments passed to the formatter. It should NOT contain `-i` (the in-place modification option).

- YAPF: This should be `-m yapf` if the program is a Python interpreter.

#### 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](https://github.com/google/yapf#formatting-style) or search for other materials to learn how to write the styles.
The content here is the same as the content of a `.clang-format` file(Clang Format) or a `.style.yapf` file(YAPF).

- Clang Format: You can read [Clang-Format Style Options documentation](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) or search for other materials to learn how to write the styles.

- YAPF: You can check all possible configurations by running `yapf --style-help`, read the [documentation](https://github.com/google/yapf#formatting-style) or search for other materials to learn how to write the styles.

## Language Server

Expand Down
38 changes: 18 additions & 20 deletions content/docs/preferences/extensions/_index.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ Clang Format is used to format the C/C++ and Java codes. You can click Actions->

**See also** [Setup Clang Format](../../setup/\_index.ru.md#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](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) 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 <kbd>Ctrl+Shift+I</kbd> to format the codes. If you have selected a part of the code, only these lines will be formatted.
Expand All @@ -33,20 +19,32 @@ YAPF is used to format the Python codes. You can click Actions->Format Code or p

#### Program

The program of YAPF. It could be one of:
- Clang Format:

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

- YAPF:

- `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`.
The program of YAPF. It could be one of:

Note that [you need to use Python 2 to format Python 2, use Python 3 to format Python 3](https://github.com/google/yapf#python-versions). So you may need to choose the correct Python interpreter.
- `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](https://github.com/google/yapf#python-versions). 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).
The arguments passed to the formatter. It should NOT contain `-i` (the in-place modification option).

- YAPF: This should be `-m yapf` if the program is a Python interpreter.

#### 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](https://github.com/google/yapf#formatting-style) or search for other materials to learn how to write the styles.
The content here is the same as the content of a `.clang-format` file(Clang Format) or a `.style.yapf` file(YAPF).

- Clang Format: You can read [Clang-Format Style Options documentation](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) or search for other materials to learn how to write the styles.

- YAPF: You can check all possible configurations by running `yapf --style-help`, read the [documentation](https://github.com/google/yapf#formatting-style) or search for other materials to learn how to write the styles.

## Language Server

Expand Down
38 changes: 18 additions & 20 deletions content/docs/preferences/extensions/_index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ Clang Format 是格式化 C/C++ 和 Java 代码的工具。你可以点击 动

**参见** [安装 Clang Format](../../setup/\_index.zh.md#安装-clang-format)。

#### 程序

`clang-format` 可执行文件的路径。如果它已经在 `PATH` 环境变量中,只需填写 `clang-format` 即可。

#### 参数

向 `clang-format` 传递的参数。它不应包含 `-i`(就地修改选项)。

#### 风格

Clang Format 格式化代码的风格。这里的内容和 `.clang-format` 的内容一致。

你可以查看 [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) 或其他资料以获取关于代码格式化风格的相关信息。

### YAPF

YAPF 是格式化 Python 代码的工具。你可以点击 动作->格式化代码 或按快捷键 <kbd>Ctrl+Shift+I</kbd> 来格式化代码。如果你选择了代码的一部分,只有被选择的行会被格式化。
Expand All @@ -33,20 +19,32 @@ YAPF 是格式化 Python 代码的工具。你可以点击 动作->格式化代

#### 程序

YAPF 的程序,它可以是如下两项之一:
- Clang Format

`clang-format` 可执行文件的路径。如果它已经在 `PATH` 环境变量中,只需填写 `clang-format` 即可。

- YAPF:

- `yapf`:需要能在命令行下执行 `yapf` 命令。参数可以为空。
- Python 解释器的程序名,如 `python`,`python2` 等。参数应该为 `-m yapf`。
YAPF 的程序,它可以是如下两项之一:

注意,你需要 [使用 Python 2 来格式化 Python 2 代码,使用 Python 3 来格式化 Python 3 代码](https://github.com/google/yapf#python-versions)。因此你需要选择正确的 Python 解释器程序。
- `yapf`:需要能在命令行下执行 `yapf` 命令。参数可以为空。
- Python 解释器的程序名,如 `python`,`python2` 等。参数应该为 `-m yapf`。

注意,你需要 [使用 Python 2 来格式化 Python 2 代码,使用 Python 3 来格式化 Python 3 代码](https://github.com/google/yapf#python-versions)。因此你需要选择正确的 Python 解释器程序。

#### 参数

传递给 YAPF 程序的参数。如果在程序一栏里填写的是 Python 解释器,这里的参数应该是 `-m yapf`。参数中不应包含 `-i`(就地修改选项)。
向格式化程序传递的参数。它不应包含 `-i`(就地修改选项)。

- YAPF: 如果在程序一栏里填写的是 Python 解释器,这里的参数应该是 `-m yapf`。

#### 风格

YAPF 格式化代码的风格,这里的内容和 `.style.yapf` 的内容一致。你可以运行 `yapf --style-help`,查看 [文档](https://github.com/google/yapf#formatting-style) 或其他资料以获取关于代码格式化风格的相关信息。
这里的内容和 `.clang-format`(Clang Format) 或 `.style.yapf`(YAPF) 的内容一致。

- Clang Format: 你可以查看 [Clang-Format Style Options](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) 或其他资料以获取关于代码格式化风格的相关信息。

- YAPF: 你可以运行 `yapf --style-help`,查看 [文档](https://github.com/google/yapf#formatting-style) 或其他资料以获取关于代码格式化风格的相关信息。

## Language Server

Expand Down
78 changes: 31 additions & 47 deletions content/docs/preferences/language/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,73 @@ title: "Language"
weight: 20
---

## General

### Default Language

The default programming language. It's used when opening a new tab and some other places.

## Commands

### C++ Commands

#### C++ Compile Command

The compilation command for C++. For example: `g++ -Wall`.
### Compile Command

The command shouldn't contain the source file and the output file, CP Editor automatically adds them.
For C++ and Java.

For compilation flags, please refer to the manual of the compiler. For example, you may want to add `-std=c++14` in the compile command to use C++14.
The compilation command. For example:

#### C++ Executable File Path

The path of the executable file, i.e. the argument of the `-o` option of the compiler.

If this path is relative, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../general/\_index.md#temporary-directory)).
- C++: `g++ -Wall`.

You can use some place holders for this setting:
- Java: `javac`.

- `${filename}`: The complete name of the source file. If it's an untitled tab (i.e. an unsaved file), the complete file name is `sol.cpp`.
- `${basename}`: `${filename}` without the suffix (i.e. without `.cpp`, etc.).
- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../general/\_index.md#temporary-directory).
The command shouldn't contain the source file, the output file(C++) or the class path(Java), CP Editor automatically adds them.

For example, you can use `${tmpdir}/${basename}` if you don't want to keep the executable files, or `executables/${basename}` if you want to keep all executable files in the `executables` directory under the directory of the source file.
For compilation flags, please refer to the manual of the compiler. For example:

#### C++ Run Arguments
- C++: You may want to add `-std=c++14` in the compile command to use C++14.

The arguments passed to the program when executing it. It's usually not needed in competitive programming.
### Compiler Output Codec

#### C++ Compiler Output Codec
For C++ and Java.

The text codec of the compiler output (warnings, errors, etc.), used to display the messages from the compiler in CP Editor.

It could be useful if you are using locales for your compiler and the compiler messages are not English.

### Java Commands
### Executable File Path

#### Java Compile Command
- C++: The path of the executable file, i.e. the argument of the `-o` option of the compiler.

The compilation command for Java. For example: `javac`.
- Java: The path to save the class files.

The command shouldn't contain the source file and the class path, CP Editor automatically adds them.
If this path is relative, then it's relative to the source file (if it's an untitled tab, then relative to the [Temporary Directory](../general/\_index.md#temporary-directory)).

You can use some place holders for this setting:

#### Java Class Path
- `${filename}`: The complete name of the source file. If it's an untitled tab (i.e. an unsaved file), the complete file name is `sol.cpp`.
- `${basename}`: `${filename}` without the suffix (i.e. without `.cpp`, etc.).
- `${tmpdir}` or `${tempdir}`: The path of the [Temporary Directory](../general/\_index.md#temporary-directory).

The path to save the class files.
For example, you can use `${tmpdir}/${basename}` if you don't want to keep the executable files, or `executables/${basename}` if you want to keep all executable files in the `executables` directory under the directory of the source file.

Please refer to [C++ Executable File Path](#c-executable-file-path) for the details.
### Class Name

#### Java Class Name
For Java.

The name of the main class of your solution.

You can use an arbitrary name for your source file. When compiling, CP Editor automatically saves your code to a file with the class name.

#### Java Run Command

The command to run your solution. For example `java`.

This command shouldn't contain the class path or the class name, CP Editor automatically adds them.

#### Java Run Arguments

The arguments passed to the program when executing it. It's usually not needed in competitive programming.
### Run Command

#### Java Compiler Output Codec
For Java and Python.

Please refer to [C++ Compiler Output Codec](#c-compiler-output-codec).
The command to run your code. For example:

### Python Commands
- Java: `java`.

#### Python Run Command
- Python: `python`/`python2`/`python3`.

The command to run a python code. It's usually one of `python`/`python2`/`python3`.
This command shouldn't contain the class path(Java) or the class name(Java), CP Editor automatically adds them.

#### Python Run Arguments
### Run Arguments

The arguments passed to the program when executing it. It's usually not needed in competitive programming.

Expand Down Expand Up @@ -128,13 +112,13 @@ Then you can use `int main` as the regex, `end` as the offset type, and `9` as t

### Manage Snippets

You can add/delete/rename snippets in "Language->XXX->XXX Snippet". You can use <kbd>Ctrl+N</kbd> for "Add", </kbd>Ctrl+W</kbd> for "Del" and </kbd>F2</kbd> for "Rename".
You can add/delete/rename snippets in "Language->Language Config->XXX->Snippet". You can use <kbd>Ctrl+N</kbd> for "Add", <kbd>Ctrl+W</kbd> for "Del" and <kbd>F2</kbd> for "Rename".

You can also import snippets from files or extract your snippets to files in the "More" menu on the snippet page.

### Use Snippets

You can insert a snippet into the code editor by either clicking "Actions->Use Snippets" or pressing </kbd>Ctrl+T</kbd>.
You can insert a snippet into the code editor by either clicking "Actions->Use Snippets" or pressing <kbd>Ctrl+T</kbd>.

When choosing a snippet, you can enter the first few characters of the snippet name, and it will be auto-completed.

Expand Down
Loading