mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
"Convert to engineering notation" intention actually converts to a scientific one
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
</intentionAction>
|
||||
|
||||
<intentionAction>
|
||||
<className>com.siyeh.ipp.integer.ConvertToEngineeringNotationIntention</className>
|
||||
<className>com.siyeh.ipp.integer.ConvertToScientificNotationIntention</className>
|
||||
<categoryKey>intention.category.numbers</categoryKey>
|
||||
</intentionAction>
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ convert.integer.to.hex.intention.name=Convert to hex
|
||||
convert.integer.to.hex.intention.family.name=Convert to Hexadecimal
|
||||
convert.integer.to.binary.intention.name=Convert to binary
|
||||
convert.integer.to.binary.intention.family.name=Convert to Binary
|
||||
convert.to.engineering.notation.intention.name=Convert to engineering notation
|
||||
convert.to.engineering.notation.intention.family.name=Convert to Engineering Notation
|
||||
convert.to.scientific.notation.intention.name=Convert to scientific notation
|
||||
convert.to.scientific.notation.intention.family.name=Convert to Scientific Notation
|
||||
convert.to.plain.intention.name=Convert to plain
|
||||
convert.to.plain.intention.family.name=Convert to Plain
|
||||
string.to.char.intention.name=Replace string literal with character
|
||||
|
||||
+2
-3
@@ -25,9 +25,8 @@ import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
* todo: actually it's a scientific notation, not an engineering one.
|
||||
*/
|
||||
public class ConvertToEngineeringNotationIntention extends ConvertNumberIntentionBase {
|
||||
public class ConvertToScientificNotationIntention extends ConvertNumberIntentionBase {
|
||||
private static final DecimalFormat FORMAT = new DecimalFormat("0.0#############E00", new DecimalFormatSymbols(Locale.US));
|
||||
|
||||
@Override
|
||||
@@ -40,6 +39,6 @@ public class ConvertToEngineeringNotationIntention extends ConvertNumberIntentio
|
||||
@NotNull
|
||||
@Override
|
||||
protected PsiElementPredicate getElementPredicate() {
|
||||
return new ConvertToEngineeringNotationPredicate();
|
||||
return new ConvertToScientificNotationPredicate();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -23,7 +23,7 @@ import com.siyeh.ipp.base.PsiElementPredicate;
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
class ConvertToEngineeringNotationPredicate implements PsiElementPredicate {
|
||||
class ConvertToScientificNotationPredicate implements PsiElementPredicate {
|
||||
|
||||
public boolean satisfiedBy(PsiElement element) {
|
||||
if (!(element instanceof PsiLiteralExpression)) {
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
<font face="verdana" size="-1">This intention converts selected double or float literal written in <b>decimal</b> notation
|
||||
into <b>engineering</b> notation.
|
||||
into <b>scientific</b> notation.
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,9 +19,9 @@ import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
public class ConvertToPlainTest extends IPPTestCase {
|
||||
public void testEngToPlain() { doTest(); }
|
||||
public void testToPlain() { doTest(); }
|
||||
public void testNegatedFloatToPlain() { doTest(); }
|
||||
public void testToPlainWithUnderscores() { doTest(); }
|
||||
public void testWithUnderscoresToPlain() { doTest(); }
|
||||
|
||||
@Override
|
||||
protected String getIntentionName() {
|
||||
|
||||
+5
-5
@@ -18,14 +18,14 @@ package com.siyeh.ipp.integer;
|
||||
import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
public class ConvertToEngineeringNotationTest extends IPPTestCase {
|
||||
public void testPlainToEng() { doTest(); }
|
||||
public void testNegatedFloatToEng() { doTest(); }
|
||||
public void testToEngWithUnderscores() { doTest(); }
|
||||
public class ConvertToScientificNotationTest extends IPPTestCase {
|
||||
public void testToSci() { doTest(); }
|
||||
public void testNegatedFloatToSci() { doTest(); }
|
||||
public void testWithUnderscoresToSci() { doTest(); }
|
||||
|
||||
@Override
|
||||
protected String getIntentionName() {
|
||||
return IntentionPowerPackBundle.message("convert.to.engineering.notation.intention.name");
|
||||
return IntentionPowerPackBundle.message("convert.to.scientific.notation.intention.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
Reference in New Issue
Block a user