mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
cleanup JavaTelescope
GitOrigin-RevId: 881c66ff97088cd4e97cf2567c9fd7935578ddf0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2d386a48c8
commit
1729cd94d5
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2000-2020 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.
|
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||||
package com.intellij.codeInsight.daemon.impl;
|
package com.intellij.codeInsight.daemon.impl;
|
||||||
|
|
||||||
import com.intellij.concurrency.JobLauncher;
|
import com.intellij.concurrency.JobLauncher;
|
||||||
@@ -20,6 +20,7 @@ import com.intellij.psi.search.searches.OverridingMethodsSearch;
|
|||||||
import com.intellij.util.ObjectUtils;
|
import com.intellij.util.ObjectUtils;
|
||||||
import org.jetbrains.annotations.Nls;
|
import org.jetbrains.annotations.Nls;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
@@ -41,7 +42,7 @@ final class JavaTelescope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static @Nls UsagesHint usagesHint(@NotNull PsiMember member, @NotNull PsiFile file) {
|
static @Nullable UsagesHint usagesHint(@NotNull PsiMember member, @NotNull PsiFile file) {
|
||||||
int totalUsageCount = UsagesCountManager.getInstance(member.getProject()).countMemberUsages(file, member);
|
int totalUsageCount = UsagesCountManager.getInstance(member.getProject()).countMemberUsages(file, member);
|
||||||
if (totalUsageCount == TOO_MANY_USAGES) return null;
|
if (totalUsageCount == TOO_MANY_USAGES) return null;
|
||||||
if (totalUsageCount < AdvancedSettings.getInt("code.vision.java.minimal.usages")) return null;
|
if (totalUsageCount < AdvancedSettings.getInt("code.vision.java.minimal.usages")) return null;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2000-2022 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.
|
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||||
package com.intellij.codeInsight.daemon.impl
|
package com.intellij.codeInsight.daemon.impl
|
||||||
|
|
||||||
import com.intellij.codeInsight.codeVision.CodeVisionRelativeOrdering
|
import com.intellij.codeInsight.codeVision.CodeVisionRelativeOrdering
|
||||||
@@ -24,9 +24,8 @@ class JavaReferencesCodeVisionProvider : RenameAwareReferencesCodeVisionProvider
|
|||||||
private fun getVisionInfo(element: PsiElement, file: PsiFile): CodeVisionProviderBase.CodeVisionInfo? {
|
private fun getVisionInfo(element: PsiElement, file: PsiFile): CodeVisionProviderBase.CodeVisionInfo? {
|
||||||
val inspection = UnusedDeclarationInspectionBase.findUnusedDeclarationInspection(element)
|
val inspection = UnusedDeclarationInspectionBase.findUnusedDeclarationInspection(element)
|
||||||
if (inspection.isEntryPoint(element)) return null
|
if (inspection.isEntryPoint(element)) return null
|
||||||
return JavaTelescope.usagesHint(element as PsiMember, file)?.let {
|
val usagesHint = JavaTelescope.usagesHint(element as PsiMember, file) ?: return null
|
||||||
CodeVisionProviderBase.CodeVisionInfo(it.hint, it.count)
|
return CodeVisionProviderBase.CodeVisionInfo(usagesHint.hint, usagesHint.count)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getHint(element: PsiElement, file: PsiFile): String? {
|
override fun getHint(element: PsiElement, file: PsiFile): String? {
|
||||||
|
|||||||
Reference in New Issue
Block a user