|
| 1 | +/* |
| 2 | + * Copyright 2024 Google LLC |
| 3 | + * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +// TEST PROCESSOR: GetSymbolsFromAnnotationProcessor |
| 19 | +// EXPECTED: |
| 20 | +// ==== Anno superficial==== |
| 21 | +// Foo:KSClassDeclaration |
| 22 | +// constructorParameterFoo:KSPropertyDeclaration |
| 23 | +// propertyFoo:KSPropertyDeclaration |
| 24 | +// functionFoo:KSFunctionDeclaration |
| 25 | +// p1:KSValueParameter |
| 26 | +// <init>:KSFunctionDeclaration |
| 27 | +// constructorParameterFoo:KSValueParameter |
| 28 | +// param:KSValueParameter |
| 29 | +// Bar:KSClassDeclaration |
| 30 | +// Baz:KSClassDeclaration |
| 31 | +// Burp:KSClassDeclaration |
| 32 | +// Flux:KSTypeAlias |
| 33 | +// RGB.B:KSClassDeclaration |
| 34 | +// ==== Anno in depth ==== |
| 35 | +// Foo:KSClassDeclaration |
| 36 | +// constructorParameterFoo:KSPropertyDeclaration |
| 37 | +// propertyFoo:KSPropertyDeclaration |
| 38 | +// functionFoo:KSFunctionDeclaration |
| 39 | +// p1:KSValueParameter |
| 40 | +// local:KSPropertyDeclaration |
| 41 | +// <init>:KSFunctionDeclaration |
| 42 | +// constructorParameterFoo:KSValueParameter |
| 43 | +// param:KSValueParameter |
| 44 | +// Bar:KSClassDeclaration |
| 45 | +// Baz:KSClassDeclaration |
| 46 | +// Burp:KSClassDeclaration |
| 47 | +// Flux:KSTypeAlias |
| 48 | +// RGB.B:KSClassDeclaration |
| 49 | +// ==== Bnno superficial==== |
| 50 | +// File: Foo.kt:KSFile |
| 51 | +// propertyFoo.getter():KSPropertyAccessorImpl |
| 52 | +// p2:KSValueParameter |
| 53 | +// <init>:KSFunctionDeclaration |
| 54 | +// ==== Bnno in depth ==== |
| 55 | +// File: Foo.kt:KSFile |
| 56 | +// propertyFoo.getter():KSPropertyAccessorImpl |
| 57 | +// p2:KSValueParameter |
| 58 | +// <init>:KSFunctionDeclaration |
| 59 | +// ==== A1 superficial==== |
| 60 | +// Foo:KSClassDeclaration |
| 61 | +// constructorParameterFoo:KSPropertyDeclaration |
| 62 | +// propertyFoo:KSPropertyDeclaration |
| 63 | +// functionFoo:KSFunctionDeclaration |
| 64 | +// p1:KSValueParameter |
| 65 | +// <init>:KSFunctionDeclaration |
| 66 | +// constructorParameterFoo:KSValueParameter |
| 67 | +// param:KSValueParameter |
| 68 | +// Bar:KSClassDeclaration |
| 69 | +// Baz:KSClassDeclaration |
| 70 | +// Burp:KSClassDeclaration |
| 71 | +// Flux:KSTypeAlias |
| 72 | +// RGB.B:KSClassDeclaration |
| 73 | +// ==== A1 in depth ==== |
| 74 | +// Foo:KSClassDeclaration |
| 75 | +// constructorParameterFoo:KSPropertyDeclaration |
| 76 | +// propertyFoo:KSPropertyDeclaration |
| 77 | +// functionFoo:KSFunctionDeclaration |
| 78 | +// p1:KSValueParameter |
| 79 | +// local:KSPropertyDeclaration |
| 80 | +// <init>:KSFunctionDeclaration |
| 81 | +// constructorParameterFoo:KSValueParameter |
| 82 | +// param:KSValueParameter |
| 83 | +// Bar:KSClassDeclaration |
| 84 | +// Baz:KSClassDeclaration |
| 85 | +// Burp:KSClassDeclaration |
| 86 | +// Flux:KSTypeAlias |
| 87 | +// RGB.B:KSClassDeclaration |
| 88 | +// ==== A2 superficial==== |
| 89 | +// Foo:KSClassDeclaration |
| 90 | +// constructorParameterFoo:KSPropertyDeclaration |
| 91 | +// propertyFoo:KSPropertyDeclaration |
| 92 | +// functionFoo:KSFunctionDeclaration |
| 93 | +// p1:KSValueParameter |
| 94 | +// <init>:KSFunctionDeclaration |
| 95 | +// constructorParameterFoo:KSValueParameter |
| 96 | +// param:KSValueParameter |
| 97 | +// Bar:KSClassDeclaration |
| 98 | +// Baz:KSClassDeclaration |
| 99 | +// Burp:KSClassDeclaration |
| 100 | +// Flux:KSTypeAlias |
| 101 | +// RGB.B:KSClassDeclaration |
| 102 | +// ==== A2 in depth ==== |
| 103 | +// Foo:KSClassDeclaration |
| 104 | +// constructorParameterFoo:KSPropertyDeclaration |
| 105 | +// propertyFoo:KSPropertyDeclaration |
| 106 | +// functionFoo:KSFunctionDeclaration |
| 107 | +// p1:KSValueParameter |
| 108 | +// local:KSPropertyDeclaration |
| 109 | +// <init>:KSFunctionDeclaration |
| 110 | +// constructorParameterFoo:KSValueParameter |
| 111 | +// param:KSValueParameter |
| 112 | +// Bar:KSClassDeclaration |
| 113 | +// Baz:KSClassDeclaration |
| 114 | +// Burp:KSClassDeclaration |
| 115 | +// Flux:KSTypeAlias |
| 116 | +// RGB.B:KSClassDeclaration |
| 117 | +// ==== Cnno in depth ==== |
| 118 | +// constructorParameterFoo:KSPropertyDeclaration |
| 119 | +// value:KSValueParameter |
| 120 | +// constructorParameterFoo:KSValueParameter |
| 121 | +// x:KSPropertyDeclaration |
| 122 | +// x:KSValueParameter |
| 123 | +// END |
| 124 | +// MODULE: lib |
| 125 | +//FILE: annotaitons_in_lib.kt |
| 126 | +annotation class Anno |
| 127 | +annotation class Bnno |
| 128 | +annotation class Cnno |
| 129 | + |
| 130 | +//FILE: aliases_in_lib.kt |
| 131 | +typealias A1 = Anno |
| 132 | +typealias A2 = A1 |
| 133 | + |
| 134 | +// MODULE: main(lib) |
| 135 | +//FILE: Foo.kt |
| 136 | +@file:Bnno |
| 137 | + |
| 138 | +import Anno |
| 139 | +import Anno as A3 |
| 140 | + |
| 141 | +@Anno |
| 142 | +class Foo @Anno constructor(@Anno @param:Cnno val constructorParameterFoo: Int, @Anno param: Int){ |
| 143 | + @Bnno constructor() { |
| 144 | + |
| 145 | + } |
| 146 | + |
| 147 | + @Anno |
| 148 | + val propertyFoo: String |
| 149 | + @Bnno get() = TODO() |
| 150 | + |
| 151 | + @Anno |
| 152 | + fun functionFoo(@Anno p1: Int, @Bnno p2: Int) { |
| 153 | + @Anno val local = 1 |
| 154 | + } |
| 155 | + |
| 156 | + @setparam:Cnno |
| 157 | + var a = 1 |
| 158 | +} |
| 159 | + |
| 160 | +class C(@Cnno val x: Int) |
| 161 | + |
| 162 | +@A1 |
| 163 | +class Bar |
| 164 | + |
| 165 | +@A2 |
| 166 | +class Baz |
| 167 | + |
| 168 | +@A3 |
| 169 | +class Burp |
| 170 | + |
| 171 | +@Anno |
| 172 | +typealias Flux = String |
| 173 | + |
| 174 | +enum class RGB{ |
| 175 | + R, |
| 176 | + G, |
| 177 | + @Anno |
| 178 | + B |
| 179 | +} |
0 commit comments