From 8613a92a6169cbc0dc5ad3a8d01b0bc0643cb615 Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Fri, 25 May 2012 16:27:57 +0400 Subject: [PATCH] unused def highlighting on reference name is back --- .../groovy/codeInspection/unusedDef/UnusedDefInspection.java | 2 +- .../testdata/highlighting/DefinitionUsedInSwitchCase.groovy | 2 +- .../groovy/testdata/highlighting/IfIncrementElseReturn.groovy | 2 +- plugins/groovy/testdata/highlighting/SwitchControlFlow.groovy | 2 +- plugins/groovy/testdata/highlighting/UnusedVariable.groovy | 2 +- plugins/groovy/testdata/highlighting/UsageInInjection.groovy | 2 +- .../testdata/highlighting/VeryLongDfaWithComplexGenerics.groovy | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/unusedDef/UnusedDefInspection.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/unusedDef/UnusedDefInspection.java index 8cd3b620ca1e..b74bd85d7457 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/unusedDef/UnusedDefInspection.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/unusedDef/UnusedDefInspection.java @@ -147,7 +147,7 @@ public class UnusedDefInspection extends GroovyLocalInspectionBase { } } else if (element instanceof GrVariable) { - toHighlight = ((GrVariable)element).getInitializerGroovy(); + toHighlight = ((GrVariable)element).getNameIdentifierGroovy(); } if (toHighlight == null) toHighlight = element; return toHighlight; diff --git a/plugins/groovy/testdata/highlighting/DefinitionUsedInSwitchCase.groovy b/plugins/groovy/testdata/highlighting/DefinitionUsedInSwitchCase.groovy index db5b2008f5c6..fe8d767a51a1 100644 --- a/plugins/groovy/testdata/highlighting/DefinitionUsedInSwitchCase.groovy +++ b/plugins/groovy/testdata/highlighting/DefinitionUsedInSwitchCase.groovy @@ -14,7 +14,7 @@ * limitations under the License. */ def m = [a: 1, b: 2] -def m1 = [a: 1, b: 2] +def m1 = [a: 1, b: 2] def val = 'a' switch (val) { diff --git a/plugins/groovy/testdata/highlighting/IfIncrementElseReturn.groovy b/plugins/groovy/testdata/highlighting/IfIncrementElseReturn.groovy index db5b2008f5c6..fe8d767a51a1 100644 --- a/plugins/groovy/testdata/highlighting/IfIncrementElseReturn.groovy +++ b/plugins/groovy/testdata/highlighting/IfIncrementElseReturn.groovy @@ -14,7 +14,7 @@ * limitations under the License. */ def m = [a: 1, b: 2] -def m1 = [a: 1, b: 2] +def m1 = [a: 1, b: 2] def val = 'a' switch (val) { diff --git a/plugins/groovy/testdata/highlighting/SwitchControlFlow.groovy b/plugins/groovy/testdata/highlighting/SwitchControlFlow.groovy index bd45c16a39d4..75f8b63eccc8 100644 --- a/plugins/groovy/testdata/highlighting/SwitchControlFlow.groovy +++ b/plugins/groovy/testdata/highlighting/SwitchControlFlow.groovy @@ -16,7 +16,7 @@ def testV(def variable) { def v = "s" def m="10" - def x="10" + def x="10" try { switch (variable) { case 1: diff --git a/plugins/groovy/testdata/highlighting/UnusedVariable.groovy b/plugins/groovy/testdata/highlighting/UnusedVariable.groovy index d4b0eb0364cb..6e67c62fba3e 100644 --- a/plugins/groovy/testdata/highlighting/UnusedVariable.groovy +++ b/plugins/groovy/testdata/highlighting/UnusedVariable.groovy @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -Class clazz = null \ No newline at end of file +Class clazz = null \ No newline at end of file diff --git a/plugins/groovy/testdata/highlighting/UsageInInjection.groovy b/plugins/groovy/testdata/highlighting/UsageInInjection.groovy index 5840ca40e0e8..3b0f5436015a 100644 --- a/plugins/groovy/testdata/highlighting/UsageInInjection.groovy +++ b/plugins/groovy/testdata/highlighting/UsageInInjection.groovy @@ -15,6 +15,6 @@ */ def x = new Date() def y = new Date() -def z = new Date() +def z = new Date() assert false : "should have thrown exception, but returned $x" assert false : "should have thrown exception, but returned ${y}" \ No newline at end of file diff --git a/plugins/groovy/testdata/highlighting/VeryLongDfaWithComplexGenerics.groovy b/plugins/groovy/testdata/highlighting/VeryLongDfaWithComplexGenerics.groovy index 1d67e40d8e71..952de9bdc403 100644 --- a/plugins/groovy/testdata/highlighting/VeryLongDfaWithComplexGenerics.groovy +++ b/plugins/groovy/testdata/highlighting/VeryLongDfaWithComplexGenerics.groovy @@ -19,7 +19,7 @@ class TroubleCase { private Foo fooBaz; private void troubleMethod(boolean b) { - def icDao = (b?fooBaz:fooBar); + def icDao = (b?fooBaz:fooBar); for(Object x: new ArrayList()) { }