"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/internal/kotlinInternalUastUtils.kt" between
kotlin-1.3.20.tar.gz and kotlin-1.3.21.tar.gz

About: Kotlin is a Java like statically typed programming language for the JVM, Android and the browser. Source code.

kotlinInternalUastUtils.kt  (kotlin-1.3.20):kotlinInternalUastUtils.kt  (kotlin-1.3.21)
skipping to change at line 285 skipping to change at line 285
internal fun KtExpression.unwrapBlockOrParenthesis(): KtExpression { internal fun KtExpression.unwrapBlockOrParenthesis(): KtExpression {
val innerExpression = KtPsiUtil.safeDeparenthesize(this) val innerExpression = KtPsiUtil.safeDeparenthesize(this)
if (innerExpression is KtBlockExpression) { if (innerExpression is KtBlockExpression) {
val statement = innerExpression.statements.singleOrNull() ?: return this val statement = innerExpression.statements.singleOrNull() ?: return this
return KtPsiUtil.safeDeparenthesize(statement) return KtPsiUtil.safeDeparenthesize(statement)
} }
return innerExpression return innerExpression
} }
internal fun KtElement.analyze(): BindingContext { internal fun KtElement.analyze(): BindingContext {
if (containingFile !is KtFile) return BindingContext.EMPTY // EA-114080, EA- val containingFile = containingFile
113475 if (!isValid || containingFile !is KtFile) return BindingContext.EMPTY // EA
-114080, EA-113475, EA-134193
if (containingFile.doNotAnalyze != null) return BindingContext.EMPTY // To p
revent exceptions during analysis
return ServiceManager.getService(project, KotlinUastResolveProviderService:: class.java) return ServiceManager.getService(project, KotlinUastResolveProviderService:: class.java)
?.getBindingContext(this) ?: BindingContext.EMPTY ?.getBindingContext(this) ?: BindingContext.EMPTY
} }
internal inline fun <reified T : UDeclaration, reified P : PsiElement> unwrap(el ement: P): P { internal inline fun <reified T : UDeclaration, reified P : PsiElement> unwrap(el ement: P): P {
val unwrapped = if (element is T) element.psi else element val unwrapped = if (element is T) element.psi else element
assert(unwrapped !is UElement) assert(unwrapped !is UElement)
return unwrapped as P return unwrapped as P
} }
 End of changes. 1 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)