Commit Graph

219 Commits

Author SHA1 Message Date
Ilya Kirillov 970d7b5a78 HL API: implement tests for reference resolve 2021-07-27 17:58:43 +03:00
Jinseong Jeon e9f2d574d5 FIR IDE: simplify HL APIs for PsiType
The idea is to convert `KtType` to `PsiType`, along with the given
`PsiElement` context, instead of providing individual API to convert
different psi source to `PsiType`. To that end, we need to
migrate/rewrite some APIs/implementations that retrieve `KtType` from
different source of `PsiElement`.
2021-07-23 13:28:14 +02:00
Jinseong Jeon f02f3c76ae FIR IDE: API to resolve KtTypeReference to KtType 2021-07-23 13:28:11 +02:00
Jinseong Jeon 5358d4f07c FIR IDE: construct function type from a function as PsiType 2021-07-23 13:28:05 +02:00
Jinseong Jeon f19a501cc7 FIR IDE: common super type of given KtExpression's 2021-07-23 13:27:59 +02:00
Jinseong Jeon 5690b4d8c2 FIR IDE: get the return type of KtDeclaration as PsiType 2021-07-23 13:27:57 +02:00
Tianyu Geng 6dc75c2e51 FIR IDE: allow KtClassOrObject to resolve to null KtSymbol
At PSI level, an enum entry is a `KtClassOrObject`. But the resolved
FIR counterpart `FirEnumEntry` is not an `FirRegularClass`.
2021-07-22 20:39:56 +03:00
Mark Punzalan cb85fd26f5 FIR IDE: Expand KtCall API to include annotation calls and delegated
constructor calls.
2021-07-16 21:06:02 +03:00
Mark Punzalan d30d8037cf FIR IDE: Add KtFunctionLikeSymbol.hasStableParameterNames. 2021-07-16 21:06:00 +03:00
Mark Punzalan 5c111f8979 FIR IDE: Add argument mapping to KtFunctionCall. 2021-07-16 21:05:59 +03:00
Jinseong Jeon 9ec4d19a3f FIR IDE: avoid finding symbol for function type parameter 2021-07-15 18:29:33 +02:00
Ilya Kirillov a9bb577154 FIR IDE: add ability to run multimodule tests 2021-07-08 18:25:39 +03:00
Ilya Kirillov 30d0fea003 FIR IDE: enable explicit API mode in idea-frontend-fir module 2021-07-07 01:40:03 +03:00
Tianyu Geng 63c65edda2 FIR IDE: AddWhenRemainingBranchFix
The fix reuses logic that is already available from
FirWhenExhaustivenessTransformer to collect missing when branches. The
current logic unfortunately uses hackyAllowRunningOnEdt to shorten the
generated code.
2021-06-24 18:26:18 +02:00
Jinseong Jeon ee02303816 FIR IDE/UAST: resolve call from KtUnaryExpression 2021-06-24 16:38:24 +02:00
Tianyu Geng 55e7cc7ea3 FIR IDE: add HLConvertToBlockBodyIntention 2021-06-23 22:22:14 +03:00
Tianyu Geng 3aa6cb25ba FIR IDE: Add ImportMemberIntention 2021-06-23 22:22:12 +03:00
Tianyu Geng 726d141589 FIR IDE: Add fine-grained control to KtReferenceShortener
This change makes it possible to control how references to a symbol should be shortened.
2021-06-23 22:22:07 +03:00
Nikita Bobko 938cd955e1 Remove :idea prefix in IDE FIR modules which are going to stay in kotlin repo
This commit fixes not possibility to build project with `disableKotlinPluginModules`
flag on because Gradle tries to resolve `:idea` module which is disabled
2021-06-22 03:06:16 +03:00
Jinseong Jeon 2999d0bd4b FIR/UAST: commonize double colon expressions 2021-06-21 13:49:44 +03:00
Ilya Kirillov 915c8b7996 FIR IDE: implement completion for variables with functional types with receivers 2021-06-21 13:43:44 +03:00
Ilya Kirillov ae9ac33f0f FIR IDE: implement completion for infix functions 2021-06-21 13:43:39 +03:00
Ilya Kirillov 2ffc7ad0a0 FIR IDE: implement completion for callable references 2021-06-21 13:43:38 +03:00
Ilya Kirillov 72b8593240 FIR IDE: do not use IJ test infrastructure in frontend-api-fir tests 2021-06-20 22:07:31 +02:00
Ilya Kirillov 0c5883cbe0 FIR IDE: do not depend on IDEA modules in frontend-api 2021-06-20 22:07:15 +02:00
Ilya Kirillov 28dbfeb845 Move KtReference interface to psi module 2021-06-20 22:07:15 +02:00
Ilya Kirillov 796baf261d FIR IDE: move KtIconProvider out of idea-frontend-api module 2021-06-20 22:07:15 +02:00
Ilya Kirillov 75331b3448 FIR IDE: abstract low-level-api from dependency on idea 2021-06-20 22:07:11 +02:00
Ilya Kirillov 7fe2adc37e FIR IDE: do not use helper methods unavailable in intellij-core 2021-06-20 22:02:17 +02:00
Jinseong Jeon 833761ac3c FIR IDE/UAST: add KtCompileTimeConstantProvider with evaluate API 2021-06-19 21:58:41 -07:00
Ilya Kirillov 39e2df6916 FIR IDE: render unresolved types as qualifiers for member generator 2021-06-16 01:17:44 +03:00
Ilya Kirillov cf7870e376 FIR IDE: implement toString for KtType 2021-06-16 01:17:43 +03:00
Ilya Kirillov af9e6253e4 FIR IDE: add ability to specify type argument in KtClassTypeBuilder 2021-06-16 01:17:42 +03:00
Ilya Kirillov 148c90dd1e FIR IDE: do not make KtTypeArgumentWithVariance abstract
As it does not require specific FIR implementation
2021-06-16 01:17:41 +03:00
Ilya Kirillov 73bb2e76f2 FIR IDE: introduce KtFirDefinitelyNotNullType 2021-06-16 01:17:38 +03:00
Ilya Kirillov 8177a70ff9 FIR IDE: introduce KtCapturedType 2021-06-16 01:17:36 +03:00
Ilya Kirillov e2cfd933f1 FIR IDE: introduce HL API for creating class types 2021-06-16 01:17:35 +03:00
Ilya Kirillov 0a6c96492a FIR IDE: simplify KtType hierarchy
- get rid of Kt(Non)DenotatbleType super classes as unused
- make KtErrorType to inherit KtClassType to be consistent with FIR
2021-06-16 01:17:32 +03:00
Tianyu Geng f6078b24df FIR IDE: AddToString quickfix 2021-06-15 20:19:53 +02:00
Jinseong Jeon ce26d54917 FIR IDE: extract PsiType conversions to KtPsiTypeProvider 2021-06-13 00:10:47 +03:00
Jinseong Jeon 0db510ad8b FIR IDE/UAST: introduce UAST-specific version of analyse 2021-06-13 00:10:46 +03:00
Jinseong Jeon 47ede5bdc8 FIR IDE/UAST: get PsiType from KtTypeReference 2021-06-13 00:10:38 +03:00
Jinseong Jeon fa36098214 FIR IDE/UAST: get PsiType from KtExpression 2021-06-13 00:10:34 +03:00
Mark Punzalan 97ea901507 FIR IDE: Add isDefinitelyNull() and isDefinitelyNotNull() to
KtExpressionTypeProvider.
2021-06-09 22:49:51 +03:00
Ilya Kirillov 9af0885e82 FIR IDE: implement completion in sealed when 2021-06-03 19:39:02 +03:00
Ilya Kirillov 943ae108f5 FIR IDE: introduce import statement completion 2021-06-03 19:38:48 +03:00
Ilya Kirillov 55621b7aad FIR IDE: do not complete callables for classifier without companion 2021-06-03 19:38:44 +03:00
Ilya Kirillov e77783a0e5 FIR IDE: add packages name completion 2021-06-03 19:38:32 +03:00
Ilya Kirillov d76ec9db50 FIR IDE: add completion for annotations 2021-06-03 19:38:30 +03:00
Tianyu Geng e1b542314a FIR IDE: quickfix for WrapWithSafeLetCall
There is some behavior change regarding the new WrapWithSafeLetCall quickfix

1. it now works correctly on binary expressions by wrapping it with `()`
2. it now looks for a nullable position upward and do the modification there,
   if possible. For example, consider the following code

   ```
   fun bar(s: String): String = s

   fun test(s: String?) {
     bar(bar(bar(<caret>s)))
   }
   ```

   After applying this fix, FE1.0 yields

   ```
   bar(bar(s?.let { bar(it) }))
   ```

   while the new implementation yields

   ```
   s?.let { bar(bar(bar(it))) }
   ```

   This behavior aligns with FE1.0 if `bar` accepts nullable values.
2021-05-20 20:33:00 +02:00