Commit Graph

132 Commits

Author SHA1 Message Date
Pavel V. Talanov 95302fd540 Fix not generating KotlinLightField for OBJECT$ and INSTANCE$ fields
Fix navigation from Java to such fields
Fix TODO in converter
2014-10-03 21:35:06 +04:00
Pavel V. Talanov b2ec5e1ec4 Test reference resolve from Java to Kotlin
Cases cover the most basic features
Sadly it was missing before
2014-10-03 21:35:00 +04:00
Alexander Udalov 04bb43e907 Fix navigation to data class copy function 2014-09-19 11:45:22 +04:00
Zalim Bashorov 48de3b706d Frontend: added the support file annotations to LazyTopDownAnalyzer. 2014-09-10 22:39:12 +04:00
Alexander Udalov 25bb220223 Fix navigation on values()/valueOf() of enum classes 2014-09-09 20:42:39 +04:00
Svetlana Isakova 9d366cb896 Prohibit local objects and enum classes
#KT-5402 Fixed
  #KT-4838 Fixed

Resolve type of object inside local object as special, not supertype('Any').
Changed visibility of constructor of anonymous object to 'internal' to be able to resolve the following:
fun box(): String {
    var foo = object {
        val bar = object {
            val baz = "ok"
        }
    }
    return foo.bar.baz
}
The containing declaration of property initializers is constructor, so 'baz' was invisible inside private constructor.
2014-09-01 12:32:52 +04:00
Pavel V. Talanov db5303c019 Implement modules in IDE
IDE:
Rewrite AnalyzerFacade and implementations for JS and JVM to support creating separate analyzers for each module
Introduce ModuleInfo which is an intermediate entity between configuration (tests or idea modules) and ModuleDescriptor
Implement IdeaModuleInfos which represent IDEA modules, sdks and libraries
Add (somewhat thin) test checking their behaviour
Implement getModuleInfo() - utility to obtain IdeaModuleInfo for PsiElement
Drop Project.getLazyResolveSession() - not possible to obtain resolve session for the whole project any more
Adjust JavaResolveExtension accordingly
KotlinSignature Intention/Marker - make sure that analyzed element is cls element (he's not in resolve scope otherwise)

LightClasses:
Create separate package light classes for each module
Java code can only reference light class from the first module among it's dependencies
Duplicate jvm signature is only reported on package declarations inside one module

Injectors:
Receive GlobalSearchScope as paramer for VirtualFileFinder and JavaClassFinder
which allows to narrow analyzer scope

JDR:
Introduce ModuleClassResolver resolves java classes in correct java descriptor resolver (corresponding ModuleDescriptor)
Add test checking that java classes belong to correct module

Debugger:
Provide context to analyze files created by debugger in

Converter:
Postprocessor now needs a context to analyze resulting code in

JetPsiFactory:
Add verification that files created by psi factory are not analyzed without context (that is almost never a good idea)

Other:
Use new API in various tests, utilities, run configuration producers and builtin serializers
Various "TODO: (module refactoring)" which mark the unfinished parts
2014-08-22 22:58:54 +04:00
Alexander Udalov cdbdfaf182 Make Pair and Triple data classes 2014-07-25 21:19:38 +04:00
Pavel V. Talanov 8523e18afc Set source elements for java annotation parameters 2014-07-09 18:19:40 +04:00
Pavel V. Talanov 930ea88e25 Set source elements for java enum entries
#KT-4277 Fixed
2014-07-09 18:19:39 +04:00
Pavel V. Talanov 4188bbe53c Set source elements for java parameters 2014-07-09 18:19:38 +04:00
Pavel V. Talanov 6f2ed9a5a9 Add JetMultiDeclarationReference
A reference to component* functions
2014-03-06 16:01:02 +04:00
Pavel V. Talanov 80bc7b286a Test for reference to nested class in library 2014-03-04 21:19:55 +04:00
Alexander Udalov f7b6457139 Replace "jet" package name with "kotlin" in testData 2014-03-02 19:55:26 +04:00
Alexander Udalov 11cc7f46f4 Remove "Iterator.iterator()" intrinsic, add stdlib function 2014-03-02 19:55:24 +04:00
Alexander Udalov 3dcd85bdb4 Add toString() to Any, fix all tests
#KT-4517 Fixed
2014-03-02 19:54:49 +04:00
Alexander Udalov ec30d52978 Delete Hashable, pull up its members to Any
Extensions on nullable types remain in Library.kt

 #KT-1741 Obsolete
 #KT-2805 Obsolete
 #KT-1365 Fixed
 #KT-4517 In Progress
2014-03-02 19:54:08 +04:00
Zalim Bashorov 559ea28a6b Dropped extra caret markers and introduced separate marker for referencing from context. 2014-02-24 20:27:20 +04:00
Nikolay Krasko 558fca5eab Check reference to Java root class from library 2014-02-20 16:08:04 +04:00
Pavel V. Talanov 4a3ccc4eac JDR: do not create package fragment for class statics if class cannot be resolved
This keeps behaviour consistent in rare cases when JavaClass can be found but not resolved
As of now this can happen in IDE if we take PsiClass from index but file structure is wrong so we can't resolve the class
Add test which documents this case
2014-02-11 17:17:34 +04:00
Nikolay Krasko e46c19b3f8 Test for correct references to java classes 2014-02-06 15:52:02 +04:00
Nikolay Krasko e36c0130a0 Test for reference to kotlin compiled inner class 2014-02-06 15:52:01 +04:00
Nikolay Krasko 3ceed45c09 Test for resolving references from package which is declared both in binaries and sources 2014-02-06 15:52:01 +04:00
Pavel V. Talanov 6c96d235ec Tests: add complex tests for references to libraries
These tests check that that complex references (var p by delegate, for in collection, array[index]) are resolved correctly when target descriptors have type parameters
See 41f9dcba91

 #KT-4505 Fixed
2014-02-05 17:15:14 +04:00
Evgeny Gerashchenko ae4c68830d Importing root scope without members. 2014-01-16 22:11:55 +04:00
Nikolay Krasko 0d141d959a Add tests for EA-52767 and KT-4366: "java.lang.IllegalArgumentException: Could not find a classifier for "... 2014-01-15 22:01:03 +04:00
Alexey Sedunov e2118b7ae8 Tests for additional lazy resolve (local classes/objects in class initializers) 2014-01-15 16:49:29 +04:00
Evgeny Gerashchenko eb5455e89f Got rid of "jet" file extension. 2013-10-01 19:32:38 +04:00
Pavel V. Talanov 10797db588 Create test for resolving with compiled kotlin dependency
Test for resolving fake overrides from binaries
2013-09-30 20:54:35 +04:00
Andrey Breslav 87293a8831 Navigation to invoke() from {}
Example:

foo <caret>{}
2013-08-28 15:26:47 +04:00
Andrey Breslav a53986e1d6 Navigation to iterator(), next(), hasNext() through 'in' in for-loops 2013-08-28 14:46:58 +04:00
Andrey Breslav aa6a509e8d A navigation test for one fake override 2013-08-28 13:52:46 +04:00
Andrey Breslav 9fa8ee10dc Tests for navigation to property delegates' accessors 2013-08-28 13:49:52 +04:00
Nikolay Krasko eaf0c2cb84 Fix problem of getting reference and parameter in functional literal inside other parameter (EA-48757) 2013-08-19 14:44:50 +04:00
Nikolay Krasko 7ec170f6ec Fix absence of reference for type parameters 2013-07-29 18:20:09 +04:00
Nikolay Krasko 2b0232307c Fix error on getting descriptor for class object 2013-07-27 03:57:30 +04:00
Nikolay Krasko b0b173eb5a Resolve descriptors in error class objects 2013-07-27 03:57:24 +04:00
Nikolay Krasko a69b2883ee Make resolve session be able to resolve class parameters 2013-07-27 03:57:23 +04:00
Nikolay Krasko 51f690ed4d Refactor additional resolve for reference in packages 2013-07-27 03:57:21 +04:00
Nikolay Krasko 9167e4f1ee Make resolve session be able to resolve class constructor parameters 2013-07-27 03:57:20 +04:00
Nikolay Krasko 27efc3b202 Additional resolve for annotations in lazy resolve 2013-07-27 03:57:18 +04:00
Nikolay Krasko b6be094724 Force resolve imports for elements in imports 2013-07-27 03:57:17 +04:00
Nikolay Krasko 2621df3243 Auto generate reference tests 2013-07-27 03:57:13 +04:00
Nikolay Krasko cb19450d8d Refactor multi-reference tests 2013-07-27 03:57:10 +04:00
Nikolay Krasko 970586bfdd Use directive configuring in resolve reference tests 2013-07-27 03:57:10 +04:00
Evgeny Gerashchenko 06bfb1d017 KT-3472 Can't navigate to source by clicking on a SAM constructor
#KT-3472 fixed
2013-07-02 14:06:08 +04:00
Evgeny Gerashchenko 6e43b78deb KT-3459 "import java.util.*" is removed by optimize imports if the only usage is a SAM constructor
#KT-3459 fixed
2013-04-03 17:44:01 +04:00
Evgeny Gerashchenko 66e7a0110c Updated test data and stdlib code which dependent on Tuple0/Unit
aliasing.
2013-03-22 16:38:24 +04:00
Evgeny Gerashchenko c458ed36f6 Renamed test data dir. 2013-03-22 16:37:16 +04:00
Evgeny Gerashchenko afe54098be Removed tuples from BuiltInsReferenceResolverTest. 2013-03-22 16:37:16 +04:00