aboutsummaryrefslogtreecommitdiff
path: root/src/CompilerAPI.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:07:35 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:07:35 +0400
commitcc008898485627a805c8275dede9883529712cb9 (patch)
treef4759bbb7f751336b22755689971a27468eeca40 /src/CompilerAPI.kt
parente4a6e2d908b285a3a92a65d99322f810fb5ff37d (diff)
downloaddokka-cc008898485627a805c8275dede9883529712cb9.tar.gz
dokka-cc008898485627a805c8275dede9883529712cb9.tar.bz2
dokka-cc008898485627a805c8275dede9883529712cb9.zip
Process properties in classes without accessors
Diffstat (limited to 'src/CompilerAPI.kt')
-rw-r--r--src/CompilerAPI.kt9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/CompilerAPI.kt b/src/CompilerAPI.kt
index 756cd915..3429aeae 100644
--- a/src/CompilerAPI.kt
+++ b/src/CompilerAPI.kt
@@ -12,6 +12,7 @@ import com.intellij.psi.*
import org.jetbrains.jet.lang.resolve.*
import org.jetbrains.jet.lang.psi.*
import org.jetbrains.jet.analyzer.*
+import org.jetbrains.jet.lang.descriptors.*
private fun getAnnotationsPath(paths: KotlinPaths, arguments: K2JVMCompilerArguments): MutableList<File> {
val annotationsPath = arrayListOf<File>()
@@ -51,3 +52,11 @@ private fun JetCoreEnvironment.analyze(messageCollector: MessageCollector): Bind
fun AnalyzerWithCompilerReport.analyzeAndReport(files: List<JetFile>, analyser: () -> AnalyzeExhaust) = analyzeAndReport(analyser, files)
fun BindingContext.getPackageFragment(file: JetFile) = get(BindingContext.FILE_TO_PACKAGE_FRAGMENT, file)
+
+fun DeclarationDescriptor.isUserCode() =
+ when (this) {
+ is PackageFragmentDescriptor -> false
+ is PropertyAccessorDescriptor -> !isDefault()
+ is CallableMemberDescriptor -> getKind() == CallableMemberDescriptor.Kind.DECLARATION
+ else -> true
+ }