Skip to content

Commit

Permalink
bugfix: auto-completion with verified examples showed for wrong resou…
Browse files Browse the repository at this point in the history
…rce types
  • Loading branch information
ms-henglu committed Jan 12, 2024
1 parent 42be29a commit fbcc176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
ENHANCEMENTS:
- `azapi_resource` resource: Support `ignore_body_changes` property.

BUG FIXES:
- Fix a bug that auto-completion with verified examples showed for wrong resource types.

## v1.11.0
ENHANCEMENTS:
- Update bicep types to https://github.com/ms-henglu/bicep-types-az/commit/fcfe2a66a04575f204767182fc575612c82eebc1
Expand Down
6 changes: 5 additions & 1 deletion internal/langserver/handlers/snippets/snippets.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ func (field Field) Order() int {
}

func CodeSampleCandidates(block *hclsyntax.Block, editRange lsp.Range) []lsp.CompletionItem {
if block == nil {
if block == nil || block.Type == "data" {
return nil
}

if len(block.Labels) != 2 || block.Labels[0] != "azapi_resource" {
return nil
}

Expand Down

0 comments on commit fbcc176

Please sign in to comment.