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

Golang feature #82

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
addGo
  • Loading branch information
reedthink committed Mar 7, 2020
commit 1df116a0b83acf349e346824cf9b472cf7409356
3 changes: 0 additions & 3 deletions images/go/go-extension.png

This file was deleted.

3 changes: 0 additions & 3 deletions images/go/hover.png

This file was deleted.

3 changes: 0 additions & 3 deletions images/go/signaturehelp.png

This file was deleted.

3 changes: 0 additions & 3 deletions images/go/testcommands.png

This file was deleted.

29 changes: 21 additions & 8 deletions md/语言/go.md
Original file line number Diff line number Diff line change
@@ -36,32 +36,45 @@ By setting `go.autocompleteUnimportedPackages` to `true` in your [settings](/doc
>**Tip**: 用 `kb(editor.action.triggerSuggest)` 来手动触发建议.


### Hover Information
### 悬浮信息 Hover Information

Hovering on any variable, function, or struct will give you information on that item such as documentation, signature, etc.
Hovering on any variable, function, or struct will give you information on that item such as documentation, signature, etc.

在任何变量,函数或者结构体上悬浮,可以提供对应的信息,例如注释,参数等等。

![Information on hover](images/go/hover.png)

By default, the extension uses `godef` and `godoc` to get this information. You can choose to use `gogetdoc` instead by changing the setting `go.docsTool` in your User or Workspace Settings.
By default, the extension uses `godef` and `godoc` to get this information. You can choose to use `gogetdoc` instead by changing the setting `go.docsTool` in your User or Workspace Settings.

默认情况,扩展使用`godef` 和 `godoc`获取这些信息。你可以选择使用`gogetdoc`代替。设置方法:改变用户设置或工作空间设置中的`go.docsTool`。

### Signature help

When you open the `(` while calling a function, a pop-up provides signature help for the function. As you keep typing the parameters, the hint (underline) moves to the next parameter.
When you open the `(` while calling a function, a pop-up provides signature help for the function. As you keep typing the parameters, the hint (underline) moves to the next parameter.

当你调用函数时,打出`(`,一个弹窗为函数提供参数帮助。当你输入一些参数,提示(下划线)移动到下一个参数。

![Signature Help](images/go/signaturehelp.png)

>**Tip**: Use `kb(editor.action.triggerParameterHints)` to manually trigger the signature help when the cursor is inside the `()` in the function call.
>**Tip**: Use `kb(editor.action.triggerParameterHints)` to manually trigger the signature help when the cursor is inside the `()` in the function call.

>**Tip**: 当光标在函数调用的`()`之内,用 `kb(editor.action.triggerParameterHints)` 去手动触发参数帮助。

The extension's signature help also uses `godef` and `godoc`. You can choose to use `gogetdoc` instead by changing the setting `go.docsTool` in your User or Workspace Settings.
The extension's signature help also uses `godef` and `godoc`. You can choose to use `gogetdoc` instead by changing the setting `go.docsTool` in your User or Workspace Settings.

## Code navigation
扩展的参数帮助也使用 `godef` 和 `godoc`。你可以选择使用`gogetdoc`代替。设置方法:改变用户设置或工作空间设置中的`go.docsTool`。

Code navigation features are available in the context menu in the editor.
## 代码导航 Code navigation

Code navigation features are available in the context menu in the editor.

代码导航特性适用于编辑器中的文本菜单。

- **Go To Definition** `kb(editor.action.revealDefinition)` - Go to the source code of the type definition.
- **Peek Definition** `kb(editor.action.peekDefinition)` - Bring up a Peek window with the type definition.
- **Go to References** `kb(editor.action.goToReferences)` - Show all references for the type.


You can navigate via symbol search using the **Go to Symbol** commands from the **Command Palette** (`kb(workbench.action.showCommands)`).

- Go to Symbol in File - `kb(workbench.action.gotoSymbol)`
Binary file added md/语言/images/go/go-extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added md/语言/images/go/hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added md/语言/images/go/signaturehelp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added md/语言/images/go/testcommands.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.