Commit Graph

35 Commits

Author SHA1 Message Date
Dmitriy Novozhilov b174bb8844 [FIR] Update testdata after introducing FirResolvedErrorReference 2022-12-15 12:12:19 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Ilya Kirillov 7bac119f20 [FIR] add lazy resolution contract checks in resolve 2022-12-12 16:21:06 +00:00
Dmitriy Novozhilov 6864433581 [FIR] Support resolution of meta-annotations before supertypes
Now annotations are resolved with following algorithm:
1. On COMPILER_REQUIRED_ANNOTATIONS we resolve all annotations
     and store results if this is compiler annotation, plugin annotation,
     or annotation with meta-annotation (meta annotations are checked
     recursively with designated resolution if needed)
2. On TYPES stage we resolve all those annotations once again and if
     some annotation changes resolution then we keep type from p.1 and
     report error on this annotation, so user should disambiguate it

Ambiguity may occur because of nested annotations with same name as
  plugin annotations:

```
annotation class SomeAnnotation // (1) plugin annotation

open class Base {
    annotation class SomeAnnotation // (2)
}

class Derived : Base() {
    @SomeAnnotation // <-----------------
    class Inner
}
```
At COMPILER_REQUIRED_ANNOTATIONS annotation call will be resolved to (1)
  because at this stage supertypes are not resolved yet, and we consider
  only importing scopes. At the TYPES stage we will find correct
  annotation from supertype
2022-12-01 07:29:39 +00:00
Dmitriy Novozhilov 0b4216c096 [FIR] Fix test configuration of FIR plugin prototype 2022-12-01 07:29:38 +00:00
Dmitriy Novozhilov 246dc985a6 [FIR] Rework predicates system
Now predicates are split into LookupPredicate and DeclarationPredicate
  hierarchies. First one allows to perform global search for declarations
  and second one allows to check if some declaration matches the predicate.
Predicates with meta annotations are excluded from LookupPredicates,
  because it's impossible to create index of annotations with meta-annotations,
  because they can be located inside binary dependencies (so to achieve
  this we need to scan the whole classpath).
Also only one predicate with meta-annotations is left in DeclarationPredicate
  hierarchy (AnnotatedWithMeta)

^KT-53874 Fixed
^KT-53590 Fixed
2022-12-01 07:29:37 +00:00
Ilya Kirillov 7781ad67d4 [FIR] introduce FirValueParameter.containingFunctionSymbol
^KT-55034 fixed
2022-11-22 18:25:30 +01:00
Nikolay Lunyak e34dd49872 [FIR] Get rid of the argumentMapping function.
It's just a duplicate of `resolvedArgumentMapping`. Plus there is a
member with the same name inside `FirAnnotationCall`.
2022-11-14 22:40:41 +02:00
Dmitriy Novozhilov 7ce3934cf7 [FIR] Add type resolution service into SerializationFirSupertypesExtension
This service allows resolve custom user types from plugins, which allows
  to support specifying type arguments of generated supertypes basing
  on arguments passed to annotations
2022-09-26 10:09:09 +00:00
Vladimir Sukharev c8864369fd Use main class as test generator name
Merge-request: KT-MR-7031
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-09 12:51:18 +00:00
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00
Leonid Startsev 6f6342dafc Prototype of kotlinx.serialization FIR plugin:
Implement basic non-parameterized case
2022-08-17 11:43:33 +00:00
Dmitry Gridin 4ceb170917 regenerate tests 2022-08-05 14:12:41 +02:00
Mikhail Glukhikh eba0e94429 K2: get rid of manual diagnostic suppression in checkers 2022-07-22 11:35:28 +00:00
Dmitriy Novozhilov 1a8496757e [Compiler] Mark all entrypoints to compiler API as experimental 2022-06-29 12:00:01 +00:00
Dmitriy Novozhilov 8b42638afa [Plugins] Introduce new API for registering compiler plugins
Original `ComponentRegistrar` exposes Project to its registration method,
  so plugins should manually register extensions to it. To prepare for
  possible unbound compiler from Project API in future new  `K2ComponentRegistrar`
  introduced which provides registration method without Project at all
2022-06-29 11:59:58 +00:00
Mikhael Bogdanov 41d6f0dca4 Remove ir.tree.impl from build 2022-06-20 11:42:52 +00:00
Dmitriy Novozhilov f5637e5077 [FIR] Look for jar with plugin annotations in system property and by direct path in tests
This is needed to make those tests work in JPS, because corresponding
  system property is set only by gradle
2022-06-07 14:12:27 +00:00
Dmitriy Novozhilov 83d0a3e7a3 [FIR] Extract FirPluginKey into :core:compiler.common and rename it to GeneratedDeclarationKey
This is needed to avoid dependency on :compiler:fir:fir2ir module in
  backend parts of compiler plugins. It will allow to publish those
  parts into jars for IDE, where they are needed for working of debugger
  and bytecode toolwindow
2022-06-07 14:12:25 +00:00
Dmitriy Novozhilov e58e86932c [FIR] Pass declared member scope to methods of declaration generation extension 2022-06-07 14:12:24 +00:00
Dmitriy Novozhilov 23c69f8d17 [FIR] Add to new types of annotation predicates
- `ParentAnnotatedWith` matches declarations, which parent is annotated
- `HasAnnotatedWith` matches declarations, which have at least one
     direct child with annotation

Also, `DeclarationPredicate.Any` is removed, because there is no
  intention to support lookup for all declarations in module

^KT-52486 Fixed
2022-06-07 14:12:22 +00:00
Dmitriy Novozhilov f34061acc1 [FIR] Fix resolution of plugin annotations annotated with meta annotations
There was a problem, that after founding of new annotation with meta
  annotation we did not come back to previous files, which may contain
  declarations with this new annotation
2022-06-07 14:12:19 +00:00
Nikolay Lunyak ac1fb07102 [FIR JS] Add checkers.js 2022-06-02 13:47:28 +00:00
Vyacheslav Gerasimov c8f2872a07 Fix flaky FIR tests
failing with 'Jar with annotations does not exist. Please run
:plugins:fir-plugin-prototype:plugin-annotations:jar'
2022-04-20 12:54:08 +03:00
Vyacheslav Gerasimov d9e8f0c180 Build: Rework test workers calculation with respect to available memory
#KTI-787
2022-04-19 11:45:23 +00:00
Dmitriy Novozhilov afad6a564a [Test] Pass CompilerConfiguration to AbstractEnvironmentConfigurator.registerCompilerExtensions
This is needed to provide ability to configure extensions depending on
  configuration of specific test
2022-04-08 09:42:00 +00:00
Roman Golyshev ffcbc583d0 FIR: Split EnvironmentConfigurator to an interface and abstract class
It is needed to make it easier to write wrappers for configurators
2022-02-25 23:08:26 +03:00
Roman Golyshev 62f0487efa FIR: Set resolve phase to BODY_RESOLVE for the generated declarations
In the future it should be checked that plugins can return only
`BODY_RESOLVE`d declarations
2022-02-25 23:08:25 +03:00
Dmitriy Novozhilov d4d22b0dcf [FIR] Add plugin prototype for testing extension for injection receivers 2022-02-18 17:52:34 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Nikolay Krasko f2d649a7a1 Add dependency on dist for fir-plugin-prototype
> FirPluginDiagnosticTestGenerated$MemberGen.testClassWithCompanionObject
> java.lang.IllegalStateException: dist/kotlin-stdlib-jvm-minimal-for-test.jar does not exist. Run 'gradlew dist'
2021-12-15 19:18:50 +03:00
Dmitriy Novozhilov 77101edfa4 [FIR] Setup tests for IC with compiler plugins
Most of those tests are ignored, because IC is not supported properly
  for compiler plugins. This commit is needed to prepare infrastructure,
  fix current behaviour and collect main problems of IC with plugins

Check fail.txt files in new testdata for explanation of problems
2021-12-03 14:17:41 +03:00
Dmitriy Novozhilov 11b9a6eed2 [FIR] Implement simple serializer like declaration generator
This generator is needed to test complex dependency between generated
  members and annotated classes in incremental compilation
2021-12-03 14:17:40 +03:00
Dmitriy Novozhilov 1d32d5c7d8 [FIR] Slightly reorganize directory structure of FIR plugin prototype 2021-12-03 14:17:38 +03:00