Commit Graph

14126 Commits

Author SHA1 Message Date
Svetlana Isakova 45abab2a2c KT-4341 No resolved call for right-hand side of equals expression
#KT-4341 Fixed
2014-02-11 21:07:08 +04:00
Svetlana Isakova aca21f78d5 check incomplete equality 2014-02-11 21:07:08 +04:00
Pavel V. Talanov 80183c88cf Do not normalize visibilities for fake overrides
#KT-4525 Fixed
2014-02-11 20:13:11 +04:00
Mikhael Bogdanov eab7f5539b Fixed dependency to kotlin runtime (dist version) 2014-02-11 17:36:01 +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
Pavel V. Talanov 4501adf5f1 AbstractInsertImportOnPasteTest: use test framework to create correct file structure for java files 2014-02-11 17:17:33 +04:00
Pavel V. Talanov e3ae7afac3 Add validation for binding between java classes and corresponding package fragments 2014-02-11 17:17:06 +04:00
Pavel V. Talanov e4a0221abc Remove PackageFragmentDescriptor#getProvider method
PackageFragmentProvider should be hidden from the client of PackageFramentDescriptor
2014-02-11 17:17:05 +04:00
Pavel V. Talanov cd6a71ef81 Refactor JDR: add explicit binding between java classes and packages for their statics
Get rid of Kind in JavaPackageFragmentDescriptor and create subclass which exposes additional function
Add method in JavaClassDescriptor to get correponding package fragment
Remove JavaDescriptorResolver from context
2014-02-11 17:17:04 +04:00
Pavel V. Talanov 00a5e7ab15 Refactor JDR: remove some of the usages of JavaDescriptorResolver class 2014-02-11 17:17:03 +04:00
Pavel V. Talanov 16a2a5cd62 Refactor JDR: minor extract function in LazyJavaPackageFragmentProvider 2014-02-11 17:17:02 +04:00
Pavel V. Talanov 2fe2a50b14 Refactor JDR: use JavaResolverCache in LazyJavaPackageFragmentProvider directly
Remove LazyJavaClassResolverWithCache
This actually can affect behaviour because JavaResolverCache has slightly different logic (uses CLASS key in BindingContext as opposed to FQNAME_TO_CLASS_DESCRIPTOR)
2014-02-11 17:17:01 +04:00
Pavel V. Talanov 18d088cb71 Refactor JDR: create LazyJavaPackageFragmentProvider in injector 2014-02-11 17:17:00 +04:00
Pavel V. Talanov 737f538ea7 Minor: use orEmpty() instead of ?: listOf() in LazyJavaPackageFragmentProvider 2014-02-11 17:16:59 +04:00
Pavel V. Talanov 4153182fd2 Refactor JDR: minor, extract class 2014-02-11 17:16:58 +04:00
Zalim Bashorov 37154e42d2 JS backend: fixed smartcast when a call have implicit this or receiver. 2014-02-11 13:50:16 +04:00
Alexey Sedunov 40eaf49a8c Support find usages for declarations with multiple overridden Java methods (e.g. J -> J -> K) 2014-02-10 18:57:56 +04:00
Aleksei Sedunov 0e451bd35e Add assertion message 2014-02-10 12:25:53 +04:00
Alexey Sedunov d549257bfc Allow to find usages of Java class via references to its constructor #KT-4521 Fixed 2014-02-10 12:25:52 +04:00
Pradyoth Kukkapalli 8b6bd8a184 New Intention Action: Replace an infix function call with a dot qualified method call. 2014-02-09 09:05:19 -08:00
Tuomas Tynkkynen 64f67f30f0 Prevent smartSelectExpression from breaking up 'this@outerClass'
The previous commit made JetThisExpression not implement
JetStatementExpression. This had the side effect that
smartSelectExpression over a label-qualified this expression
(e.g 'this@outerClass') would now also list a plain 'this'
as a potential expression. Restore the old behaviour by adding an
explicit check for JetThisExpression.
2014-02-09 17:22:30 +04:00
Tuomas Tynkkynen 9ce40cd17b Fix unnecessary parenthesis around 'this' in refactorings
Operator priority calculation for 'this' expressions was incorrect in
JetPsiUtil.getPriority(): it would return a very low value for
a JetThisExpression, causing the IDE to report that parenthesis
are necessary in an expression like '(this)[1]'.

Fix this by making JetThisExpression not implement
JetStatementExpression by removing the implements clause from
JetLabelQualifiedInstanceExpression and adding it to all other
subclasses of JetLabelQualifiedInstanceExpression.

Fixes KT-4513.
2014-02-09 17:22:27 +04:00
Tuomas Tynkkynen 85c46019d3 Add test suite for smart expression selector
Add test suite for smart expression selector (the small expression list
popup in e.g. Extract Variable.)

The test file format is similar to that in JetNameSuggesterTest: a .kt
file with the usual <caret> marker specifying the place where the smart
selector will be run. Then, the last comment in the file should contain
the expected outcome.
2014-02-09 17:22:24 +04:00
Tuomas Tynkkynen 815ca2fe57 Separate GUI logic from smartSelectExpression
Previously smartSelectExpression did both the determination of suitable
expressions and displaying the GUI. Separate the actual logic into a new
method, getSmartSelectSuggestions so that smart selection can be tested
in the future.
2014-02-09 17:22:19 +04:00
Tuomas Tynkkynen 7429cc8819 Make JetTestUtils.getLastCommentInFile() to allow trailing newline
Many editors add a trailing newline when saving. Allow them in
getLastCommentInFile.
2014-02-09 17:22:10 +04:00
Tuomas Tynkkynen 420a08167b Extract JetTestUtils.getLastCommentInFile()
JetNameSuggesterTest contains useful code for getting the last comment
of a file. Extract it to JetTestUtils.getLastCommentInFile() so other
tests can use it as well.
2014-02-09 17:22:07 +04:00
Alexander Udalov cb2733a0ae Fix built-ins serializer to work with any packages
Make it serialize data for all packages found in sources and not only
KotlinBuiltIns.FQ_NAME, i.e. "jet". This is required to migrate built-ins from
package "jet" to "kotlin"
2014-02-09 04:17:35 +04:00
Andrey Breslav 9229062926 Do not annotate bare type parameters as @Nullable
This is to account for the case of, say

     class Function<R> { fun invoke(): R }

it would be a shame to put @Nullable on the return type of the function, and force all callers to check for null,
so we put no annotations
2014-02-07 16:41:12 -08:00
Mikhael Bogdanov e0ca1abe4b KT-3706 Inconsistent stack height in try catch finally in function
KT-4134 Incorrect bytecode is generated for

 #KT-3706 Fixed
 #KT-4134 Fixed
2014-02-07 13:45:22 +04:00
Nikolay Krasko 7b07b748cb Refactoring: remove unused method 2014-02-06 15:52:04 +04:00
Nikolay Krasko 1d884912a0 Minor: call overloaded constructor 2014-02-06 15:52:04 +04:00
Nikolay Krasko 10dec22feb Minor: Add 'memoized' to dictionary 2014-02-06 15:52:03 +04:00
Nikolay Krasko 876040cb53 Minor: fix warnings and formatting 2014-02-06 15:52:03 +04:00
Nikolay Krasko 3b3f9f7022 Rewrite KotlinImportListRenderer to Java to make it compilable with both JDK 1.6 and JDK 1.7
In JDK 1.7 JList has generic parameter
2014-02-06 15:52:02 +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
Erokhin Stanislav a7eb143cff JS backend: Fix aliasing in CallTranslator for cases noReceiver & receiverObject & add hack for thisObject 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 5d4cb1e065 JS backend: Fix safe call side effects 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 7f8c17d6af JS backend: drop CallType 2014-02-06 14:01:11 +04:00
Erokhin Stanislav e9b1ae7cb1 JS backend: Move CallTranslator to new package & create CallTranslator object 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 47ed126aa4 JS backend: Move CallInfo extension to separate file. 2014-02-06 14:01:11 +04:00
Erokhin Stanislav a4436806f7 JS backend: cosmetic changes & class for cases remake to object 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 97955776c4 JS backend: simplify DelegatePropertyAccessIntrinsic 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 5a343841d9 JS backend: add debug info for CallInfo 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 4d287c96d6 JS backend: In CallInfo: receiver1, receiver2 -> ExplicitReceivers. Drop CallInfo.nullableReceiverForSafeCall, move constructSafeCall to extension for CallInfo 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 257d13e90b JS backend: cosmetic changes & remake fakeCall 2014-02-06 14:01:11 +04:00
Erokhin Stanislav f268f69cbf JS backend: Fix cached array access (KT-740-2) 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 5c9bda0f6e JS backend: Migrate type of alias from JsName to JsExpression 2014-02-06 14:01:11 +04:00
Erokhin Stanislav ae6fdcc673 JS backend: Fix cache receiver in VariableAccess (KT-740-1) 2014-02-06 14:01:11 +04:00