From d5d2a9637c44260f7ab88abacfdf6a48a45bcc75 Mon Sep 17 00:00:00 2001 From: AlexHaxe Date: Mon, 23 May 2022 01:15:42 +0200 Subject: [PATCH] fixed bug in readBlock passing incorrect child token --- CHANGELOG.md | 4 ++++ haxelib.json | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- src/refactor/Refactor.hx | 2 +- src/refactor/discover/UsageCollector.hx | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 475b2bb..2811603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## dev branch / next version (2.x.x) +## 2.2.2 (2022-05-23) + +- fixed bug in readBlock passing incorrect child token + ## 2.2.1 (2022-05-20) - fixed local var scope diff --git a/haxelib.json b/haxelib.json index e68d05c..28679ab 100644 --- a/haxelib.json +++ b/haxelib.json @@ -8,8 +8,8 @@ "refactor" ], "description": "A code renaming tool for Haxe", - "version": "2.2.1", - "releasenote": "fixed local var scope - see CHANGELOG", + "version": "2.2.2", + "releasenote": "fixed bug in readBlock passing incorrect child token - see CHANGELOG", "contributors": [ "AlexHaxe" ], diff --git a/package-lock.json b/package-lock.json index 2b23521..a7dcd92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@haxecheckstyle/haxe-rename", - "version": "2.2.1", + "version": "2.2.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@haxecheckstyle/haxe-rename", - "version": "2.2.1", + "version": "2.2.2", "license": "MIT", "bin": { "haxe-rename": "bin/rename.js" diff --git a/package.json b/package.json index 67fb9a6..edf1651 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@haxecheckstyle/haxe-rename", - "version": "2.2.1", + "version": "2.2.2", "description": "Renaming tool for Haxe", "repository": { "type": "git", diff --git a/src/refactor/Refactor.hx b/src/refactor/Refactor.hx index 6f05d83..60c7e70 100644 --- a/src/refactor/Refactor.hx +++ b/src/refactor/Refactor.hx @@ -120,7 +120,7 @@ class Refactor { case CaseLabel(_): Promise.reject(RefactorResult.Unsupported(identifier.toString()).printRefactorResult()); case ScopedLocal(scopeStart, scopeEnd, type): - context.verboseLog('rename scoped local "${identifier.name} [$scopeStart - $scopeEnd]" (${type.scopeTypeToString()}) to "${context.what.toName}"'); + context.verboseLog('rename scoped local "${identifier.name}" (${type.scopeTypeToString()}) to "${context.what.toName}"'); RenameScopedLocal.refactorScopedLocal(context, file, identifier, scopeStart, scopeEnd); } } diff --git a/src/refactor/discover/UsageCollector.hx b/src/refactor/discover/UsageCollector.hx index a6953ff..cb8a44e 100644 --- a/src/refactor/discover/UsageCollector.hx +++ b/src/refactor/discover/UsageCollector.hx @@ -568,7 +568,7 @@ class UsageCollector { case Kwd(KwdFunction): child = child.getFirstChild(); var method:Identifier = makeIdentifier(context, child, ScopedLocal(child.pos.min, scopeEnd, Var), identifier); - readMethod(context, method, child.getFirstChild()); + readMethod(context, method, child); case Dot: case Semicolon: default: