From 820c2c7cd88f9acafe9cbca9fb7abb19a8cfceb6 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 26 Nov 2014 17:58:18 +0300 Subject: [PATCH] Smart completion: inheritors instantiation suggested + fixed a bug with incorrect presentation of generic java class instantiation --- .../Smart_Completion_Tests.xml | 2 + .../jet/lang/types/SubstitutionUtils.java | 2 +- .../caches/resolve/KotlinCacheService.kt | 4 + .../plugin/caches/resolve/ResolutionFacade.kt | 2 + .../plugin/completion/CompletionSession.kt | 12 +- .../completion/smart/SmartCompletion.kt | 33 ++++- .../smart/TypeInstantiationItems.kt | 139 ++++++++++++++++-- .../jet/plugin/completion/smart/Utils.kt | 1 + .../smart/AnonymousObjectInsertsImport.kt | 2 +- .../AnonymousObjectInsertsImport.kt.after | 2 +- .../handlers/smart/ConstructorForJavaClass.kt | 3 + .../smart/ConstructorForJavaClass.kt.after | 3 + .../completion/handlers/smart/SAMExpected1.kt | 3 +- .../handlers/smart/SAMExpected1.kt.after | 3 +- .../smart/ConstructorForGenericJavaClass.kt | 5 + .../ConstructorForGenericJavaClass.kt.todo | 5 - idea/testData/completion/smart/Inheritors1.kt | 8 + idea/testData/completion/smart/Inheritors2.kt | 5 + .../GenericInheritors1/GenericInheritors1.kt | 15 ++ .../GenericInheritors1/JavaInheritors.java | 6 + .../GenericInheritors1/KotlinInheritors.kt | 23 +++ .../GenericInheritors2/GenericInheritors2.kt | 8 + .../GenericInheritors2/KotlinInheritors.kt | 11 ++ .../GenericInheritors3/GenericInheritors3.kt | 8 + .../GenericInheritors3/KotlinInheritors.kt | 11 ++ .../GenericInheritors4/GenericInheritors4.kt | 8 + .../GenericInheritors4/KotlinInheritors.kt | 10 ++ .../smartMultiFile/Inheritors/Inheritors.kt | 15 ++ .../Inheritors/JavaInheritors.java | 16 ++ .../Inheritors/KotlinInheritors.kt | 17 +++ .../JvmSmartCompletionTestGenerated.java | 19 ++- ...MultiFileSmartCompletionTestGenerated.java | 30 ++++ .../jet/plugin/KotlinCompletionTestCase.java | 1 - 33 files changed, 396 insertions(+), 36 deletions(-) create mode 100644 idea/testData/completion/smart/ConstructorForGenericJavaClass.kt delete mode 100644 idea/testData/completion/smart/ConstructorForGenericJavaClass.kt.todo create mode 100644 idea/testData/completion/smart/Inheritors1.kt create mode 100644 idea/testData/completion/smart/Inheritors2.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors1/GenericInheritors1.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors1/JavaInheritors.java create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors1/KotlinInheritors.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors2/GenericInheritors2.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors2/KotlinInheritors.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors3/GenericInheritors3.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors3/KotlinInheritors.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors4/GenericInheritors4.kt create mode 100644 idea/testData/completion/smartMultiFile/GenericInheritors4/KotlinInheritors.kt create mode 100644 idea/testData/completion/smartMultiFile/Inheritors/Inheritors.kt create mode 100644 idea/testData/completion/smartMultiFile/Inheritors/JavaInheritors.java create mode 100644 idea/testData/completion/smartMultiFile/Inheritors/KotlinInheritors.kt diff --git a/.idea/runConfigurations/Smart_Completion_Tests.xml b/.idea/runConfigurations/Smart_Completion_Tests.xml index 421247549ac..3f27f24afea 100644 --- a/.idea/runConfigurations/Smart_Completion_Tests.xml +++ b/.idea/runConfigurations/Smart_Completion_Tests.xml @@ -28,6 +28,8 @@ + +