Commit Graph

14115 Commits

Author SHA1 Message Date
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
Erokhin Stanislav 2f1b44ed9e JS backend: Dropped old CallTranslator 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 2d50858289 JS backend: Use new CallTranslator for build main and test calls 2014-02-06 14:01:11 +04:00
Erokhin Stanislav 39f3a6ec4c JS backend: Migrate FunctionIntrinsic to CallInfo 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 4e9187779d JS backend: Optimized CallInfo classes structure 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 7a0f359aa0 JS backend: Use new CallTranslator for ArrayAccessTranslator 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 46a045f969 JS backend: Fix Delegate property - use new CallTranslator 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 42437eb755 JS backend: fix native spread call 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 4bffff43aa JS backend: Use newCallTranslator for several Translators 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 75dd459bdf JS backend: Fix tracked used descriptors 2014-02-06 14:01:10 +04:00
Erokhin Stanislav 4617e730d6 JS backend: Use new call translator in CallExpressionTranslator and move invoke intrinsic to FunctionCallCases 2014-02-06 14:01:10 +04:00
Erokhin Stanislav a1edc0368a JS backend: simplify canBePropertyAccess method 2014-02-06 14:01:10 +04:00