hashicorp / hcl2

Former temporary home for experimental new version of HCL
https://github.com/hashicorp/hcl
Mozilla Public License 2.0
373 stars 66 forks source link

hclsyntax: return the starting position of a missing attr, not the end. #97

Closed mildwonkey closed 5 years ago

mildwonkey commented 5 years ago

Previously, hclsyntax MissingItemRange() function returned a zero-length range anchored at the end of the block in question. This commit changes that to the beginning of the block. In practice, the end of a block is generally just a "}" and not very useful in error messages.

Fixes #93

codecov-io commented 5 years ago

Codecov Report

Merging #97 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
+ Coverage   68.52%   68.53%   +<.01%     
==========================================
  Files          97       97              
  Lines       10175    10178       +3     
==========================================
+ Hits         6972     6975       +3     
  Misses       2877     2877              
  Partials      326      326
Impacted Files Coverage Δ
hcl/hclsyntax/structure.go 75.48% <100%> (+0.35%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3fb4ed0...4d89217. Read the comment docs.