Skip to content

Commit 18e8cd3

Browse files
Yantriodiofeher
authored andcommitted
Add underscore as a completion trigger character
This allows editors to request completions easier when a end-user inputs "_" inside a resource type label for example, (e.g `resource "aws_`) This improves the completion experience along with opentofu/hcl-lang#2 to allow users to get improved completion when writing resources Signed-off-by: James Humphries <james@james-humphries.co.uk>
1 parent 58a2db2 commit 18e8cd3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/langserver/handlers/handlers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func initializeResponse(t *testing.T, commandPrefix string) string {
4141
"save": {}
4242
},
4343
"completionProvider": {
44-
"triggerCharacters": [".", "["],
44+
"triggerCharacters": [".", "[", "_"],
4545
"resolveProvider": true
4646
},
4747
"hoverProvider": true,

internal/langserver/handlers/initialize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func initializeResult(ctx context.Context) lsp.InitializeResult {
177177
},
178178
CompletionProvider: lsp.CompletionOptions{
179179
ResolveProvider: true,
180-
TriggerCharacters: []string{".", "["},
180+
TriggerCharacters: []string{".", "[", "_"},
181181
},
182182
CodeActionProvider: lsp.CodeActionOptions{
183183
CodeActionKinds: ilsp.SupportedCodeActions.AsSlice(),

0 commit comments

Comments
 (0)