Setup Missing API inspection
This commit is contained in:
committed by
Nikolay Krasko
parent
d8b364ea40
commit
8977d0e26d
+11
-21
@@ -98,31 +98,27 @@
|
||||
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="problems">
|
||||
<list>
|
||||
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
|
||||
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
|
||||
<Problem reference="com.intellij.psi.search.PsiSearchHelper#getInstance" reason="Absent in 181. Use psiSearchHelperInstance() instead." />
|
||||
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
|
||||
<Problem reference="com.intellij.execution.JavaRunConfigurationExtensionManager#getInstance" reason="Can't be used in Kotlin, because method was replaced with property after J2K in 183. Use JavaRunConfigurationExtensionManagerUtil instead." />
|
||||
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
|
||||
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
|
||||
<Problem reference="com.intellij.execution.configurations.RunConfigurationBase" reason="Generalized in 183. Use RunConfigurationBaseAny instead in signatures." />
|
||||
<Problem reference="com.intellij.execution.configurations.LocatableConfigurationBase" reason="Generalized in 183. Use LocatableConfigurationBaseAny instead in signatures." />
|
||||
<Problem reference="com.intellij.execution.configurations.ModuleBasedConfiguration" reason="Generalized in 183. Use ModuleBasedConfigurationElement instead." />
|
||||
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
|
||||
<Problem reference="com.intellij.testFramework.codeInsight.hierarchy.HierarchyViewTestFixture" reason="Absent in <= 181. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
|
||||
<Problem reference="org.jetbrains.kotlin.test.HierarchyViewTestFixtureCompat" reason="Do not use the wrapper for 181 directly. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
|
||||
<Problem reference="com.intellij.psi.codeStyle.CodeStyleSettingsProvider" reason="Additional method is introduced in 183 instead of deprecated one. Use CodeStyleSettingsProviderCompat instead." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getExtensionList()" reason="Absent in 182 and before." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#extensions()" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#hasAnyExtensions" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getExtensionList(com.intellij.openapi.extensions.AreaInstance)" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#extensions(com.intellij.openapi.extensions.AreaInstance)" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getPoint" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#findExtensionOrFail" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.openapi.ui.popup.PopupChooserBuilder#PopupChooserBuilder(javax.swing.JList)" reason="Generified in 182. Use PopupChooserBuilderWrapper instead." />
|
||||
<Problem reference="com.intellij.openapi.editor.event.EditorFactoryListener" reason="Default implementations were added in 183. Use EditorFactoryListenerWrapper for inheritance instead." />
|
||||
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
|
||||
<Problem reference="com.intellij.openapi.diagnostic.LoggerKt#debugOrInfoIfTestMode" reason="Absent in 182." />
|
||||
<Problem reference="com.intellij.psi.search.PsiSearchHelper#getInstance" reason="Absent in 181. Use psiSearchHelperInstance() instead." />
|
||||
<Problem reference="com.intellij.psi.search.PsiSearchHelper.SERVICE" reason="Deprecated since 182. Use psiSearchHelperInstance() instead." />
|
||||
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
|
||||
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
|
||||
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
|
||||
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
|
||||
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
@@ -275,6 +271,10 @@
|
||||
<option name="ignoreObjectMethods" value="true" />
|
||||
<option name="ignoreAnonymousClassMethods" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MissingRecentApi" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="sinceBuildString" value="181.3" />
|
||||
<option name="untilBuildString" value="192.SNAPSHOT" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="MisspelledEquals" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="MisspelledHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
@@ -306,16 +306,6 @@
|
||||
<inspection_tool class="PackageName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="namePattern" value="[a-z_][a-z\d_]*(\.[a-z_][a-zA-Z\d_]*)*" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="problems">
|
||||
<list>
|
||||
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
|
||||
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
|
||||
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
|
||||
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.intellij.util.AstLoadingFilter
|
||||
*
|
||||
* BUNCH: 182
|
||||
*/
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
object AstLoadingFilter {
|
||||
@JvmStatic
|
||||
fun <T, E : Throwable> forceAllowTreeLoading(psiFile: PsiFile, computable: ThrowableComputable<out T, E>): T {
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.intellij.psi.PsiFile
|
||||
*
|
||||
* BUNCH: 182
|
||||
*/
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
object AstLoadingFilter {
|
||||
@JvmStatic
|
||||
fun <T, E : Throwable> forceAllowTreeLoading(psiFile: PsiFile, computable: ThrowableComputable<out T, E>): T {
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.intellij.util.AstLoadingFilter
|
||||
*
|
||||
* BUNCH: 182
|
||||
*/
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
object AstLoadingFilter {
|
||||
@JvmStatic
|
||||
fun <T, E : Throwable> forceAllowTreeLoading(psiFile: PsiFile, computable: ThrowableComputable<out T, E>): T {
|
||||
|
||||
-1
@@ -207,7 +207,6 @@ public class KotlinCommonCodeStyleSettings extends CommonCodeStyleSettings {
|
||||
// SoftMargins.serializeInfo
|
||||
private void serializeInto(@NotNull List<Integer> softMargins, @NotNull Element element) {
|
||||
if (softMargins.size() > 0) {
|
||||
//noinspection IncompatibleAPI
|
||||
XmlSerializer.serializeInto(this, element);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.search.PsiSearchHelper
|
||||
|
||||
// BUNCH: 181
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
fun psiSearchHelperInstance(project: Project): PsiSearchHelper {
|
||||
return PsiSearchHelper.getInstance(project)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.search.PsiSearchHelper
|
||||
|
||||
// BUNCH: 181
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
fun psiSearchHelperInstance(project: Project): PsiSearchHelper {
|
||||
return PsiSearchHelper.SERVICE.getInstance(project)
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
// Additional method is introduced in 183 instead of deprecated one
|
||||
// BUNCH: 182
|
||||
@SuppressWarnings("IncompatibleAPI")
|
||||
@SuppressWarnings({"IncompatibleAPI", "MissingRecentApi"})
|
||||
public abstract class CodeStyleSettingsProviderCompat extends CodeStyleSettingsProvider {
|
||||
// Can't use @Override because it's going to be an error in 182
|
||||
@SuppressWarnings("override")
|
||||
|
||||
@@ -61,6 +61,7 @@ public class KotlinCodeStyleSettingsProvider extends CodeStyleSettingsProviderCo
|
||||
addBlankLinesTab(settings);
|
||||
addTab(new ImportSettingsPanelWrapper(settings));
|
||||
|
||||
// BUNCH: 182
|
||||
//noinspection IncompatibleAPI
|
||||
for (CodeStyleSettingsProvider provider : CodeStyleSettingsProvider.EXTENSION_POINT_NAME.getExtensions()) {
|
||||
if (provider.getLanguage() == KotlinLanguage.INSTANCE && !provider.hasSettingsPage()) {
|
||||
|
||||
@@ -9,6 +9,6 @@ import com.intellij.codeInspection.reference.RefFile
|
||||
import com.intellij.psi.PsiFile
|
||||
|
||||
// BUNCH: 182
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
val RefFile.psiFile: PsiFile?
|
||||
get() = psiElement
|
||||
@@ -9,6 +9,6 @@ import com.intellij.codeInspection.reference.RefFile
|
||||
import com.intellij.psi.PsiFile
|
||||
|
||||
// BUNCH: 182
|
||||
@Suppress("IncompatibleAPI")
|
||||
@Suppress("IncompatibleAPI", "MissingRecentApi")
|
||||
val RefFile.psiFile: PsiFile?
|
||||
get() = element
|
||||
@@ -221,7 +221,12 @@ abstract class AbstractScriptConfigurationTest : KotlinCompletionTestCase() {
|
||||
|
||||
private fun createTestModuleByName(name: String): Module {
|
||||
val newModuleDir = runWriteAction { VfsUtil.createDirectoryIfMissing(project.baseDir, name) }
|
||||
val newModule = createModuleAt(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
|
||||
|
||||
// BUNCH: 181
|
||||
@Suppress("IncompatibleAPI") val newModule = createModuleAt(name, project, JavaModuleType.getModuleType(), newModuleDir.path)
|
||||
|
||||
// Return type was changed, but it's not used. BUNCH: 183
|
||||
@Suppress("MissingRecentApi")
|
||||
PsiTestUtil.addSourceContentToRoots(newModule, newModuleDir)
|
||||
return newModule
|
||||
}
|
||||
|
||||
@@ -314,6 +314,7 @@ class JavaToKotlinConverter(
|
||||
}
|
||||
|
||||
constructor() {
|
||||
// BUNCH: 181
|
||||
@Suppress("IncompatibleAPI")
|
||||
val indicator: ProgressIndicator? = ProgressManager.getInstance().progressIndicator
|
||||
delegate = indicator ?: EmptyProgressIndicator()
|
||||
|
||||
Reference in New Issue
Block a user