[uast] add UAnnotated#uAnnotations instead of #annotations

GitOrigin-RevId: 61851be3b0a9526ecb21d6f4f6b91b833f306d28
This commit is contained in:
Daniil Ovchinnikov
2019-07-02 06:52:16 +03:00
committed by intellij-monorepo-bot
parent 69d390a5e7
commit cd3ee635f8
56 changed files with 148 additions and 795 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-2019 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.
package com.intellij.codeInspection.reference;
@@ -292,7 +292,7 @@ public class RefClassImpl extends RefJavaElementImpl implements RefClass {
RefJavaUtil.getInstance().addReferencesTo(uClass, this, classInitializer.getUastBody());
}
RefJavaUtil.getInstance().addReferencesTo(uClass, this, ((UAnnotated)uClass).getAnnotations().toArray(UElementKt.EMPTY_ARRAY));
RefJavaUtil.getInstance().addReferencesTo(uClass, this, ((UAnnotated)uClass).getUAnnotations().toArray(UElementKt.EMPTY_ARRAY));
for (PsiTypeParameter parameter : uClass.getJavaPsi().getTypeParameters()) {
UElement uTypeParameter = UastContextKt.toUElement(parameter);
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-2019 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.
package com.intellij.codeInspection.reference;
import com.intellij.openapi.application.ApplicationManager;
@@ -126,7 +126,7 @@ public class RefFieldImpl extends RefJavaElementImpl implements RefField {
if (uField != null) {
final RefJavaUtil refUtil = RefJavaUtil.getInstance();
refUtil.addReferencesTo(uField, this, uField.getUastInitializer());
refUtil.addReferencesTo(uField, this, ((UAnnotated)uField).getAnnotations().toArray(UElementKt.EMPTY_ARRAY));
refUtil.addReferencesTo(uField, this, ((UAnnotated)uField).getUAnnotations().toArray(UElementKt.EMPTY_ARRAY));
if (uField instanceof UEnumConstant) {
refUtil.addReferencesTo(uField, this, uField);
}
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-2019 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.
package com.intellij.codeInspection.reference;
@@ -99,7 +99,7 @@ public class RefParameterImpl extends RefJavaElementImpl implements RefParameter
final RefJavaUtil refUtil = RefJavaUtil.getInstance();
final UParameter parameter = getUastElement();
if (parameter != null) {
List<UAnnotation> annotations = ((UAnnotated)parameter).getAnnotations();
List<UAnnotation> annotations = ((UAnnotated)parameter).getUAnnotations();
refUtil.addReferencesTo(parameter, this, annotations.toArray(UElementKt.EMPTY_ARRAY));
UTypeReferenceExpression typeReference = parameter.getTypeReference();
refUtil.addReferencesTo(parameter, this, typeReference);
@@ -101,7 +101,7 @@ private class UnstableTypeUsedInSignatureVisitor(
}
private fun isInsideUnstableDeclaration(node: UDeclaration): Boolean {
if (node.annotations.any { it.qualifiedName in unstableApiAnnotations }) {
if (node.uAnnotations.any { it.qualifiedName in unstableApiAnnotations }) {
return true
}
val containingClass = node.getContainingUClass()
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-2019 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.
package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.psi.*
@@ -35,7 +35,7 @@ class GrUClass(val grElement: GrTypeDefinition,
override val uastParent: UElement? by lazy(parentProvider)
override val annotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override val uAnnotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override fun getSuperClass(): UClass? = super.getSuperClass()
@@ -67,7 +67,7 @@ class GrUMethod(val grElement: GrMethod,
override val uastAnchor: UIdentifier
get() = UIdentifier(grElement.nameIdentifierGroovy, this)
override val annotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override val uAnnotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override fun getBody(): PsiCodeBlock? = null
@@ -94,7 +94,7 @@ class GrUParameter(val grElement: GrParameter,
override val uastAnchor: UIdentifier
get() = UIdentifier(grElement.nameIdentifierGroovy, this)
override val annotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override val uAnnotations: List<UAnnotation> by lazy { grAnnotations(grElement.modifierList, this) }
override fun getInitializer(): PsiExpression? = grElement.initializer
@@ -1,6 +1,4 @@
/*
* Copyright 2000-2018 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-2019 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.
package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.psi.PsiComment
@@ -19,7 +17,7 @@ class GrUFile(override val sourcePsi: GroovyFile, override val languagePlugin: U
override val imports: List<UImportStatement> = emptyList<UImportStatement>() // not implemented
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = sourcePsi.packageDefinition?.annotationList?.annotations?.map { GrUAnnotation(it, { this }) } ?: emptyList()
override val classes: List<GrUClass> by lazy { sourcePsi.classes.mapNotNull { (it as? GrTypeDefinition)?.let { GrUClass(it, { this }) } } }
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-2019 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.
package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.psi.PsiElement
@@ -23,7 +23,7 @@ class GrUReferenceExpression(
override val uastParent: UElement? by lazy(parentProvider)
override val annotations: List<UAnnotation> = emptyList()
override val uAnnotations: List<UAnnotation> = emptyList()
override fun resolve(): PsiElement? = sourcePsi.resolve()
override fun multiResolve(): Iterable<ResolveResult> =
@@ -1,4 +1,4 @@
// Copyright 2000-2017 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-2019 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.
package org.jetbrains.plugins.groovy.lang.psi.uast
import com.intellij.lang.Language
@@ -70,7 +70,7 @@ class GrULiteral(val grElement: GrLiteral, val parentProvider: () -> UElement?)
override fun evaluate(): Any? = value
override val uastParent: UElement? by lazy(parentProvider)
override val psi: PsiElement? = grElement
override val annotations: List<UAnnotation> = emptyList() //not implemented
override val uAnnotations: List<UAnnotation> = emptyList() //not implemented
override val isString: Boolean
get() = super<UInjectionHost>.isString
override val psiLanguageInjectionHost: PsiLanguageInjectionHost
@@ -86,7 +86,7 @@ class GrUNamedExpression(val grElement: GrAnnotationNameValuePair, val parentPro
override val uastParent: UElement? by lazy(parentProvider)
override val psi: GrAnnotationNameValuePair = grElement
override val annotations: List<UAnnotation> = emptyList() //not implemented
override val uAnnotations: List<UAnnotation> = emptyList() //not implemented
override fun equals(other: Any?): Boolean {
if (other !is GrUNamedExpression) return false
@@ -131,6 +131,6 @@ class GrUnknownUExpression(override val psi: PsiElement?, override val uastParen
override fun asLogString(): String = "GrUnknownUExpression(grElement)"
override val annotations: List<UAnnotation> = emptyList() //not implemented
override val uAnnotations: List<UAnnotation> = emptyList() //not implemented
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiElement
@@ -47,10 +33,23 @@ interface UExpression : UElement, UAnnotated {
* Represents an annotated element.
*/
interface UAnnotated : UElement {
@Deprecated(
message = "Will be removed to avoid clash with com.intellij.psi.PsiModifierListOwner#getAnnotations",
replaceWith = ReplaceWith(expression = "uAnnotations"),
level = DeprecationLevel.WARNING
)
@JvmDefault
val annotations: List<UAnnotation>
get() = uAnnotations
/**
* Returns the list of annotations applied to the current element.
*/
val annotations: List<UAnnotation>
@Suppress("DEPRECATION")
@JvmDefault
val uAnnotations: List<UAnnotation>
get() = annotations
/**
* Looks up for annotation element using the annotation qualified name.
@@ -58,7 +57,7 @@ interface UAnnotated : UElement {
* @param fqName the qualified name to search
* @return the first annotation element with the specified qualified name, or null if there is no annotation with such name.
*/
fun findAnnotation(fqName: String): UAnnotation? = annotations.firstOrNull { it.qualifiedName == fqName }
fun findAnnotation(fqName: String): UAnnotation? = uAnnotations.firstOrNull { it.qualifiedName == fqName }
}
/**
@@ -86,7 +85,7 @@ interface ULabeled : UElement {
*/
open class UastEmptyExpression(override val uastParent: UElement?) : UExpression {
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = emptyList()
override val psi: PsiElement?
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -47,7 +33,7 @@ interface UDoWhileExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitDoWhileExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
condition.accept(visitor)
body.accept(visitor)
visitor.afterVisitDoWhileExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -47,7 +33,7 @@ interface UForEachExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitForEachExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
iteratedValue.accept(visitor)
body.accept(visitor)
visitor.afterVisitForEachExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -52,7 +38,7 @@ interface UForExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitForExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
declaration?.accept(visitor)
condition?.accept(visitor)
update?.accept(visitor)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -68,7 +54,7 @@ interface UIfExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitIfExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
condition.accept(visitor)
thenExpression?.accept(visitor)
elseExpression?.accept(visitor)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -51,7 +37,7 @@ interface USwitchExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitSwitchExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expression?.accept(visitor)
body.accept(visitor)
visitor.afterVisitSwitchExpression(this)
@@ -83,7 +69,7 @@ interface USwitchClauseExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitSwitchClauseExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
caseValues.acceptList(visitor)
visitor.afterVisitSwitchClauseExpression(this)
}
@@ -110,7 +96,7 @@ interface USwitchClauseExpressionWithBody : USwitchClauseExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitSwitchClauseExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
caseValues.acceptList(visitor)
body.accept(visitor)
visitor.afterVisitSwitchClauseExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiType
@@ -79,7 +65,7 @@ interface UTryExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitTryExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
resourceVariables.acceptList(visitor)
tryClause.accept(visitor)
catchClauses.acceptList(visitor)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -42,7 +28,7 @@ interface UWhileExpression : ULoopExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitWhileExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
condition.accept(visitor)
body.accept(visitor)
visitor.afterVisitWhileExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiAnonymousClass
@@ -69,7 +55,7 @@ interface UClass : UDeclaration, PsiClass {
override fun accept(visitor: UastVisitor) {
if (visitor.visitClass(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
uastDeclarations.acceptList(visitor)
visitor.afterVisitClass(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiClassInitializer
@@ -41,7 +27,7 @@ interface UClassInitializer : UDeclaration, PsiClassInitializer {
override fun accept(visitor: UastVisitor) {
if (visitor.visitInitializer(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
uastBody.accept(visitor)
visitor.afterVisitInitializer(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiElement
@@ -65,8 +51,8 @@ interface UFile : UElement, UAnnotated {
override fun asLogString(): String = log("package = $packageName")
override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) {
annotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString)
if (uAnnotations.isNotEmpty()) {
uAnnotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString)
}
val packageName = this@UFile.packageName
@@ -92,7 +78,7 @@ interface UFile : UElement, UAnnotated {
override fun accept(visitor: UastVisitor) {
if (visitor.visitFile(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
imports.acceptList(visitor)
classes.acceptList(visitor)
visitor.afterVisitFile(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.*
@@ -50,23 +36,23 @@ interface UMethod : UDeclaration, PsiMethod {
override fun accept(visitor: UastVisitor) {
if (visitor.visitMethod(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
uastParameters.acceptList(visitor)
uastBody?.accept(visitor)
visitor.afterVisitMethod(this)
}
override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) {
annotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString)
if (uAnnotations.isNotEmpty()) {
uAnnotations.joinTo(buffer = this, separator = "\n", postfix = "\n", transform = UAnnotation::asRenderString)
}
append(javaPsi.renderModifiers())
append("fun ").append(name)
uastParameters.joinTo(this, prefix = "(", postfix = ")") { parameter ->
val annotationsText = if (parameter.annotations.isNotEmpty())
parameter.annotations.joinToString(separator = " ", postfix = " ") { it.asRenderString() }
val annotationsText = if (parameter.uAnnotations.isNotEmpty())
parameter.uAnnotations.joinToString(separator = " ", postfix = " ") { it.asRenderString() }
else
""
annotationsText + parameter.name + ": " + parameter.type.canonicalText
@@ -113,7 +99,7 @@ interface UAnnotationMethod : UMethod, PsiAnnotationMethod {
override fun accept(visitor: UastVisitor) {
if (visitor.visitMethod(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
uastParameters.acceptList(visitor)
uastBody?.accept(visitor)
uastDefaultValue?.accept(visitor)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.*
@@ -60,8 +46,8 @@ interface UVariable : UDeclaration, PsiVariable {
override fun asLogString(): String = log("name = $name")
override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) {
annotations.joinTo(this, separator = " ", postfix = " ") { it.asRenderString() }
if (uAnnotations.isNotEmpty()) {
uAnnotations.joinTo(this, separator = " ", postfix = " ") { it.asRenderString() }
}
append(javaPsiInternal.renderModifiers())
append("var ").append(javaPsiInternal.name).append(": ").append(javaPsiInternal.type.getCanonicalText(false))
@@ -74,7 +60,7 @@ interface UVariableEx : UVariable, UDeclarationEx {
}
private fun UVariable.visitContents(visitor: UastVisitor) {
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
uastInitializer?.accept(visitor)
}
@@ -141,7 +127,7 @@ interface UEnumConstant : UField, UCallExpression, PsiEnumConstant {
override fun accept(visitor: UastVisitor) {
if (visitor.visitEnumConstant(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
methodIdentifier?.accept(visitor)
classReference?.accept(visitor)
valueArguments.acceptList(visitor)
@@ -153,8 +139,8 @@ interface UEnumConstant : UField, UCallExpression, PsiEnumConstant {
visitor.visitEnumConstantExpression(this, data)
override fun asRenderString(): String = buildString {
if (annotations.isNotEmpty()) {
annotations.joinTo(this, separator = " ", postfix = " ", transform = UAnnotation::asRenderString)
if (uAnnotations.isNotEmpty()) {
uAnnotations.joinTo(this, separator = " ", postfix = " ", transform = UAnnotation::asRenderString)
}
append(name)
if (valueArguments.isNotEmpty()) {
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -36,7 +22,7 @@ interface UArrayAccessExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitArrayAccessExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
receiver.accept(visitor)
indices.acceptList(visitor)
visitor.afterVisitArrayAccessExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiMethod
@@ -52,7 +38,7 @@ interface UBinaryExpression : UPolyadicExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitBinaryExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
leftOperand.accept(visitor)
rightOperand.accept(visitor)
visitor.afterVisitBinaryExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -52,7 +38,7 @@ interface UBinaryExpressionWithType : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitBinaryExpressionWithType(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
operand.accept(visitor)
typeReference?.accept(visitor)
visitor.afterVisitBinaryExpressionWithType(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface UBlockExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitBlockExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expressions.acceptList(visitor)
visitor.afterVisitBlockExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -28,7 +14,7 @@ interface UBreakExpression : UJumpExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitBreakExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitBreakExpression(this)
}
@@ -46,7 +32,7 @@ interface UBreakWithValueExpression : UBreakExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitBreakExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
valueExpression?.accept(visitor)
visitor.afterVisitBreakExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -97,7 +83,7 @@ interface UCallExpression : UExpression, UResolvable {
override fun accept(visitor: UastVisitor) {
if (visitor.visitCallExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
methodIdentifier?.accept(visitor)
classReference?.accept(visitor)
valueArguments.acceptList(visitor)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -45,7 +31,7 @@ interface UCallableReferenceExpression : UReferenceExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitCallableReferenceExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
qualifierExpression?.accept(visitor)
visitor.afterVisitCallableReferenceExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -43,7 +29,7 @@ interface UClassLiteralExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitClassLiteralExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expression?.accept(visitor)
visitor.afterVisitClassLiteralExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -28,7 +14,7 @@ interface UContinueExpression : UJumpExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitContinueExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitContinueExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -32,7 +18,7 @@ interface UDeclarationsExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitDeclarationsExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
declarations.acceptList(visitor)
visitor.afterVisitDeclarationsExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -36,7 +22,7 @@ interface UExpressionList : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitExpressionList(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expressions.acceptList(visitor)
visitor.afterVisitExpressionList(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -36,7 +22,7 @@ interface ULabeledExpression : UExpression, ULabeled {
override fun accept(visitor: UastVisitor) {
if (visitor.visitLabeledExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expression.accept(visitor)
visitor.afterVisitLabeledExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiType
@@ -42,7 +28,7 @@ interface ULambdaExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitLambdaExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
valueParameters.acceptList(visitor)
body.accept(visitor)
visitor.afterVisitLambdaExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -50,7 +36,7 @@ interface ULiteralExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitLiteralExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitLiteralExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -25,7 +11,7 @@ interface UNamedExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitElement(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expression.accept(visitor)
visitor.afterVisitElement(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiType
@@ -51,7 +37,7 @@ interface UObjectLiteralExpression : UCallExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitObjectLiteralExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
valueArguments.acceptList(visitor)
declaration.accept(visitor)
visitor.afterVisitObjectLiteralExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface UParenthesizedExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitParenthesizedExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
expression.accept(visitor)
visitor.afterVisitParenthesizedExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -38,7 +24,7 @@ interface UPolyadicExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitPolyadicExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
operands.acceptList(visitor)
visitor.afterVisitPolyadicExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -43,7 +29,7 @@ interface UQualifiedReferenceExpression : UReferenceExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitQualifiedReferenceExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
receiver.accept(visitor)
selector.accept(visitor)
visitor.afterVisitQualifiedReferenceExpression(this)
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -32,7 +18,7 @@ interface UReturnExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitReturnExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
returnExpression?.accept(visitor)
visitor.afterVisitReturnExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface USimpleNameReferenceExpression : UReferenceExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitSimpleNameReferenceExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitSimpleNameReferenceExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface USuperExpression : UInstanceExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitSuperExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitSuperExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import org.jetbrains.uast.internal.acceptList
@@ -31,7 +17,7 @@ interface UThisExpression : UInstanceExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitThisExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitThisExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
@@ -32,7 +18,7 @@ interface UThrowExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitThrowExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
thrownExpression.accept(visitor)
visitor.afterVisitThrowExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiType
@@ -35,7 +21,7 @@ interface UTypeReferenceExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitTypeReferenceExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
visitor.afterVisitTypeReferenceExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast
import com.intellij.psi.PsiMethod
@@ -46,7 +32,7 @@ interface UUnaryExpression : UExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitUnaryExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
operand.accept(visitor)
visitor.afterVisitUnaryExpression(this)
}
@@ -60,7 +46,7 @@ interface UPrefixExpression : UUnaryExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitPrefixExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
operand.accept(visitor)
visitor.afterVisitPrefixExpression(this)
}
@@ -78,7 +64,7 @@ interface UPostfixExpression : UUnaryExpression {
override fun accept(visitor: UastVisitor) {
if (visitor.visitPostfixExpression(this)) return
annotations.acceptList(visitor)
uAnnotations.acceptList(visitor)
operand.accept(visitor)
visitor.afterVisitPostfixExpression(this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
@@ -129,7 +115,7 @@ abstract class JavaAbstractUExpression(givenParent: UElement?) : JavaAbstractUEl
return JavaPsiFacade.getInstance(project).constantEvaluationHelper.computeConstantExpression(sourcePsi)
}
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = emptyList()
override fun getExpressionType(): PsiType? {
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
import com.intellij.psi.*
@@ -170,7 +156,7 @@ internal class DummyUBreakExpression(val valueExpressionPsi: PsiExpression,
get() = null
override val label: String?
get() = null
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = emptyList()
override val valueExpression: UExpression? by lazy { JavaConverter.convertExpression(valueExpressionPsi, this) }
@@ -190,7 +176,7 @@ internal class DummyUBreakExpression(val valueExpressionPsi: PsiExpression,
class JavaUDefaultCaseExpression(override val sourcePsi: PsiElement?, givenParent: UElement?)
: JavaAbstractUExpression(givenParent), UElement {
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = emptyList()
override fun asLogString(): String = "UDefaultCaseExpression"
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
@@ -50,7 +36,7 @@ abstract class AbstractJavaUClass(givenParent: UElement?) : JavaAbstractUElement
override val uastAnchor: UIdentifier?
get() = UIdentifier(javaPsi.nameIdentifier, this)
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = javaPsi.annotations.map { JavaUAnnotation(it, this) }
override fun equals(other: Any?): Boolean = other is AbstractJavaUClass && javaPsi == other.javaPsi
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
@@ -38,7 +24,7 @@ class JavaUClassInitializer(
getLanguagePlugin().convertElement(sourcePsi.body, this, null) as? UExpression ?: UastEmptyExpression(this)
}
override val annotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } }
override val uAnnotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } }
override fun equals(other: Any?): Boolean = this === other
override fun hashCode(): Int = sourcePsi.hashCode()
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
import com.intellij.psi.PsiComment
@@ -29,7 +15,7 @@ class JavaUFile(override val sourcePsi: PsiJavaFile, override val languagePlugin
sourcePsi.importList?.allImportStatements?.map { JavaUImportStatement(it, this) } ?: listOf()
}
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = sourcePsi.packageStatement?.annotationList?.annotations?.map { JavaUAnnotation(it, this) } ?: emptyList()
override val classes: List<UClass> by lz { sourcePsi.classes.map { JavaUClass.create(it, this) } }
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-2019 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.
package org.jetbrains.uast.java
@@ -25,7 +25,7 @@ open class JavaUMethod(
getLanguagePlugin().convertElement(body, this) as? UExpression
}
override val annotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } }
override val uAnnotations: List<JavaUAnnotation> by lz { sourcePsi.annotations.map { JavaUAnnotation(it, this) } }
override val uastParameters: List<JavaUParameter> by lz {
sourcePsi.parameterList.parameters.map { JavaUParameter(it, this) }
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
@@ -35,7 +21,7 @@ abstract class AbstractJavaUVariable(givenParent: UElement?) : JavaAbstractUElem
getLanguagePlugin().convertElement(initializer, this) as? UExpression
}
override val annotations: List<JavaUAnnotation> by lz { javaPsi.annotations.map { JavaUAnnotation(it, this) } }
override val uAnnotations: List<JavaUAnnotation> by lz { javaPsi.annotations.map { JavaUAnnotation(it, this) } }
override val typeReference: UTypeReferenceExpression? by lz {
getLanguagePlugin().convertOpt<UTypeReferenceExpression>(javaPsi.typeElement, this)
}
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
import com.intellij.psi.PsiElement
@@ -30,7 +16,7 @@ class JavaUDeclarationsExpression(
this.declarations = declarations
}
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = emptyList()
@Suppress("OverridingDeprecatedMember")
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2019 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.
package org.jetbrains.uast.java
import com.intellij.psi.PsiElement
@@ -26,6 +12,6 @@ class UnknownJavaExpression(
) : JavaAbstractUElement(uastParent), UExpression, UElement {
override fun asLogString(): String = "[!] " + UnknownJavaExpression::class.java.simpleName + " ($sourcePsi)"
override val annotations: List<UAnnotation>
override val uAnnotations: List<UAnnotation>
get() = emptyList()
}