Skip to content

Commit

Permalink
issue #18: Hints should be proposals instead of errors/warnings - don…
Browse files Browse the repository at this point in the history
…'t pollute the gutters anymore
  • Loading branch information
markiewb committed Nov 7, 2013
1 parent 7d6c810 commit 6628a77
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 13 deletions.
14 changes: 9 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,22 @@
<li>"Copy joined literals to clipboard"</li>
<li>"Split the String on linebreaks"</li>
<li>"Split at caret"</li>
<li>" Convert to assertTrue/assertFalse"</li>
<li>"Support transformation to BigDecimal constants"</li>
</ul><p>All hints (including more detailed descriptions) are available in the "suggestions" category within the hint configuration.</p>
<h2>Example:</h2>
<img src="https://raw.github.com/markiewb/nb-additional-hints/master/src/main/java/doc/screenshot.png"/>

<h2>Updates</h2>
<h3>1.1.0:</h3>
<ul>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/11">Feature 11</a>]: Support transformation to BigDecimal constants</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/5">Feature 5</a>]: Split a string at caret</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/13">Feature 13</a>]: Convert to assertTrue/assertFalse</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/8">Bug 8</a>]: Literals with quoted Strings won't be copied properly to clipboard</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/7">Refactoring 7</a>]: Convert to maven based module</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/11">Feature</a>]: Support transformation to BigDecimal constants</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/5">Feature</a>]: Split a string at caret</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/13">Feature</a>]: Convert to assertTrue/assertFalse</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/8">Bugfix</a>]: Literals with quoted Strings won't be copied properly to clipboard</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/7">Refactoring</a>]: Convert to maven based module</li>
<li>[<a href="https://github.com/markiewb/nb-additional-hints/issues/18">Refactoring</a>]: Hints should be proposals instead of errors/warnings</li>

</ul>
<h3>1.0.x:</h3>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.netbeans.spi.editor.hints.ErrorDescription;
import org.netbeans.spi.editor.hints.Fix;
import org.netbeans.spi.editor.hints.Severity;
import org.netbeans.spi.java.hints.ConstraintVariableType;
import org.netbeans.spi.java.hints.ErrorDescriptionFactory;
import org.netbeans.spi.java.hints.Hint;
Expand All @@ -18,7 +19,7 @@
"DN_SimplifyAssertMethods=Convert to assertTrue/assertFalse",
"DESC_SimplifyAssertMethods=Converts <tt>assertEquals</tt> expressions to their <tt>assertTrue/assertFalse</tt> counterparts. <br>For example: <tt>org.junit.Assert.assertEquals($msg, true, $var)</tt> will be transformed to <tt>org.junit.Assert.assertTrue($msg, $var)</tt>",
})
@Hint(displayName = "#DN_SimplifyAssertMethods", description = "#DESC_SimplifyAssertMethods", category = "testing")
@Hint(displayName = "#DN_SimplifyAssertMethods", description = "#DESC_SimplifyAssertMethods", category = "testing", hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
public class ConvertToAssertTrueFalse {

@TriggerPattern(value = "org.junit.Assert.assertEquals(true, $var)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"DESC_UseBigDecimalConstantsONE=Converts expressions like <tt>new java.math.BigDecimal(1)</tt> to <tt>BigDecimal.ONE</tt> ",})
public class UseBDConstFixONE {

@Hint(displayName = "#DN_UseBigDecimalConstantsONE", description = "#DESC_UseBigDecimalConstantsONE", category = "suggestions", hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
@Hint(displayName = "#DN_UseBigDecimalConstantsONE", description = "#DESC_UseBigDecimalConstantsONE", category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerPatterns(
{
@TriggerPattern("new java.math.BigDecimal(\"1\")"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"DESC_UseBigDecimalConstantsTEN=Converts expressions like <tt>new java.math.BigDecimal(10)</tt> to <tt>BigDecimal.TEN</tt> ",})
public class UseBDConstFixTEN {

@Hint(displayName = "#DN_UseBigDecimalConstantsTEN", description = "#DESC_UseBigDecimalConstantsTEN", category = "suggestions", hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
@Hint(displayName = "#DN_UseBigDecimalConstantsTEN", description = "#DESC_UseBigDecimalConstantsTEN", category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerPatterns(
{
@TriggerPattern("new java.math.BigDecimal(\"10\")"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"DESC_UseBigDecimalConstantsZERO=Converts expressions like <tt>new java.math.BigDecimal(0)</tt> to use <tt>BigDecimal.ZERO</tt> ",})
public class UseBDConstFixZERO {

@Hint(displayName = "#DN_UseBigDecimalConstantsZERO", description = "#DESC_UseBigDecimalConstantsZERO", category = "suggestions", hintKind = Hint.Kind.INSPECTION, severity = Severity.HINT)
@Hint(displayName = "#DN_UseBigDecimalConstantsZERO", description = "#DESC_UseBigDecimalConstantsZERO", category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT)
@TriggerPatterns(
{
@TriggerPattern("new java.math.BigDecimal(\"0\")"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
*/
@Hint(displayName = "#DN_BreakStringOnLineFeed",
description = "#DESC_BreakStringOnLineFeed",
category = "suggestions") //NOI18N
category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT) //NOI18N
@Messages({"DN_BreakStringOnLineFeed=Split the String on linebreaks",
"DESC_BreakStringOnLineFeed="
+ "Split the String on linebreaks symbols into separate concatenated literals. For example"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
*/
@Hint(displayName = "#DN_JoinLiterals",
description = "#DESC_JoinLiterals",
category = "suggestions") //NOI18N
category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT) //NOI18N
@Messages({"DN_JoinLiterals=Join literals",
"DESC_JoinLiterals=Joins separate literals. <p>For example: <code>\"Foo \" + \"Bar\"</code> will be transformed into <code>\"Foo Bar\"</code> </p>"})
public class JoinLiteralsHint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
*/
@Hint(displayName = "#DN_CopyJoinedStringToClipboard",
description = "#DESC_CopyJoinedStringToClipboard",
category = "suggestions") //NOI18N
category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT) //NOI18N
@Messages({"DN_CopyJoinedStringToClipboard=Copy joined literals to clipboard",
"DESC_CopyJoinedStringToClipboard=Copy the joined literals to clipboard. It converts escaped linebreaks into real linebreaks too."})
public class CopyJoinedStringToClipboardHint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
*/
@Hint(displayName = "#DN_ReplacePlus",
description = "#DESC_ReplacePlus",
category = "suggestions") //NOI18N
category = "suggestions", hintKind = Hint.Kind.ACTION, severity = Severity.HINT) //NOI18N
@Messages({"DN_ReplacePlus=Replace + with ...",
"DESC_ReplacePlus=Replace String concatenation with "
+ "<ul>"
Expand Down

0 comments on commit 6628a77

Please sign in to comment.