# Advanced completion

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

<a id="smart_type_matching_completion"></a>

## Type-matching completion

<a id="invoke_smart_completion"></a>

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 [Type-Matching shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "SmartTypeCompletion"). 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.

<a id="statements_completion"></a>

## 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 [Complete Current Statement shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorCompleteStatement").

<a id="complete-method-declaration"></a>

Procedure: Complete a method declaration

* Start typing a method declaration and press [Complete Current Statement shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorCompleteStatement") after the parenthesis.

Before:

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

After:

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

<a id="complete-code-construct"></a>

Procedure: Complete a code construct

* Start typing a code construct and press [Complete Current Statement shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorCompleteStatement").

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 {

	}
}
```

<a id="hippie_completion"></a>

## 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.

<a id="expand-a-string-at-caret-to-an-existing-word"></a>

Procedure: Expand a string at caret to an existing word

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

* Press [Cyclic Expand Word shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "HippieCompletion") or choose `Code | Code Completion | Cyclic Expand Word` to search for matching words before the caret.

* Press [Cyclic Expand Word (Backward) shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "HippieBackwardCompletion") 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` key and keep pressing `\` until you find the word you need.

<a id="tag_names_completion"></a>

## 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](https://www.jetbrains.com/help/go/css.html.md#ws_css_complete_class_in_html_tags) and for HTML tags inside JSX. > **Tip:** > If [Emmet support is enabled](https://www.jetbrains.com/help/go/using-zen-coding-support.html.md#ws_emmet_enable), Emmet templates are also completed automatically in the HTML and XML contexts.

* [XML/XSL](https://www.jetbrains.com/help/go/completing-xslt.html.md), including completion for namespaces.

* JSON. For more information, refer to [Editing package.json](https://www.jetbrains.com/help/go/installing-and-removing-external-software-using-node-package-manager.html.md#ws_npm_yarn_edit_package_json).

Completion of tags and attribute names is based on the [DTD or Schema](https://www.jetbrains.com/help/go/referencing-xml-schemas-and-dtds.html.md) 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.

<a id="complete-tag-names"></a>

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 shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorUp") and [Down shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorDown") keys to scroll through the list.

2. Press [Enter shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter") 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)

