diff --git a/decoder/candidates.go b/decoder/candidates.go index 344d656a..85210221 100644 --- a/decoder/candidates.go +++ b/decoder/candidates.go @@ -273,7 +273,7 @@ func isPosOutsideBody(block *hclsyntax.Block, pos hcl.Pos) bool { return true } - if block.DefRange().ContainsPos(pos) { + if hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).ContainsPos(pos) { return true } diff --git a/go.mod b/go.mod index d47311af..bc9b3cf1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( github.com/google/go-cmp v0.5.6 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/hcl/v2 v2.10.1 + github.com/hashicorp/hcl/v2 v2.11.1 github.com/mh-cbon/go-fmt-fail v0.0.0-20160815164508-67765b3fbcb5 github.com/zclconf/go-cty v1.10.0 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b diff --git a/go.sum b/go.sum index 01bb0055..776ca92f 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/U github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/hcl/v2 v2.10.1 h1:h4Xx4fsrRE26ohAk/1iGF/JBqRQbyUqu5Lvj60U54ys= -github.com/hashicorp/hcl/v2 v2.10.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= +github.com/hashicorp/hcl/v2 v2.11.1 h1:yTyWcXcm9XB0TEkyU/JCRU6rYy4K+mgLtzn2wlrJbcc= +github.com/hashicorp/hcl/v2 v2.11.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=