Commit Graph

30 Commits

Author SHA1 Message Date
Bogdan Mukvich 7b00323b89 [Build] Update guava
Fix some reports from "Show Vulnerable Dependencies"

^KTI-1342
2023-08-25 14:10:37 +00:00
Egor Kulikov a7c1f53af8 [FIR] Correctly process invalid destructing declarations
^KTIJ-24730 fixed

Merge-request: KT-MR-10712
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-06-27 09:54:01 +00:00
Yan Zhulanow c6d8876f9f [LL API] Pass the project instance to ProjectStructureProvider
Eliminate unnecessary PSI tree traversal by providing the 'Project'
instance explicitly.
2023-05-16 08:42:57 +00:00
Yan Zhulanow e9c077220f [LL API] Migrate 'getKtModule()' usages to 'ProjectStructureProvider'
Ensure the contextual module is passed wherever possible.

^KT-57559 Fixed
2023-05-16 08:42:57 +00:00
Andrei Klunnyi 1e0115aef8 KT-57468 Kotlin assignment plugin: operation name cannot be found
The problem results in broken import quick fix and import optimizer on
the IDE side [1].

`AssignResolutionAltererExtension` introduced a possibility to override
 resolution of assignment statements. The inconsistency though is
 that `KtSimpleNameReference.getResolvesByNames` doesn't return a name
 for the overridden `=`. Kotlin as a language doesn't support this [2].

This commit eliminates the drawback above:
1. It fixes the name `assign` the `=` can be resolved to [3].
   This eliminates the need to search for the name, bypassing the
   plugins.
2. `KtSimpleNameReference.getResolvesByNames` returns `assign` among
   other names in case it deals with binary `=` and assignment is
   resolved.
3. `KtCompilerPluginsProvider` was extended to check plugins' presence.
   K1 implementation added.

----------------------------------------------------------------
[1]: https://youtrack.jetbrains.com/issue/KTIJ-24390
[2]: OperatorConventions.getNameForOperationSymbol
     https://kotlinlang.org/docs/operator-overloading.html#augmented-assignments
[3]: OperatorConventions#ASSIGN_METHOD + AssignmentPluginNames
2023-04-27 14:05:02 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Andrei Klunnyi 66a74ab60e KT-56941 Gradle KTS navigation: go to declaration (Java) doesn't work
Case:
```
options.incrementalAfterFailure = false    // assignment operator  (a)
options.incrementalAfterFailure.set(false) // equivalent (without) (b)

// (a) works thanks to AssignResolutionAltererExtension
// 'incrementalAfterFailure' is a synthetic Java property
// i.e. getIncrementalAfterFailure()

// Navigation to 'incrementalAfterFailure' (a) doesn't work.
```

By navigation, we mean opening declaration sources. The reason of the
issue lied in sources absence (inability to find them).

In general, sources are available via declaration descriptor.
To find one for a property, one needs to understand expression
kind: read/write/both. Hence, the choice of a getter/setter/both.
Since `=` operator is interpreted as a write type expression, a setter
was searched. Missing one resulted in corrupted navigation.

As a fix we provide getter for the missing setter case.

^KT-56941 fixed
2023-03-01 13:25:38 +00:00
Ilya Kirillov 477072b3e7 [Analysis API FIR] remove duplicated override of Fe10SyntheticPropertyAccessorReference.resolvesByNames 2023-02-20 10:28:56 +00:00
Ilya Kirillov 78d0749235 [Analysis API FIR] implement SyntheticPropertyAccessorReference.canBeReferenceTo for fir reference
it might improve find usages performance

^KTIJ-24696
2023-02-20 10:28:55 +00:00
Jinseong Jeon fc2da32eb6 [references] introduce a dummy reference resolve helper
...because the implementation of reference resolution helper in IDE is
not always available (e.g., Android Lint CLI).
2023-01-24 17:54:00 +01:00
Roman Golyshev 9702b97d8d [kotlin] KTIJ-23832 Select proper argument for Kotlin annotations in KtDefaultAnnotationArgumentReference
Kotlin annotations can be called without named parameters even if their
names are different from `value`. So there's no need to search for the
property named "value", since there might be none
2022-12-12 14:13:42 +01:00
Vladimir Dolzhenko ebf24c2d24 Add default impl of getCanonicalText
#KTIJ-11270
2022-12-02 18:28:41 +00:00
Dmitriy Novozhilov 7ef81c27df [AA] Make KotlinReferenceProvidersService and KotlinReferenceProviderContributor a project services
There is no need to have those services on application level
2022-09-15 17:27:20 +03:00
Dmitry Gridin 8dbdea39da [analysis] remove redundant diagnostic suppression 2022-08-15 11:04:58 +02:00
Dmitry Gridin 1708b4fe48 [light classes] move light-classes-base module to analysis
^KT-53097
2022-08-01 13:56:34 +00:00
Yan Zhulanow 0c001cc993 Fix unstable reference provider ordering in IDE's KtIdeReferenceProviderService
As a result of unstable reference provider ordering, order of references in 'PsiElements' vary each IDE restart.
It directly affects the 'getReference()' method which returns the first available reference.
2022-07-25 07:35:39 +00:00
Dmitry Gridin 248811e729 [light classes] replace light class dependency from analysis.kt-references.kt-references-fe10 to light-classes-base
^KT-53097
2022-07-19 15:41:59 +00:00
Dmitry Gridin 807a269f09 [light classes] replace light class dependency from analysis.kt-references to light-classes-base
^KT-53097
2022-07-19 15:41:58 +00:00
Mikhail Glukhikh a31d383b4d Analysis API: add implementation of ReadWriteAccessChecker via descriptors 2022-06-09 11:05:36 +00:00
Mikhail Glukhikh 0ee04d0825 FE10 analysis API: revert resolving 'this' references to receivers
FE10 IDE plugin relies on resolving 'this' references to class or callable
2022-06-03 16:25:44 +00:00
Mikhail Glukhikh d792c7b70c Reference analysis API: add stub for ReadWriteAccessChecker to run tests 2022-05-31 11:34:57 +00:00
Mikhail Glukhikh 1ae71a20f3 FE10 analysis API: support reference resolve for labels & 'this' 2022-05-31 11:34:56 +00:00
Ilya Kirillov 500295da68 [references] move fe10 references implementation to another package 2022-05-27 15:37:40 +02:00
Tianyu Geng 010431e9e7 [Analysis API] Make a separate module for kt-reference-fe10 2022-05-27 15:37:37 +02:00
Tianyu Geng 19e9143bc1 [Analysis API] Move default annotation argument reference to kotlin repo
This reference is frontend-independent, so its implementation is placed
inside kt-references directly.
2022-05-27 15:37:36 +02:00
Tianyu Geng a7c37286a3 [Analysis API] Move SyntheticPropertyAccessorReferenceDescriptorImpl
Also move some utilities from IDE to kotlin repo
2022-05-27 15:37:35 +02:00
Tianyu Geng 71a30b0c5e [Analysis API] Move KDocReference to kotlin repo. 2022-05-27 15:37:34 +02:00
Tianyu Geng 0803ab0d0b [Analysis API] Add KtFe10ReferenceResolutionHelper and ...
Make implementation of KtFe10XXXReference follow the old
descriptor-based implementation as closely as possible.
2022-05-27 15:37:33 +02:00
Tianyu Geng b5139c958b [Analysis API] Add KtReferenceMutateService...
and delegate renaming and rebinding to this new service for `KtReference`.

In addition, CliKtFe10XXXReference are all removed because it seems they are not necessary because the IDE flavor differs only by handling renaming, which is moved to a separate service.
2022-05-27 15:37:33 +02:00
Mads Ager a398f7d6cb Rename kt-reference module to kt-references. 2022-02-07 15:01:24 +01:00