This is an automated email from the ASF dual-hosted git repository.
geertjan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 33cc1bd NETBEANS-999: Show var hints when caret on current line (#617)
33cc1bd is described below
commit 33cc1bd4ca1c8262bd9c47cdae4fb3fb3a51f8ab
Author: Reema Taneja <[email protected]>
AuthorDate: Tue Jul 3 03:22:08 2018 -0700
NETBEANS-999: Show var hints when caret on current line (#617)
---
.../src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java | 3 ++-
.../org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitType.java | 3 ++-
.../src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java | 2 +-
.../netbeans/modules/java/hints/jdk/ConvertVarToExplicitTypeTest.java | 2 +-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git
a/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
b/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
index c001f7d..684ab15 100644
--- a/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
+++ b/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHint.java
@@ -34,6 +34,7 @@ import org.netbeans.api.java.source.CompilationInfo;
import org.netbeans.api.java.source.TreeMaker;
import org.netbeans.api.java.source.WorkingCopy;
import org.netbeans.spi.editor.hints.ErrorDescription;
+import org.netbeans.spi.editor.hints.Severity;
import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
import org.netbeans.spi.java.hints.Hint;
import org.netbeans.spi.java.hints.HintContext;
@@ -54,7 +55,7 @@ import org.netbeans.modules.java.hints.errors.Utilities;
*
* @author arusinha
*/
-@Hint(displayName = "#DN_CanUseVarForExplicitType", description =
"#DESC_CanUseVarForExplicitType", category = "rules15", minSourceVersion =
"10") //NOI18N
+@Hint(displayName = "#DN_CanUseVarForExplicitType", description =
"#DESC_CanUseVarForExplicitType", category = "rules15", severity =
Severity.HINT, minSourceVersion = "10") //NOI18N
@Messages("MSG_ConvertibleToVarType=Explict type can be replaced with 'var'")
//NOI18N
public class ConvertToVarHint {
diff --git
a/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitType.java
b/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitType.java
index db826e7..13a19d8 100644
---
a/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitType.java
+++
b/java.hints/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitType.java
@@ -34,6 +34,7 @@ import org.netbeans.api.java.source.TreeMaker;
import org.netbeans.api.java.source.WorkingCopy;
import org.netbeans.modules.java.hints.errors.Utilities;
import org.netbeans.spi.editor.hints.ErrorDescription;
+import org.netbeans.spi.editor.hints.Severity;
import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
import org.netbeans.spi.java.hints.Hint;
import org.netbeans.spi.java.hints.HintContext;
@@ -48,7 +49,7 @@ import org.openide.util.NbBundle.Messages;
*
* @author rtaneja
*/
-@Hint(displayName = "#DN_ConvertVarToExplicitType", description =
"#DESC_ConvertVarToExplicitType", category = "rules15", minSourceVersion = "10")
+@Hint(displayName = "#DN_ConvertVarToExplicitType", description =
"#DESC_ConvertVarToExplicitType", category = "rules15", severity =
Severity.HINT, minSourceVersion = "10")
@Messages("MSG_ConvertibleToExplicitType=Convert var to explicit type")
public class ConvertVarToExplicitType {
diff --git
a/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
b/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
index ebf1991..4ea2814 100644
---
a/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
+++
b/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertToVarHintTest.java
@@ -29,7 +29,7 @@ import org.netbeans.modules.java.hints.test.api.HintTest;
public class ConvertToVarHintTest {
private static final String VAR_CONV_DESC = "Explict type can be replaced
with 'var'"; //NOI18N
- private static final String VAR_CONV_WARNING = "verifier:" +
VAR_CONV_DESC; //NOI18N
+ private static final String VAR_CONV_WARNING = "hint:" + VAR_CONV_DESC;
//NOI18N
@Test
public void testIntLiteralRefToVar() throws Exception {
diff --git
a/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitTypeTest.java
b/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitTypeTest.java
index 69bbe47..84cf5bd 100644
---
a/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitTypeTest.java
+++
b/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertVarToExplicitTypeTest.java
@@ -27,7 +27,7 @@ import org.netbeans.modules.java.hints.test.api.HintTest;
*/
public class ConvertVarToExplicitTypeTest {
private static final String VAR_CONV_DESC = "Convert var to explicit
type";//NOI18N
- private static final String VAR_CONV_WARNING = "verifier:" +
VAR_CONV_DESC; //NOI18N
+ private static final String VAR_CONV_WARNING = "hint:" + VAR_CONV_DESC;
//NOI18N
@Test
public void testConvertVartoIntType() throws Exception {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists