Skip to content

Commit 8ae69f2

Browse files
committed
doc: update docs/github-copilot.md
1 parent 29bb4e4 commit 8ae69f2

File tree

2 files changed

+70
-50
lines changed

2 files changed

+70
-50
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Quick Reference
5353
[C++](./docs/cpp.md)<!--rehype:style=background: rgb(6 147 13);&class=contributing-->
5454
[Dart](./docs/dart.md)<!--rehype:style=background: rgb(64 196 255);-->
5555
[Docker](./docs/docker.md)<!--rehype:style=background: rgb(72 143 223);-->
56-
[Docker-Compose](./docs/docker-compose.md)<!--rehype:style=background: rgb(72 143 223);&class=contributing tag&data-lang=Docker-->
56+
[Docker Compose](./docs/docker-compose.md)<!--rehype:style=background: rgb(72 143 223);&class=contributing tag&data-lang=Docker-->
5757
[Dockerfile](./docs/dockerfile.md)<!--rehype:style=background: rgb(0 72 153);&class=tag&data-lang=Docker-->
5858
[Django](./docs/django.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
5959
[Elixir](./docs/elixir.md)<!--rehype:style=background: rgb(124 26 156);&class=contributing tag&data-lang=Elixir-->
@@ -188,7 +188,8 @@ Quick Reference
188188

189189
## 工具
190190

191-
[ChatGPT](./docs/chatgpt.md)<!--rehype:style=background: rgb(74, 161, 129);&class=tag&data-lang=ai-->
191+
[ChatGPT](./docs/chatgpt.md)<!--rehype:style=background: rgb(74, 161, 129);&class=tag&data-lang=AI-->
192+
[Github Copilot](./docs/github-copilot.md)<!--rehype:style=background: rgb(125 45 220);&class=tag contributing&data-lang=AI&data-info=👆看看还缺点儿什么?-->
192193
[Emacs](./docs/emacs.md)<!--rehype:style=background: rgb(98 36 134);-->
193194
[Github](./docs/github.md)<!--rehype:style=background: rgb(36 41 47);-->
194195
[Linux Command](./docs/linux-command.md)<!--rehype:style=background: rgb(215 89 62);&class=tag&data-lang=命令速查-->

docs/github-copilot.md

Lines changed: 67 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Github Copilot 备忘清单
33

44
这是开始使用 [Github Copilot](https://code.visualstudio.com/docs/editor/github-copilot) 的快速参考指南
55

6-
一、准备工作
6+
入门
77
----
88

99
### 1、账号注册
1010

11-
> 需要先拥有一个Github账号,并订阅Copilot。
11+
需要先拥有一个Github账号,并订阅Copilot。
1212

1313
事项 | 说明
1414
:-|-
@@ -18,7 +18,7 @@ Github 账号 | [注册地址](https://github.com/signup)
1818
### 2、安装Vscode插件
1919
<!--rehype:wrap-class=col-span-1 row-span-1-->
2020

21-
> 在扩展商店中搜索安装下面插件
21+
在扩展商店中搜索安装下面插件
2222

2323
插件名称 | 功能
2424
:-|-
@@ -51,7 +51,7 @@ Editor Chat| 在编辑器中打开完整的对话界面
5151
Silde Chat| 在编辑器的侧边栏打开对话界面
5252
Quick Chat| 在顶部唤起对话界面
5353

54-
二、提示技巧
54+
提示技巧
5555
----
5656

5757
### 提示之禅
@@ -275,7 +275,7 @@ dailogs = [
275275
...
276276
```
277277

278-
三、快捷键
278+
快捷键
279279
----
280280
<!--rehype:body-class=cols-2-->
281281

@@ -287,6 +287,7 @@ dailogs = [
287287
<!--rehype:wrap-class=col-span-2 row-span-1-->
288288

289289
#### Copilot 中 Inline Suggestions 相关命令
290+
<!--rehype:style=text-align: left;-->
290291

291292
| 命令 |说明 | 快捷键 | Mac 快捷键 |
292293
|-|:-|:-|:-|
@@ -300,6 +301,7 @@ dailogs = [
300301
<!--rehype:className=show-header wrap-text left-align-->
301302

302303
#### Copilot 中 Completions Panel 相关命令
304+
<!--rehype:style=text-align: left;-->
303305

304306
| 命令 |说明 | 快捷键 | Mac 快捷键 |
305307
|-|:-|:-|:-|
@@ -310,6 +312,7 @@ dailogs = [
310312
<!--rehype:className=show-header wrap-text left-align-->
311313

312314
#### Copilot 中 其他命令
315+
<!--rehype:style=text-align: left;-->
313316

314317
| 命令 |说明 | 快捷键 | Mac 快捷键 |
315318
|-|:-|:-|:-|
@@ -324,6 +327,7 @@ dailogs = [
324327
<!--rehype:wrap-class=col-span-2 row-span-1-->
325328

326329
#### Copilot Chat 中 Chat 相关命令
330+
<!--rehype:style=text-align: left;-->
327331

328332
| 命令 |说明 | 快捷键 | Mac 快捷键 |
329333
|-|:-|:-|:-|
@@ -334,6 +338,7 @@ dailogs = [
334338
<!--rehype:className=show-header wrap-text left-align-->
335339

336340
#### Copilot Chat 中 Inline Chat 相关命令
341+
<!--rehype:style=text-align: left;-->
337342

338343
| 命令 |说明 | 快捷键 | Mac 快捷键 |
339344
|-|:-|:-|:-|
@@ -345,6 +350,7 @@ dailogs = [
345350
<!--rehype:className=show-header wrap-text left-align-->
346351

347352
#### Copilot Chat 中 Quick Chat 相关命令
353+
<!--rehype:style=text-align: left;-->
348354

349355
| 命令 |说明 | 快捷键 | Mac 快捷键 |
350356
|-|:-|:-|:-|
@@ -353,13 +359,15 @@ dailogs = [
353359
<!--rehype:className=show-header wrap-text left-align-->
354360

355361
#### Copilot Chat 中 Editor Chat 相关命令
362+
<!--rehype:style=text-align: left;-->
356363

357364
| 命令 |说明 | 快捷键 | Mac 快捷键 |
358365
|-|:-|:-|:-|
359366
`workbench.action.openChat.copilot`|打开编辑器聊天|-|-
360367
<!--rehype:className=show-header wrap-text left-align-->
361368

362369
#### Copilot Chat 其他命令
370+
<!--rehype:style=text-align: left;-->
363371

364372
| 命令 |说明 | 快捷键 | Mac 快捷键 |
365373
|-|:-|:-|:-|
@@ -368,10 +376,10 @@ dailogs = [
368376
`github.copilot.ghpr.applySuggestion`|为Github Pull Request提供代码建议|-|-
369377
<!--rehype:className=show-header wrap-text left-align-->
370378

371-
四、Copilot Chat 的 Slash Commands 使用技巧
379+
Copilot Chat 的 Slash Commands 使用技巧
372380
----
373381

374-
> 在聊天对话框中可以通过`/`开头的命令来与Copilot Chat进行交互。
382+
在聊天对话框中可以通过`/`开头的命令来与Copilot Chat进行交互。
375383

376384
### Slash Commands 示例
377385
<!--rehype:wrap-class=col-span-1 row-span-1-->
@@ -393,9 +401,9 @@ dailogs = [
393401
@vscode /api 请解释 inlineChat.start 的作用
394402
395403
@workspace /explain def helloworld():...
404+
```
396405

397406
在每一行代码末尾添加注释进行解释
398-
```
399407

400408
#### Agent
401409

@@ -420,7 +428,7 @@ dailogs = [
420428

421429
---
422430

423-
> 通过命令 `github.copilot.interactiveEditor.generate` 触发
431+
通过命令 "github.copilot.interactiveEditor.generate" 触发
424432

425433
|命令 |说明 |
426434
|- |:-|
@@ -430,32 +438,34 @@ dailogs = [
430438

431439
> 当然也可以直接选中区域,然后在inline chat中输入指令执行 copilot会对选中区域进行指令操作
432440
433-
|常用指令|
434-
| - |
435-
|在每一行代码末尾添加注释进行解释|
436-
|使代码满足PEP484要求|
437-
<!--rehype:className=show-header wrap-text left-align-->
441+
#### 常用指令
442+
443+
- 在每一行代码末尾添加注释进行解释
444+
- 使代码满足PEP484要求
445+
<!--rehype:className=style-round-->
438446

439447
### Silde Chat 的 Slash Commands
440448
<!--rehype:wrap-class=col-span-1 row-span-2-->
441449

442-
> 通过命令 `workbench.action.chat.openInSidebar` 触发 `chat` 后使用
443-
> 或点击侧边栏上的Copilot聊天按钮
444-
> 在Chat输入框中还允许指定Agent(即环境)
450+
- 通过命令 `workbench.action.chat.openInSidebar` 触发 `chat` 后使用
451+
- 或点击侧边栏上的Copilot聊天按钮
452+
- 在Chat输入框中还允许指定Agent(即环境)
453+
<!--rehype:className=style-round-->
445454

446455
#### Slash Commands
447456

448457
|命令 |说明 |
449458
|- |:-|
450-
/api |回答vscode扩展插件开发的问题
451-
/explain |对选中的代码进行解释
452-
/fix |修复此选中的代码
453-
/new |创建新项目workspace
454-
/newNotebook |创建新的Jupyter Notebook
455-
/terminal |解释命令行里的命令
456-
/tests |为选中的代码生成单元测试
457-
/help |帮助说明
458-
/clear |清除会话
459+
`/api` |回答vscode扩展插件开发的问题
460+
`/explain` |对选中的代码进行解释
461+
`/fix` |修复此选中的代码
462+
`/new` |创建新项目workspace
463+
`/newNotebook` |创建新的Jupyter Notebook
464+
`/terminal` |解释命令行里的命令
465+
`/tests` |为选中的代码生成单元测试
466+
`/help` |帮助说明
467+
`/clear` |清除会话
468+
<!--rehype:className=left-align-->
459469

460470
### `/terminal`特有的变量, 以`#`号开头
461471

@@ -471,13 +481,12 @@ dailogs = [
471481

472482
- Quick Chat 与 Chat 的 Slash Commands相同
473483
- Editor Chat 与 Chat 的 Slash Commands相同
484+
<!--rehype:className=style-round-->
474485

475-
五、参数设置
486+
参数设置
476487
----
477488

478-
打开vscode 命令面板, 输入`Preferences:Open Settings` 打开配置文件,在文件模式下配置相关参数.
479-
480-
完整参数说明可以查看 `copilot``copilot chat` 两个[插件目录](https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed)下的 `package.json` 文件获知。
489+
打开 VSCode 命令面板,输入 `Preferences: Open Settings` 来打开配置文件。在文件模式下,您可以配置相关参数。要获取完整的参数说明,请查看 `copilot``copilot chat` 两个插件目录下的 `package.json` 文件,具体位置可以参考 [VSCode 扩展市场](https://code.visualstudio.com/docs/editor/extension-marketplace#_where-are-extensions-installed)
481490

482491
### 完整配置参考
483492

@@ -532,49 +541,59 @@ dailogs = [
532541

533542
### 参数说明
534543
<!--rehype:wrap-class=col-span-2 row-span-1-->
544+
535545
#### 代理参数
546+
<!--rehype:style=text-align: left;-->
536547

537548
|设置参数 |值类型|说明 |
538549
|:--|:--|:--|
539550
`"http.proxy"`| string |配置网络代理地址
551+
<!--rehype:className=left-align-->
540552

541553
#### Copilot Chat 参数
554+
<!--rehype:style=text-align: left;-->
542555

543556
|设置参数 |值类型|说明 |
544557
|:--|:--|:--|
545558
`"github.copilot.chat.localeOverride"`| string | 设置Copilot本地语言
546559
`"github.copilot.chat.welcomeMessage"`| string |Copilot Chat 是否显示欢迎语<br>`first`: 仅第一次启动时, `always`: 总是, `never`: 从不
560+
<!--rehype:className=left-align-->
547561

548562
#### Copilot 基本参数
563+
<!--rehype:style=text-align: left;-->
549564

550565
|设置参数 |值类型|说明 |
551566
|:--|:--|:--|
552-
`"editor.inlineSuggest.enabled"`| boolean |启用内联建议
553-
`"github.copilot.editor.iterativeFixing"`| boolean| 允许 Copilot 提供迭代修复建议
554-
`"github.copilot.editor.enableAutoCompletions"`| boolean |允许 Copilot 提供自动补全
555-
`"github.copilot.editor.enableCodeActions"`| boolean|允许 Copilot 代码操作建议,这些操作可能包括重构代码、优化代码结构、修复可错误等
567+
| `"editor.inlineSuggest.enabled"` | boolean | 启用内联建议 |
568+
| `"github.copilot.editor.iterativeFixing"` | boolean | 允许 Copilot 提供迭代修复建议 |
569+
| `"github.copilot.editor.enableAutoCompletions"` | boolean | 允许 Copilot 提供自动补全 |
570+
| `"github.copilot.editor.enableCodeActions"` | boolean | 允许 Copilot 提供代码操作建议,包括重构和优化代码结构、修复错误等 |
571+
<!--rehype:className=left-align-->
556572

557573
#### 设置 Copilot 生效的文件类型
574+
<!--rehype:style=text-align: left;-->
558575

559576
|设置参数 |值类型|说明 |
560577
|:--|:--|:--|
561578
`"github.copilot.enable"`| json |请将 `"*": true` 放到末尾 <br>[语言](https://code.visualstudio.com/docs/languages/identifiers)后设置 `false` 表示禁用copilot, 设置 `true` 表示启用
579+
<!--rehype:className=left-align-->
562580

563581
#### Copilot 高级参数
564-
565-
> github.copilot.advanced 可以控制模型参数,最终影响到代码生成. 其值为json
566-
567-
|设置参数 |值类型|说明 |
568-
|:--|:--|:--|
569-
`"length"`| integer | 生成的代码字数, 默认为 `500`
570-
`"top_p"`| number | 控制模型候选范围,默认值为 `1`,值范围为`0.0~1.0`
571-
`"temperature"`| string | 控制模型的创造性,默认值为 `""`,值越大越不可预测,值范围为`0.0~1.0`
572-
`"inlineSuggestCount"`| integer | 内联提示的个数, 默认为`3`
573-
`"listCount"`| integer | 控制`Completions Panel`中建议个数,默认为 `10`
574-
`"stops"`| json | 控制模型代码生成时停止的标志,可以按[语言](https://code.visualstudio.com/docs/languages/identifiers)来控制
575-
`"indentationMode"`| json | 指定[语言](https://code.visualstudio.com/docs/languages/identifiers)是否采用该语言的缩近模式,由此可能会与stops冲突,比如采用`\{\}`缩近时,设置该参数时需要综合考虑
576-
`"debug.showScores"`| boolean | 在代码建议列表中显示每个建议的分数
577-
<!--rehype:className=wrap-text -->
582+
<!--rehype:style=text-align: left;-->
583+
584+
`github.copilot.advanced` 可以控制模型参数,最终影响到代码生成。其值为json
585+
586+
| 设置参数 | 值类型 | 说明 |
587+
|----------|----------|----------|
588+
| `"length"` | 整数 integer | 生成代码的字数,默认为 `500` |
589+
| `"top_p"` | 数字 number | 控制模型候选范围,默认值为 `1`,范围为 `0.0~1.0` |
590+
| `"temperature"` | 字符串 string | 控制模型创造性,默认值为空,值越大越不可预测,范围为 `0.0~1.0` |
591+
| `"inlineSuggestCount"` | 整数 integer | 内联提示的个数,默认为 `3` |
592+
| `"listCount"` | 整数 integer | `Completions Panel` 中建议的个数,默认为 `10` |
593+
| `"stops"` | JSON | 控制模型代码生成时的停止标志,可按[语言](https://code.visualstudio.com/docs/languages/identifiers)控制 |
594+
| `"indentationMode"` | JSON | 指定[语言](https://code.visualstudio.com/docs/languages/identifiers)是否使用该语言的缩进模式,可能与 stops 冲突 |
595+
| `"debug.showScores"` | 布尔值 boolean | 在代码建议列表中显示每个建议的分数 |
596+
<!--rehype:className=left-align-->
578597

579598
END... ENJOY YOURSELF
580599
----

0 commit comments

Comments
 (0)