Skip to content

Commit 38da429

Browse files
authored
docs(readme): Added: documentation for Terraform Search (#2131)
* docs(readme): TF-30833: Added: documentation for Terraform Search
1 parent 3d9d18b commit 38da429

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: NOTES
2+
body: Added documentation for Terraform Search
3+
time: 2025-09-24T11:34:26.843096+05:30
4+
custom:
5+
Issue: "2131"
6+
Repository: vscode-terraform

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Terraform Extension for Visual Studio Code
22

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!
44

55
## Quick Start
66

@@ -10,7 +10,7 @@ Get started writing Terraform configurations with VS Code in three steps:
1010

1111
- **Step 2:** Install the [Terraform Extension for VS Code](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform).
1212

13-
- **Step 3:** To activate the extension, open any folder or VS Code workspace containing Terraform or 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.
1414

1515
New to Terraform? Read the [Terraform Learning guides](https://learn.hashicorp.com/terraform)
1616

@@ -20,11 +20,11 @@ Read the [Troubleshooting Guide](#troubleshooting) for answers to common questio
2020

2121
## Features
2222

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

2525
- [IntelliSense](#intellisense-and-autocomplete) Edit your code with auto-completion of providers, resource names, data sources, attributes, components and more
2626
- [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.X and Terraform Stacks
27+
- [Syntax highlighting](#syntax-highlighting) Highlighting syntax for Terraform 0.12 to 1.X, Terraform Stacks and Terraform Search
2828
- [Code Navigation](#code-navigation) Navigate through your codebase with Go to Definition and Symbol support
2929
- [Code Formatting](#code-formatting) Format your code with `terraform fmt` automatically
3030
- [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
3434

3535
### IntelliSense and Autocomplete
3636

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

3939
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.
4040

4141
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.
4242

4343
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.
4444

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

4749
> **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.
4850
@@ -64,13 +66,13 @@ Completing the snippet allows you to tab complete through each attribute and blo
6466

6567
### Syntax Validation
6668

67-
Terraform and 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.
6870

6971
HCL syntax is checked for e.g. missing control characters like `}`, `"` or others in the wrong place.
7072

7173
![](docs/validation-rule-hcl.png)
7274

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`).
7476

7577
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).
7678

@@ -96,13 +98,15 @@ Terraform syntax highlighting recognizes language constructs from Terraform vers
9698

9799
Terraform Stacks syntax highlighting recognizes language constructs from Terraform version 1.9 to 1.X.
98100

101+
Terraform Search syntax highlighting recognizes language constructs from Terraform version 1.14 to 1.X.
102+
99103
![](docs/syntax.png)
100104

101105
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.
102106

103107
### Code Navigation
104108

105-
While editing, you can right-click different identifiers in Terraform and 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:
106110

107111
- `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.
108112
- `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
113117

114118
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.
115119

116-
This works for both Terraform and Terraform Stacks files.
120+
This works for Terraform, Terraform Stacks and Terraform Search files.
117121

118122
See the [Formatting](#formatting) Configuration section for information on how to configure this feature.
119123

@@ -171,7 +175,6 @@ List Terraform providers used in the current open document in the Explorer Pane,
171175

172176
![](docs/module_providers.png)
173177

174-
175178
### Terraform MCP Server Integration
176179

177180
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

Comments
 (0)