From 4f058f2a2548e43ff728243e6196875df57538c1 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 23 Nov 2021 16:00:10 +0100 Subject: [PATCH] fix PathOrigin matching --- go.mod | 2 +- go.sum | 3 ++- internal/codelens/reference_count.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ea446fe47..2f5281c6e 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/go-version v1.3.0 - github.com/hashicorp/hcl-lang v0.0.0-20211118124824-da3a292c5d7a + github.com/hashicorp/hcl-lang v0.0.0-20211123142056-191cd51dec5b github.com/hashicorp/hcl/v2 v2.10.1 github.com/hashicorp/terraform-exec v0.15.0 github.com/hashicorp/terraform-json v0.13.0 diff --git a/go.sum b/go.sum index a5873f0fb..d75b57bac 100644 --- a/go.sum +++ b/go.sum @@ -191,8 +191,9 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl-lang v0.0.0-20211118124824-da3a292c5d7a h1:NOcXX/HO5KHrQPjClxRuHO+Hu90CDhZqM5CNKvlcRkg= github.com/hashicorp/hcl-lang v0.0.0-20211118124824-da3a292c5d7a/go.mod h1:0W3+VP07azoS+fCX5hWk1KxwHnqf1s9J7oBg2cFXm1c= +github.com/hashicorp/hcl-lang v0.0.0-20211123142056-191cd51dec5b h1:UircH3n8tUnq881dS1EV/m+ZcIKjZq9jzl0M65PAdWU= +github.com/hashicorp/hcl-lang v0.0.0-20211123142056-191cd51dec5b/go.mod h1:0W3+VP07azoS+fCX5hWk1KxwHnqf1s9J7oBg2cFXm1c= 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/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= diff --git a/internal/codelens/reference_count.go b/internal/codelens/reference_count.go index 3a198d9d4..b4c6f0354 100644 --- a/internal/codelens/reference_count.go +++ b/internal/codelens/reference_count.go @@ -60,7 +60,7 @@ func ReferenceCount(showReferencesCmdId string) lang.CodeLensFunc { if err != nil { continue } - originCount += len(pathCtx.ReferenceOrigins.Match(refTarget, path)) + originCount += len(pathCtx.ReferenceOrigins.Match(p, refTarget, path)) } }