mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
move "Convert to Basic Latin" inspection to java-i18n module for consistency and to avoid weird inspection group "i18n" with one element
GitOrigin-RevId: 05889f1728fbe5d7001ee28e305883adb2fe91d4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
166bac588a
commit
b054a001ec
@@ -1649,10 +1649,6 @@
|
||||
groupKey="group.names.declaration.redundancy" groupBundle="messages.InspectionsBundle"
|
||||
enabledByDefault="true" level="WARNING"
|
||||
implementationClass="com.intellij.codeInspection.DefaultAnnotationParamInspection" />
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="ConvertToBasicLatin" bundle="messages.JavaBundle" key="inspection.convert.to.basic.latin"
|
||||
groupKey="group.names.i18n" groupBundle="messages.InspectionsBundle"
|
||||
enabledByDefault="true" level="INFORMATION"
|
||||
implementationClass="com.intellij.codeInspection.ConvertToBasicLatinInspection" />
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="SillyAssignment" bundle="messages.JavaBundle" key="inspection.variable.assigned.to.itself.display.name"
|
||||
groupKey="group.names.declaration.redundancy" groupBundle="messages.InspectionsBundle"
|
||||
enabledByDefault="true" level="WARNING"
|
||||
|
||||
@@ -373,7 +373,6 @@ inspection.comparator.result.comparison.problem.display.name=Comparison of compa
|
||||
inspection.conditional.break.in.infinite.loop=Move condition to loop
|
||||
inspection.conditional.break.in.infinite.loop.description=Conditional break inside infinite loop
|
||||
inspection.conditional.break.in.infinite.loop.no.conversion.with.do.while=Don't suggest to replace with 'do while'
|
||||
inspection.convert.to.basic.latin=Convert to Basic Latin
|
||||
inspection.convert.to.local.quickfix=Convert to local
|
||||
inspection.data.flow.display.name=Constant conditions \\& exceptions
|
||||
inspection.data.flow.filter.notnull.quickfix=Insert 'filter(Objects::nonNull)' step
|
||||
|
||||
@@ -190,7 +190,6 @@ group.names.properties.files=Properties files
|
||||
group.names.xml=XML
|
||||
group.names.toString.issues=toString() issues
|
||||
group.names.reflective.access.issues=Reflective access
|
||||
group.names.i18n=I18N
|
||||
|
||||
duplicate.property.display.name=Duplicate property
|
||||
suppress.inspection.annotation.syntax.error=Incorrect annotation syntax: {0}
|
||||
|
||||
+8
-3
@@ -11,6 +11,7 @@ import com.intellij.openapi.fileTypes.*;
|
||||
import com.intellij.openapi.fileTypes.ex.FakeFileType;
|
||||
import com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -54,7 +55,9 @@ class OverrideFileTypeAction extends AnAction {
|
||||
ActionsBundle.message("group.OverrideFileTypeAction.fromNamedPlugin", descriptor.getName()))
|
||||
+ ")";
|
||||
}
|
||||
group.add(new ChangeToThisFileTypeAction(file, type, dupHint));
|
||||
@NlsActions.ActionText
|
||||
String displayText = type.getDisplayName() + StringUtil.notNullize(dupHint);
|
||||
group.add(new ChangeToThisFileTypeAction(displayText, file, type));
|
||||
}
|
||||
JBPopupFactory.getInstance()
|
||||
.createActionGroupPopup(ActionsBundle.message("group.OverrideFileTypeAction.title"),
|
||||
@@ -66,8 +69,10 @@ class OverrideFileTypeAction extends AnAction {
|
||||
private final VirtualFile myFile;
|
||||
private final FileType myType;
|
||||
|
||||
ChangeToThisFileTypeAction(@NotNull VirtualFile file, @NotNull FileType type, String dupHint) {
|
||||
super(type.getDisplayName() + StringUtil.notNullize(dupHint),
|
||||
ChangeToThisFileTypeAction(@NotNull @NlsActions.ActionText String displayText,
|
||||
@NotNull VirtualFile file,
|
||||
@NotNull FileType type) {
|
||||
super(displayText,
|
||||
ActionsBundle.message("action.ChangeToThisFileTypeAction.description", file.getName(), type.getDescription()), type.getIcon());
|
||||
myFile = file;
|
||||
myType = type;
|
||||
|
||||
+1
-1
@@ -426,7 +426,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
throw new UncheckedIOException("sourceFile="+sourceFile, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,5 +26,6 @@
|
||||
<orderEntry type="library" name="StreamEx" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.core.ui" />
|
||||
<orderEntry type="library" name="icu4j" level="project" />
|
||||
<orderEntry type="library" name="fastutil-min" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -94,3 +94,4 @@ command.name.edit.property.value=Edit Property Value
|
||||
checkbox.fold.to.context=Fold '{0}', '{1}', ... placeholders to corresponding context expressions from Java/Kotlin code
|
||||
inspection.dialog.title.capitalization.display.name=Incorrect string capitalization
|
||||
inspection.suspicious.locales.languages.display.name=Suspicious resource bundle locale languages
|
||||
inspection.convert.to.basic.latin=Convert to Basic Latin
|
||||
|
||||
@@ -67,7 +67,10 @@
|
||||
level="WARNING"
|
||||
implementationClass="com.intellij.codeInspection.SuspiciousLocalesLanguagesInspection"
|
||||
key="inspection.suspicious.locales.languages.display.name" bundle="messages.JavaI18nBundle"/>
|
||||
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="ConvertToBasicLatin" bundle="messages.JavaI18nBundle" key="inspection.convert.to.basic.latin"
|
||||
groupKey="group.names.internationalization.issues" groupBundle="messages.InspectionsBundle"
|
||||
enabledByDefault="true" level="INFORMATION"
|
||||
implementationClass="com.intellij.codeInspection.i18n.ConvertToBasicLatinInspection" />
|
||||
<intentionAction>
|
||||
<className>com.intellij.codeInspection.capitalization.AnnotateCapitalizationIntention</className>
|
||||
<category>Java/I18N</category>
|
||||
|
||||
+8
-6
@@ -1,7 +1,8 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection;
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.i18n;
|
||||
|
||||
import com.intellij.java.JavaBundle;
|
||||
import com.intellij.codeInspection.*;
|
||||
import com.intellij.java.i18n.JavaI18nBundle;
|
||||
import com.intellij.javaee.ExternalResourceManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -36,12 +37,13 @@ public class ConvertToBasicLatinInspection extends AbstractBaseJavaLocalInspecti
|
||||
public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
|
||||
return new JavaElementVisitor() {
|
||||
@Nullable
|
||||
@SuppressWarnings("DialogTitleCapitalization" /* "Basic Latin" is a proper noun */)
|
||||
private ProblemDescriptor getProblem(PsiElement element) {
|
||||
if (IOUtil.isAscii(element.getText())) return null;
|
||||
// "Basic Latin" is a proper noun
|
||||
//noinspection DialogTitleCapitalization
|
||||
return holder.getManager().createProblemDescriptor(element,
|
||||
(TextRange)null,
|
||||
JavaBundle.message("inspection.convert.to.basic.latin"),
|
||||
JavaI18nBundle.message("inspection.convert.to.basic.latin"),
|
||||
ProblemHighlightType.INFORMATION,
|
||||
isOnTheFly,
|
||||
new MyLocalQuickFix());
|
||||
@@ -198,7 +200,7 @@ public class ConvertToBasicLatinInspection extends AbstractBaseJavaLocalInspecti
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return JavaBundle.message("inspection.convert.to.basic.latin");
|
||||
return JavaI18nBundle.message("inspection.convert.to.basic.latin");
|
||||
}
|
||||
|
||||
@Override
|
||||
+8
-8
@@ -1,16 +1,16 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.java.codeInsight.daemon.quickFix;
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInspection.ConvertToBasicLatinInspection;
|
||||
import com.intellij.java.JavaBundle;
|
||||
import com.intellij.codeInspection.i18n.ConvertToBasicLatinInspection;
|
||||
import com.intellij.java.i18n.JavaI18nBundle;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
|
||||
|
||||
public class ConvertToBasicLatinTest extends LightJavaCodeInsightFixtureTestCase {
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/convertToBasicLatin/";
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getCommunityHomePath() + "/plugins/java-i18n/testData/quickFix/convertToBasicLatin";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,7 +30,7 @@ public class ConvertToBasicLatinTest extends LightJavaCodeInsightFixtureTestCase
|
||||
|
||||
private void doTest() {
|
||||
myFixture.configureByFiles(getTestName(false) + ".java");
|
||||
final IntentionAction singleIntention = myFixture.findSingleIntention(JavaBundle.message("inspection.convert.to.basic.latin"));
|
||||
final IntentionAction singleIntention = myFixture.findSingleIntention(JavaI18nBundle.message("inspection.convert.to.basic.latin"));
|
||||
myFixture.launchAction(singleIntention);
|
||||
myFixture.checkResultByFile(getTestName(false) + ".java", getTestName(false) + "_after.java", true);
|
||||
}
|
||||
Reference in New Issue
Block a user