Completion in the IDE relies on correct scopes for KDoc positions.
So we add testData for `KtScopeProvider` and `ContextCollector`
to ensure that there are no regressions
- In addition to file declarations and class members, we also need to
commit pending diagnostics on declarations in scripts, to honor
suppressions before the diagnostics are committed indiscriminately.
^KT-62899
- `scriptUninitializedTopLevelProperty` is currently disabled in FIR
because it fails with a mismatch between diagnostics from the file and
the individual elements. It will be enabled in the next commit.
^KT-62899
- In KT-62899, diagnostics produced by file checkers weren't suppressed
because the top-level declarations on which the diagnostics are
reported were never visited by the same reporter.
`LLFirDiagnosticVisitor` skips nested declarations by design, as
diagnostics are collected for each structure element separately.
However, suppression takes effect when diagnostics are committed on
some element. If the element is not visited, suppression is skipped
and the diagnostic is committed at the end without a check by
`FileStructureElementDiagnosticsCollector.collectForStructureElement`.
- The fix ensures that diagnostics are committed on top-level
declarations, similar to how this was already done for class members.
^KT-62899 fixed
- `testConflictingOverloadsAtTopLevel` is currently disabled in FIR
because it fails with a mismatch between diagnostics from the file and
the individual elements. It will be enabled in the next commit.
^KT-62899
for `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` checker near to
other tests of this diagnostic. It is fine to move it out of
`multiplatformCompositeAnalysis` dir, because, actually, it tests
the case with comparison of FirAnnotationCall and FirAnnotationImpl,
which doesn't require composite analysis mode.
^KT-62559
...`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` checker near to
other tests of this diagnostic. This is because now such tests
are run in lazy resolve test suite, so no need to store them
separately.
^KT-62559
New tests are red in current commit!
All `.ll.kt` files are just copies of `.fir.kt` or `.kt`. This will be
fixed in the next commit to clearly show difference between LL and FIR.
The original purpose of this change was to test
`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic, for which FIR checker
will be run only in IDE (to be changed in next MR), so its reports
a lost from usual KMP tests.
But this looks like a useful change for all KMP tests, not only this
diagnostic.
^KT-62559
Add missing type propagation to getter and setter that was missed due
to copy-pasted logic.
`computeReturnTypeRef` should check the session to avoid infinitive
recursion
^KT-63361 Fixed
Each compiler-based LL FIR test can:
- fail in both non-reversed and reversed configurations, muted with `// MUTE_LL_FIR`
- fail in non-reversed test only, muted with `// IGNORE_NON_REVERSED_RESOLVE`
- fail in reversed test only, muted with `// IGNORE_REVERSED_RESOLVE`
`KotlinAnnotationsResolver` must see everything that is resolvable from
the current module; otherwise it will not work properly.
The previous scope was the module itself + its binary dependencies
(jars).
Now the scope will contain the module itself and ALL its dependencies,
including other modules.
^KT-63096 Fixed
The existing reference shortener does not use import alias when it
shortens a symbol. Instead, it adds a new import directive for the
symbol that is already imported. This commit updates reference shortener
to let it reuse the existing import alias rather than adding a new one:
1. When shortening a symbol, check whether the symbol is already
imported.
2. If it is already imported by an import alias, keep the symbol
reference expression and the import alias as a string together in
`ShortenCommand`.
The actual PSI update (shortening) based on the ShortenCommand is done
by IntelliJ.
^KTIJ-27205
- The test data is missing initialization checks and will be fixed with
the subsequent commit.
- The test data is originally taken from
`backingField/TopLevelPropertyInitialization` and has been simplified.
- I didn't add `const val` properties to the test data (compared to the
original) due to KT-20110.
^KT-63286