Add missing public in project code
This commit is contained in:
+7
-7
@@ -37,31 +37,31 @@ import org.jetbrains.jet.plugin.stubindex.JetSourceFilterScope
|
|||||||
|
|
||||||
private val LOG = Logger.getInstance(javaClass<KotlinCacheService>())
|
private val LOG = Logger.getInstance(javaClass<KotlinCacheService>())
|
||||||
|
|
||||||
fun JetElement.getLazyResolveSession(): ResolveSessionForBodies {
|
public fun JetElement.getLazyResolveSession(): ResolveSessionForBodies {
|
||||||
return KotlinCacheService.getInstance(getProject()).getLazyResolveSession(this)
|
return KotlinCacheService.getInstance(getProject()).getLazyResolveSession(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.getLazyResolveSession(platform: TargetPlatform): ResolveSessionForBodies {
|
public fun Project.getLazyResolveSession(platform: TargetPlatform): ResolveSessionForBodies {
|
||||||
return KotlinCacheService.getInstance(this).getGlobalLazyResolveSession(platform)
|
return KotlinCacheService.getInstance(this).getGlobalLazyResolveSession(platform)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun JetElement.getAnalysisResults(): AnalyzeExhaust {
|
public fun JetElement.getAnalysisResults(): AnalyzeExhaust {
|
||||||
return KotlinCacheService.getInstance(getProject()).getAnalysisResults(listOf(this))
|
return KotlinCacheService.getInstance(getProject()).getAnalysisResults(listOf(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun JetElement.getBindingContext(): BindingContext {
|
public fun JetElement.getBindingContext(): BindingContext {
|
||||||
return getAnalysisResults().getBindingContext()
|
return getAnalysisResults().getBindingContext()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAnalysisResultsForElements(elements: Collection<JetElement>): AnalyzeExhaust {
|
public fun getAnalysisResultsForElements(elements: Collection<JetElement>): AnalyzeExhaust {
|
||||||
if (elements.isEmpty()) return AnalyzeExhaust.EMPTY
|
if (elements.isEmpty()) return AnalyzeExhaust.EMPTY
|
||||||
val element = elements.first()
|
val element = elements.first()
|
||||||
return KotlinCacheService.getInstance(element.getProject()).getAnalysisResults(elements)
|
return KotlinCacheService.getInstance(element.getProject()).getAnalysisResults(elements)
|
||||||
}
|
}
|
||||||
|
|
||||||
class KotlinCacheService(val project: Project) {
|
public class KotlinCacheService(val project: Project) {
|
||||||
class object {
|
class object {
|
||||||
fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<KotlinCacheService>())!!
|
public fun getInstance(project: Project): KotlinCacheService = ServiceManager.getService(project, javaClass<KotlinCacheService>())!!
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun globalResolveSessionProvider(platform: TargetPlatform, syntheticFiles: Collection<JetFile> = listOf()) = {
|
private fun globalResolveSessionProvider(platform: TargetPlatform, syntheticFiles: Collection<JetFile> = listOf()) = {
|
||||||
|
|||||||
+2
-2
@@ -66,8 +66,8 @@ import org.jetbrains.jet.lang.types.TypeUtils
|
|||||||
import org.jetbrains.jet.lang.resolve.scopes.ChainedScope
|
import org.jetbrains.jet.lang.resolve.scopes.ChainedScope
|
||||||
|
|
||||||
public trait CacheExtension<T> {
|
public trait CacheExtension<T> {
|
||||||
val platform: TargetPlatform
|
public val platform: TargetPlatform
|
||||||
fun getData(setup: AnalyzerFacade.Setup): T
|
public fun getData(setup: AnalyzerFacade.Setup): T
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SessionAndSetup(
|
private class SessionAndSetup(
|
||||||
|
|||||||
+4
-4
@@ -24,16 +24,16 @@ import org.jetbrains.jet.plugin.JetBundle
|
|||||||
import org.jetbrains.jet.lang.psi.psiUtil.getParentByTypesAndPredicate
|
import org.jetbrains.jet.lang.psi.psiUtil.getParentByTypesAndPredicate
|
||||||
import com.intellij.codeInsight.intention.IntentionAction
|
import com.intellij.codeInsight.intention.IntentionAction
|
||||||
|
|
||||||
public abstract class JetSelfTargetingIntention<T: JetElement>(val key: String, val elementType: Class<T>) : IntentionAction {
|
public abstract class JetSelfTargetingIntention<T: JetElement>(protected val key: String, val elementType: Class<T>) : IntentionAction {
|
||||||
private var myText:String = JetBundle.message(key);
|
private var myText:String = JetBundle.message(key);
|
||||||
protected fun setText(text: String) {
|
protected fun setText(text: String) {
|
||||||
myText = text
|
myText = text
|
||||||
}
|
}
|
||||||
override fun getText(): String = myText
|
override fun getText(): String = myText
|
||||||
|
|
||||||
abstract fun isApplicableTo(element: T): Boolean
|
public abstract fun isApplicableTo(element: T): Boolean
|
||||||
open fun isApplicableTo(element: T, editor: Editor): Boolean = isApplicableTo(element)
|
public open fun isApplicableTo(element: T, editor: Editor): Boolean = isApplicableTo(element)
|
||||||
abstract fun applyTo(element: T, editor: Editor)
|
public abstract fun applyTo(element: T, editor: Editor)
|
||||||
|
|
||||||
protected fun getTarget(editor: Editor, file: PsiFile): T? {
|
protected fun getTarget(editor: Editor, file: PsiFile): T? {
|
||||||
val offset = editor.getCaretModel().getOffset()
|
val offset = editor.getCaretModel().getOffset()
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public fun descriptorToKey(descriptor: DeclarationDescriptor): String {
|
|||||||
return descriptorRendererForDecompiler.render(descriptor)
|
return descriptorRendererForDecompiler.render(descriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
private data class DecompiledText(val text: String, val renderedDescriptorsToRange: Map<String, TextRange>)
|
public data class DecompiledText(public val text: String, public val renderedDescriptorsToRange: Map<String, TextRange>)
|
||||||
|
|
||||||
private fun buildDecompiledText(packageFqName: FqName, descriptors: List<DeclarationDescriptor>): DecompiledText {
|
private fun buildDecompiledText(packageFqName: FqName, descriptors: List<DeclarationDescriptor>): DecompiledText {
|
||||||
val builder = StringBuilder()
|
val builder = StringBuilder()
|
||||||
|
|||||||
+1
-1
@@ -26,4 +26,4 @@ public class JetDecompilerForWrongAbiVersion : ClassFileDecompilers.Light() {
|
|||||||
override fun getText(file: VirtualFile) = "$INCOMPATIBLE_ABI_VERSION_COMMENT\n${ClsFileImpl.decompile(file)}"
|
override fun getText(file: VirtualFile) = "$INCOMPATIBLE_ABI_VERSION_COMMENT\n${ClsFileImpl.decompile(file)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
val INCOMPATIBLE_ABI_VERSION_COMMENT = " // This Kotlin file has an incompatible ABI version and is displayed as Java class"
|
public val INCOMPATIBLE_ABI_VERSION_COMMENT: String = " // This Kotlin file has an incompatible ABI version and is displayed as Java class"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName
|
|||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
|
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
|
||||||
|
|
||||||
trait ResolverForDecompiler {
|
public trait ResolverForDecompiler {
|
||||||
fun resolveTopLevelClass(classFqName: FqName): ClassDescriptor?
|
public fun resolveTopLevelClass(classFqName: FqName): ClassDescriptor?
|
||||||
fun resolveDeclarationsInPackage(packageFqName: FqName): Collection<DeclarationDescriptor>
|
public fun resolveDeclarationsInPackage(packageFqName: FqName): Collection<DeclarationDescriptor>
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ public trait JetReference : PsiPolyVariantReference {
|
|||||||
public abstract class AbstractJetReference<T : JetElement>(element: T)
|
public abstract class AbstractJetReference<T : JetElement>(element: T)
|
||||||
: PsiPolyVariantReferenceBase<T>(element), JetReference {
|
: PsiPolyVariantReferenceBase<T>(element), JetReference {
|
||||||
|
|
||||||
val expression: T
|
public val expression: T
|
||||||
get() = getElement()
|
get() = getElement()
|
||||||
|
|
||||||
override fun multiResolve(incompleteCode: Boolean): Array<ResolveResult> {
|
override fun multiResolve(incompleteCode: Boolean): Array<ResolveResult> {
|
||||||
@@ -67,7 +67,7 @@ public abstract class AbstractJetReference<T : JetElement>(element: T)
|
|||||||
|
|
||||||
override fun getCanonicalText(): String = "<TBD>"
|
override fun getCanonicalText(): String = "<TBD>"
|
||||||
|
|
||||||
open fun canRename(): Boolean = false
|
public open fun canRename(): Boolean = false
|
||||||
override fun handleElementRename(newElementName: String?): PsiElement? = throw IncorrectOperationException()
|
override fun handleElementRename(newElementName: String?): PsiElement? = throw IncorrectOperationException()
|
||||||
|
|
||||||
override fun bindToElement(element: PsiElement): PsiElement = throw IncorrectOperationException()
|
override fun bindToElement(element: PsiElement): PsiElement = throw IncorrectOperationException()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import com.intellij.psi.util.PsiTreeUtil
|
|||||||
|
|
||||||
// Navigation element of the resolved reference
|
// Navigation element of the resolved reference
|
||||||
// For property accessor return enclosing property
|
// For property accessor return enclosing property
|
||||||
val PsiReference.unwrappedTargets: Set<PsiElement>
|
public val PsiReference.unwrappedTargets: Set<PsiElement>
|
||||||
get() {
|
get() {
|
||||||
fun PsiElement.adjust(): PsiElement? {
|
fun PsiElement.adjust(): PsiElement? {
|
||||||
val target = unwrapped
|
val target = unwrapped
|
||||||
@@ -46,7 +46,7 @@ val PsiReference.unwrappedTargets: Set<PsiElement>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun PsiReference.matchesTarget(target: PsiElement): Boolean {
|
public fun PsiReference.matchesTarget(target: PsiElement): Boolean {
|
||||||
val unwrapped = target.unwrapped
|
val unwrapped = target.unwrapped
|
||||||
return when {
|
return when {
|
||||||
unwrapped in unwrappedTargets ->
|
unwrapped in unwrappedTargets ->
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ import com.intellij.openapi.project.Project
|
|||||||
import com.intellij.psi.PsiFile
|
import com.intellij.psi.PsiFile
|
||||||
import com.intellij.psi.search.SearchScope
|
import com.intellij.psi.search.SearchScope
|
||||||
|
|
||||||
fun SearchScope.and(otherScope: SearchScope): SearchScope = intersectWith(otherScope)
|
public fun SearchScope.and(otherScope: SearchScope): SearchScope = intersectWith(otherScope)
|
||||||
fun SearchScope.or(otherScope: SearchScope): SearchScope = union(otherScope)
|
public fun SearchScope.or(otherScope: SearchScope): SearchScope = union(otherScope)
|
||||||
fun SearchScope.minus(otherScope: GlobalSearchScope) = this and !otherScope
|
public fun SearchScope.minus(otherScope: GlobalSearchScope): SearchScope = this and !otherScope
|
||||||
fun GlobalSearchScope.not(): GlobalSearchScope = GlobalSearchScope.notScope(this)
|
public fun GlobalSearchScope.not(): GlobalSearchScope = GlobalSearchScope.notScope(this)
|
||||||
|
|
||||||
fun Project.allScope(): GlobalSearchScope = GlobalSearchScope.allScope(this)
|
public fun Project.allScope(): GlobalSearchScope = GlobalSearchScope.allScope(this)
|
||||||
|
|
||||||
fun Project.projectScope(): GlobalSearchScope = GlobalSearchScope.projectScope(this)
|
public fun Project.projectScope(): GlobalSearchScope = GlobalSearchScope.projectScope(this)
|
||||||
|
|
||||||
fun PsiFile.fileScope(): GlobalSearchScope = GlobalSearchScope.fileScope(this)
|
public fun PsiFile.fileScope(): GlobalSearchScope = GlobalSearchScope.fileScope(this)
|
||||||
|
|||||||
Reference in New Issue
Block a user