You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Terraform Extension for Visual Studio Code
2
2
3
-
The HashiCorp [Terraform Extension for Visual Studio Code (VS Code)](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform) with the [Terraform Language Server](https://github.com/hashicorp/terraform-ls) adds editing features for [Terraform](https://www.terraform.io)and Terraform Stacks files such as syntax highlighting, IntelliSense, code navigation, code formatting, module explorer and much more!
3
+
The HashiCorp [Terraform Extension for Visual Studio Code (VS Code)](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform) with the [Terraform Language Server](https://github.com/hashicorp/terraform-ls) adds editing features for [Terraform](https://www.terraform.io), Terraform Stacks and Terraform Search files such as syntax highlighting, IntelliSense, code navigation, code formatting, module explorer and much more!
4
4
5
5
## Quick Start
6
6
@@ -10,7 +10,7 @@ Get started writing Terraform configurations with VS Code in three steps:
10
10
11
11
-**Step 2:** Install the [Terraform Extension for VS Code](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform).
12
12
13
-
-**Step 3:** To activate the extension, open any folder or VS Code workspace containing Terraformor Terraform Stacks files. Once activated, the Terraform language indicator will appear in the bottom right corner of the window.
13
+
-**Step 3:** To activate the extension, open any folder or VS Code workspace containing Terraform, Terraform Stacks or Terraform Search files. Once activated, the Terraform language indicator will appear in the bottom right corner of the window.
14
14
15
15
New to Terraform? Read the [Terraform Learning guides](https://learn.hashicorp.com/terraform)
16
16
@@ -20,11 +20,11 @@ Read the [Troubleshooting Guide](#troubleshooting) for answers to common questio
20
20
21
21
## Features
22
22
23
-
This extension provides both Terraform and Terraform Stacks language features. For most features Terraform Stacks support is implied, specific functionality is called out where approprite.
23
+
This extension provides Terraform, Terraform Stacks and Terraform Search language features. For most features Terraform Stacks and Terraform Search support is implied, specific functionality is called out where approprite.
24
24
25
25
-[IntelliSense](#intellisense-and-autocomplete) Edit your code with auto-completion of providers, resource names, data sources, attributes, components and more
26
26
-[Syntax validation](#syntax-validation) Provides inline diagnostics for invalid configurations as you type
27
-
-[Syntax highlighting](#syntax-highlighting) Highlighting syntax for Terraform 0.12 to 1.Xand Terraform Stacks
27
+
-[Syntax highlighting](#syntax-highlighting) Highlighting syntax for Terraform 0.12 to 1.X, Terraform Stacks and Terraform Search
28
28
-[Code Navigation](#code-navigation) Navigate through your codebase with Go to Definition and Symbol support
29
29
-[Code Formatting](#code-formatting) Format your code with `terraform fmt` automatically
30
30
-[Code Snippets](#code-snippets) Shortcuts for common snippets like `for_each` and `variable`
@@ -34,15 +34,17 @@ This extension provides both Terraform and Terraform Stacks language features. F
34
34
35
35
### IntelliSense and Autocomplete
36
36
37
-
The Terraform Extension for VS Code provides IntelliSense support for Terraform and for Terraform Stacks.
37
+
The Terraform Extension for VS Code provides IntelliSense support for Terraform, Terraform Stacks and Terraform Search.
38
38
39
39
IntelliSense is a general term for a variety of code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as autocomplete, code completion, and code hinting.
40
40
41
41
For Terraform constructs like resource and data, labels, blocks and attributes are auto completed both at the root of the document and inside other blocks. This also works for Terraform modules that are installed in the workspace, attributes and other constructs are autocompleted.
42
42
43
43
For Terraform Stacks constructs like component and resource, blocks and attributes are auto completed both at the root of the document and inside other blocks. This also works for Terraform Stack components that are installed in the workspace, attributes and other constructs are autocompleted.
44
44
45
-
This means that you can benefit from auto-completion, parameter info, quick info, and member lists when working with both Terraform and Terraform Stacks files. Whether you're defining stacks, resources, or variables, the extension will provide context-specific completions to help you write your code more efficiently.
45
+
For Terraform Search files, the extension provides auto-completion for search specific blocks and attributes, helping you build effective queries to find resources and configurations across your Terraform codebase.
46
+
47
+
This means that you can benefit from auto-completion, parameter info, quick info, and member lists when working with Terraform, Terraform Stacks, and Terraform Search files. Whether you're defining stacks, resources, variables, or search queries, the extension will provide context-specific completions to help you write your code more efficiently.
46
48
47
49
> **Note:** If there are syntax errors present in the document upon opening, intellisense may not provide all completions. Please fix the errors and reload the document and intellisense will return. See [hcl-lang#57](https://github.com/hashicorp/hcl-lang/issues/57) for more information.
48
50
@@ -64,13 +66,13 @@ Completing the snippet allows you to tab complete through each attribute and blo
64
66
65
67
### Syntax Validation
66
68
67
-
Terraformand Terraform Stacks configuration files are validated when opened and on change, and invalid code is marked with diagnostics.
69
+
Terraform, Terraform Stacks and Terraform Search configuration files are validated when opened and on change, and invalid code is marked with diagnostics.
68
70
69
71
HCL syntax is checked for e.g. missing control characters like `}`, `"` or others in the wrong place.
70
72
71
73

72
74
73
-
Enhanced validation of selected Terraform language constructs in both `*.tf` and `*.tfvars` files based on detected Terraform version and provider versions is also provided. This also works for Terraform Stacks language constructs in `*.tfcomponent.hcl`, `*.tfstack.hcl` and `*.tfdeploy.hcl` files.
75
+
Enhanced validation of selected Terraform language constructs in both `*.tf` and `*.tfvars` files based on detected Terraform version and provider versions is also provided. This validation also extends to language constructs for Terraform Search (`*.tfquery.hcl`) and Terraform Stacks (`*.tfcomponent.hcl`, `*.tfstack.hcl`, and `*.tfdeploy.hcl`).
74
76
75
77
This can highlight deprecations, missing required attributes or blocks, references to undeclared variables and more, [as documented](https://github.com/hashicorp/terraform-ls/blob/main/docs/validation.md#enhanced-validation).
76
78
@@ -96,13 +98,15 @@ Terraform syntax highlighting recognizes language constructs from Terraform vers
96
98
97
99
Terraform Stacks syntax highlighting recognizes language constructs from Terraform version 1.9 to 1.X.
98
100
101
+
Terraform Search syntax highlighting recognizes language constructs from Terraform version 1.14 to 1.X.
102
+
99
103

100
104
101
105
Some language constructs will highlight differently for older versions of Terraform that are incompatible with newer ways of expressing Terraform code. In these cases we lean toward ensuring the latest version of Terraform displays correctly and do our best with older versions.
102
106
103
107
### Code Navigation
104
108
105
-
While editing, you can right-click different identifiers in Terraformand Terraform Stacks files to take advantage of several convenient commands:
109
+
While editing, you can right-click different identifiers in Terraform, Terraform Stacks and Terraform Search files to take advantage of several convenient commands:
106
110
107
111
-`Go to Definition` (`F12`) navigates to the code that defines the construct where your cursor is. This command is helpful when you're working with Terraform modules and variables defined in other files than the currently opened document.
108
112
-`Peek Definition` (`Alt+F12`) displays the relevant code snippet for the construct where your cursor is directly in the current editor instead of navigating to another file.
@@ -113,7 +117,7 @@ While editing, you can right-click different identifiers in Terraform and Terraf
113
117
114
118
This extension utilizes [`terraform fmt`](https://www.terraform.io/cli/commands/fmt) to rewrite an open document to a canonical format and style. This command applies a subset of the [Terraform language style conventions](https://www.terraform.io/language/syntax/style), along with other minor adjustments for readability.
115
119
116
-
This works for both Terraform and Terraform Stacks files.
120
+
This works for Terraform, Terraform Stacks and Terraform Search files.
117
121
118
122
See the [Formatting](#formatting) Configuration section for information on how to configure this feature.
119
123
@@ -171,7 +175,6 @@ List Terraform providers used in the current open document in the Explorer Pane,
171
175
172
176

173
177
174
-
175
178
### Terraform MCP Server Integration
176
179
177
180
The extension registers the [Terraform MCP Server](https://github.com/hashicorp/terraform-mcp-server), which provides advanced AI assistance capabilities for Terraform development through the Model Context Protocol (MCP). For a complete list of features and capabilities, please refer to the [official](https://github.com/hashicorp/terraform-mcp-server) Terraform MCP Server documentation.
0 commit comments