Commit Graph

56 Commits

Author SHA1 Message Date
Ivan Kochurkin 75b40e4b75 [FIR] Add INVISIBLE_SETTER 2021-10-03 17:10:06 +03:00
Jinseong Jeon 464eecef03 FIR IDE: add more tests about annotation resolution 2021-10-01 18:54:14 +03:00
Ilya Kirillov c8c1ee2b5a Fix usage of readWriteAccess without resolve
^KTIJ-19777 fixed
2021-10-01 16:48:35 +02:00
Tianyu Geng 5c716ea979 FIR checker: report NOT_A_FUNCTION_LABEL 2021-10-01 17:21:39 +03:00
Ilya Kirillov 5c3ce67648 Analysis API: introduce KtIntegerLiteralType 2021-09-30 01:46:00 +03:00
Ilya Kirillov 8d15e0e824 Analysis API: use FirSession from star importing scope for resolving classifiers
Resolve should happen from the use-site of the file to which importing scope belongs to
2021-09-29 22:24:27 +02:00
Tianyu Geng 43257f7688 FIR IDE: rename SymbolKind: MEMBER -> CLASS_MEMBER 2021-09-29 22:24:27 +02:00
Tianyu Geng 954926e0de FIR IDE: get containing symbol of KtTypeParameterSymbol
As part of this change, we now also allow HL API to get containing
symbol for any KtSymbols.
2021-09-29 22:24:26 +02:00
Tianyu Geng 7c3754f516 FIR IDE: output substitutor from checkExtensionIsSuitable 2021-09-29 22:24:26 +02:00
Tianyu Geng 18a23f26f5 FIR IDE: allow getting overridden symbols on any callable symbols
This way caller don't need to first check if the symbol is allowed to
override. The current API throws for cases like Java field, or enum
entry, which is not very user-friendly.
2021-09-29 22:24:26 +02:00
Tianyu Geng 54b32f6911 FIR IDE: allow get overriding symbols of members in anonymous object 2021-09-29 22:24:26 +02:00
Tianyu Geng 50166c776c FIR IDE: add KtClassInitializerSymbol 2021-09-29 22:24:26 +02:00
Tianyu Geng 6f9712a812 FIR IDE: get property as containing symbol for default accessors 2021-09-29 22:24:26 +02:00
Tianyu Geng 3b48103cd2 FIR IDE: Add API to get implicit receiver types at a position
This will be used in completion contribution.
2021-09-29 22:24:25 +02:00
Tianyu Geng 14452661cc FIR IDE: makes HL ref shortener tolerate missing type arg in type refs 2021-09-29 22:24:25 +02:00
Tianyu Geng 72a4687990 FIR IDE: fix KtFirNonStarImportingScope 2021-09-29 22:24:25 +02:00
Tianyu Geng 211544e790 FIR: rename FirResolvedImport.resolvedClassId|relativeClassName
These two fields references the parent of the import rather than the
classes that are imported. For example

```
import java.util.Map // resolvedClassId -> null
import java.util.Map.Entry // resolvedClassId -> java.util.Map
import java.util.Map.* // resolvedClassId -> java.util.Map
import java.util.Map.someStaticMethod // resolvedClassId -> java.util.Map
import kotlin.package.someTopLevelFuntion // resolvedClassId -> null
import kotlin.package.MyObject.someObjectFuntion // resolvedClassId -> kotlin.package.MyObject
```
2021-09-29 22:24:25 +02:00
Mikhail Glukhikh 3045a5e920 FIR: implement OPT_IN_MARKER_ON_WRONG_TARGET 2021-09-29 19:39:20 +03:00
Mark Punzalan 7425986bf0 Analysis API: Don't resolve references to @Deprecated(HIDDEN)
declarations.
2021-09-29 19:39:16 +03:00
Ilya Kirillov 7d4d035287 Analysis API: add validity assertions to diagnostics 2021-09-28 15:55:24 +03:00
Ilya Kirillov 9fd988d727 Analysis API: regenerate diagnostic classes 2021-09-28 15:55:22 +03:00
Ilya Kirillov 6c97393927 Analysis API: get rid of weak refs scheme for working with FIR internals for diagnostics 2021-09-28 15:55:19 +03:00
Ilya Kirillov d723916d67 Analysis API: get rid of weak refs scheme for working with FIR internals for KtScope 2021-09-28 15:55:18 +03:00
Ilya Kirillov d348c48e4f Analysis API: get rid of weak refs scheme for working with FIR internals for KtSymbol and KtType 2021-09-28 15:55:17 +03:00
Ilya Kirillov 2de4a6f924 Analysis API: fix reference resolving for implicit invoke calls 2021-09-28 15:55:16 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Jinseong Jeon d9424fa092 FIR IDE/LC: rename origin of constant values 2021-09-23 00:11:26 +02:00
Jinseong Jeon d3d3aeacb4 FIR IDE: make compile-time constant evaluator an object
because it doesn't have any states.
2021-09-23 00:11:26 +02:00
Jinseong Jeon 414881403b FIR IDE: handle annotation array values properly 2021-09-23 00:11:26 +02:00
Jinseong Jeon ffd0a5ed14 FIR IDE: make constant values symbol-free 2021-09-23 00:11:26 +02:00
Jinseong Jeon f94dad7005 FIR IDE: migrate annotation parameter conversion util 2021-09-23 00:11:26 +02:00
Jinseong Jeon 0f16a2cb92 FIR IDE: rename some of constant values for consistency 2021-09-23 00:11:25 +02:00
Jinseong Jeon ce445700b8 FIR IDE: split conversion utils for KtConstantValue to its own object 2021-09-23 00:11:25 +02:00
Jinseong Jeon 4c8d975ae5 FIR LC: handle more kinds of annotation values 2021-09-23 00:11:25 +02:00
Jinseong Jeon 6ef2dad895 FIR IDE: more comprehensive abstractions of annotation values 2021-09-23 00:11:25 +02:00
Jinseong Jeon 744961bd00 FIR IDE: test resolution of various annotation values 2021-09-23 00:11:25 +02:00
Ilya Kirillov 678b931ba3 Analysis API: introduce Project Structure 2021-09-22 12:57:14 +02:00
Roman Golyshev 1e91c66d19 [FIR IDE] Fix Always false condition in FirReferenceResolveHelper 2021-09-21 01:29:06 +03:00
Roman Golyshev 39116853d2 [FIR IDE] Implement pointers for JavaField and SyntheticJavaProperty symbols 2021-09-21 01:29:05 +03:00
Tianyu Geng 9ca8d39240 FIR IDE: use KtVariableWithInvokeFunctionCall for extension invoke 2021-09-17 17:27:53 +02:00
Tianyu Geng c19ed07fd1 FIR IDE: add cache in KtFirCallResolver 2021-09-17 17:27:52 +02:00
Tianyu Geng d2ed203528 FIR IDE: Add substitutor to KtCall 2021-09-17 17:27:52 +02:00
Tianyu Geng 9f0f1781c9 FIR IDE: add validity token to KtCall 2021-09-17 17:27:52 +02:00
Tianyu Geng 245c4082cd FIR IDE: add KtSubstitutor 2021-09-17 17:27:52 +02:00
Tianyu Geng d77db2cda6 FIR checker: expose API to check if two types are compatible
This is useful for quickfixes offering casts. We don't want to offer
user to cast incompatible types.

Also, explicitly allow compare to `Nothing` and handle `Nothing` from intersection
2021-09-17 01:59:05 +03:00
Tianyu Geng 951812f130 FIR checker: record whether type mismatch is due to nullability
This is useful for downstream quickfixes.
2021-09-17 01:59:01 +03:00
Tianyu Geng 76e192fc8a FIR Checker: check AMBIGUOUS_ANONYMOUS_TYPE_INFERRED
Also change
org.jetbrains.kotlin.fir.types.TypeUtilsKt#hideLocalTypeIfNeeded to skip
approximating anonymous objects if there are multiple super type refs so
that resolution behaves the same (for uncompilable code).

Note that this change does not implement check for
ApproximateAnonymousReturnTypesInPrivateInlineFunctions as the check is
already turned on in 1.5 and will likely not needed when FIR becomes
stable.
2021-09-16 22:38:06 +03:00
Jinseong Jeon 35409fdb8d FIR IDE: resolve arrayOf calls in annotations 2021-09-15 22:33:20 +02:00
Jinseong Jeon 068e81570d FIR IDE: type-aware constant conversion 2021-09-15 22:32:12 +02:00
Dmitriy Novozhilov 5c2a3bb78e [FIR] Move duplicating names and classIds to StandardClassIds 2021-09-15 17:11:29 +03:00