# Advanced completion

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

## Type-matching completion

Procedure: Invoke type-matching completion

* Smart type-matching code completion filters the suggestion list and shows only the types applicable to the current context. To invoke type-matching completion, start typing your code and press `Ctrl+Shift+Space` (Windows), `⌃ ⇧ Space` (macOS), `⌃ ⇧ Space` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ Space` (macOS System Shortcuts), `Ctrl+Shift+Space` (XWin), `Ctrl+Shift+Space` (GNOME), `Ctrl+Shift+Space` (KDE), `Ctrl+Shift+Space` (Emacs), `Ctrl+Shift+Space` (Sublime Text), `Ctrl+Shift+Space` (Sublime Text (macOS)), `Ctrl+Shift+Space` (VSCode), `⌃ ⇧ Space` (VSCode (macOS)). Alternatively, select `Code | Code Completion | Type-Matching` from the main menu. The following animation shows the difference between basic and type-matching completion.

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/go_smart_and_basic_completion.mp4)

> **Tip:**
> The Type-Matching completion suggests you a pointer to struct initializer in auto-completion and also compatible types in assertions and type switch cases.

## Statement completion

You can create syntactically correct code constructs by using statement completion. It inserts the necessary syntax elements (parentheses, braces, and semicolons) and gets you in a position where you can start typing the next statement.

To invoke statement completion, start typing a code construct and press `Ctrl+Shift+Enter` (Windows), `⌘ ⇧ ⏎` (macOS), `⌘ ⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ ⏎` (macOS System Shortcuts), `Ctrl+Shift+Enter` (XWin), `Ctrl+Shift+Enter` (GNOME), `Ctrl+Shift+Enter` (KDE), `Ctrl+Shift+Enter` (Emacs), `Ctrl+Shift+Enter` (Sublime Text), `Ctrl+Shift+Enter` (Sublime Text (macOS)), `Ctrl+Shift+Enter` (VSCode), `Ctrl+Shift+Enter` (VSCode (macOS)).

Procedure: Complete a method declaration

* Start typing a method declaration and press `Ctrl+Shift+Enter` (Windows), `⌘ ⇧ ⏎` (macOS), `⌘ ⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ ⏎` (macOS System Shortcuts), `Ctrl+Shift+Enter` (XWin), `Ctrl+Shift+Enter` (GNOME), `Ctrl+Shift+Enter` (KDE), `Ctrl+Shift+Enter` (Emacs), `Ctrl+Shift+Enter` (Sublime Text), `Ctrl+Shift+Enter` (Sublime Text (macOS)), `Ctrl+Shift+Enter` (VSCode), `Ctrl+Shift+Enter` (VSCode (macOS)) after the parenthesis.

Before:

```GO
func _()#caret
```

After:

```GO
func _() {
	#caret
}
```

Procedure: Complete a code construct

* Start typing a code construct and press `Ctrl+Shift+Enter` (Windows), `⌘ ⇧ ⏎` (macOS), `⌘ ⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ ⏎` (macOS System Shortcuts), `Ctrl+Shift+Enter` (XWin), `Ctrl+Shift+Enter` (GNOME), `Ctrl+Shift+Enter` (KDE), `Ctrl+Shift+Enter` (Emacs), `Ctrl+Shift+Enter` (Sublime Text), `Ctrl+Shift+Enter` (Sublime Text (macOS)), `Ctrl+Shift+Enter` (VSCode), `Ctrl+Shift+Enter` (VSCode (macOS)).

GoLand automatically completes the construct and adds the required braces. The caret is placed at the next editing position.

Before:

```GO
func _() {
    _, err := myFunc()
    if err != nil#caret
```

After:

```GO
func _() {
    _, err := myFunc()
    if err != nil {

	}
}
```

## Hippie completion

Hippie completion is a completion engine that analyses your text in the visible scope and generates suggestions from the current context. It helps you complete any word from any of the currently opened files.

Procedure: Expand a string at caret to an existing word

1. Type the initial string and do one of the following:

* Press `Alt+/` (Windows), `⌥ /` (macOS), `⌥ /` (IntelliJ IDEA Classic (macOS)), `⌥ /` (macOS System Shortcuts), `Alt+/` (XWin), `Alt+/` (GNOME), `Alt+/` (KDE), `Alt+/` (Emacs), `Alt+/` (Sublime Text), `⌥ /` (Sublime Text (macOS)), `Alt+/` (VSCode), `⌥ /` (VSCode (macOS)) or choose `Code | Code Completion | Cyclic Expand Word` to search for matching words before the caret.

* Press `Alt+Shift+/` (Windows), `⌥ ⇧ /` (macOS), `⌥ ⇧ /` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ /` (macOS System Shortcuts), `Alt+Shift+/` (XWin), `Alt+Shift+/` (GNOME), `Alt+Shift+/` (KDE), `Alt+Shift+/` (Emacs), `Alt+Shift+/` (Sublime Text), `⌥ ⇧ /` (Sublime Text (macOS)), `Alt+Shift+/` (VSCode), `⌥ ⇧ /` (VSCode (macOS)) or choose `Code | Code Completion | Cyclic Expand Word (Backward)` to search for matching words after the caret and in other open files.

The first suggested value appears, and the prototype is highlighted in the source code.

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/go_expand_word.mp4)

2. Accept the suggestion or hold the `Alt` (Windows), `Alt` (macOS), `Alt` (IntelliJ IDEA Classic (macOS)), `Alt` (macOS System Shortcuts), `Alt` (XWin), `Alt` (GNOME), `Alt` (KDE), `Alt` (Emacs), `Alt` (Sublime Text), `Alt` (Sublime Text (macOS)), `Alt` (VSCode), `Alt` (VSCode (macOS)) key and keep pressing `\` (Windows), `\` (macOS), `\` (IntelliJ IDEA Classic (macOS)), `\` (macOS System Shortcuts), `\` (XWin), `\` (GNOME), `\` (KDE), `\` (Emacs), `\` (Sublime Text), `\` (Sublime Text (macOS)), `\` (VSCode), `\` (VSCode (macOS)) until you find the word you need.

## Completion of tags and attributes

GoLand automatically completes names and values of tags and attributes in many file types:

* HTML/XHTML, including [completion for CSS classes](css.html#ws_css_complete_class_in_html_tags) and for [HTML tags inside JSX](null). > **Tip:** > If [Emmet support is enabled](using-zen-coding-support.html#ws_emmet_enable), Emmet templates are also completed automatically in the HTML and XML contexts.

* [XML/XSL](completing-xslt.html), including completion for namespaces.

* JSON. For more information, refer to [Editing package.json](installing-and-removing-external-software-using-node-package-manager.html#ws_npm_yarn_edit_package_json).

Completion of tags and attribute names is based on the [DTD or Schema](referencing-xml-schemas-and-dtds.html) the file is associated with. If there is no schema association, GoLand will use the file content (tag and attribute names and their values) to complete your input.

Procedure: Complete tag names

1. Type the opening `<` and then start typing the tag name. GoLand displays the list of tag names appropriate in the current context.

Use the `Up` (Windows), `↑` (macOS), `↑` (IntelliJ IDEA Classic (macOS)), `↑` (macOS System Shortcuts), `Up` (XWin), `Up` (GNOME), `Up` (KDE), `Up` (Emacs), `Up` (Sublime Text), `↑` (Sublime Text (macOS)), `Up` (VSCode), `↑` (VSCode (macOS)) and `Down` (Windows), `↓` (macOS), `↓` (IntelliJ IDEA Classic (macOS)), `↓` (macOS System Shortcuts), `Down` (XWin), `Down` (GNOME), `Down` (KDE), `Down` (Emacs), `Down` (Sublime Text), `↓` (Sublime Text (macOS)), `Down` (VSCode), `↓` (VSCode (macOS)) keys to scroll through the list.

2. Press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (VSCode), `⏎` (VSCode (macOS)) to accept a selection from the list. If your file is associated with a schema or a DTD, GoLand automatically inserts the mandatory attributes according to it.

![Support for Go templates](https://resources.jetbrains.com/help/img/idea/2026.3/go_support_of_html_xml.png)

