mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gradle][IDEA-378369] do not show the "Download Sources" button in the editor for libraries provided by Gradle
GitOrigin-RevId: edb93cd092c44aac4348c80381b3cfcd83700038
This commit is contained in:
committed by
intellij-monorepo-bot
parent
feca4c4016
commit
9252254775
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInsight
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName
|
||||
import com.intellij.openapi.roots.LibraryOrderEntry
|
||||
import com.intellij.psi.PsiFile
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
@ApiStatus.Internal
|
||||
interface AttachSourcesProviderFilter {
|
||||
|
||||
/**
|
||||
* Checks can be an instance of AttachSourcesProvider applied to the specific PsiFile.
|
||||
*/
|
||||
fun isApplicable(provider: AttachSourcesProvider, orderEntries: List<LibraryOrderEntry>, psiFile: PsiFile): Boolean
|
||||
|
||||
companion object {
|
||||
private val EP_NAME: ExtensionPointName<AttachSourcesProviderFilter> = ExtensionPointName("com.intellij.attachSourcesProviderFilter")
|
||||
|
||||
@JvmStatic
|
||||
fun isProviderApplicable(provider: AttachSourcesProvider, orderEntries: List<LibraryOrderEntry>, psiFile: PsiFile): Boolean {
|
||||
var applicable = true
|
||||
EP_NAME.forEachExtensionSafe {
|
||||
if (!it.isApplicable(provider, orderEntries, psiFile)) {
|
||||
applicable = false
|
||||
}
|
||||
}
|
||||
return applicable
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user