Commit Graph

1601 Commits

Author SHA1 Message Date
Alexey Sedunov d2e6aa2aa5 Allow to shorten class member references 2014-02-27 17:00:24 +04:00
Tuomas Tynkkynen 7a2321460d Prevent expression selector from selecting just a label
Previously, extract variable could act on e.g. 'break@outerLoop' and
extract the label, leading into nonsensical 'val x = @outerLoop'.
Prevent JetRefactoringUtil.selectExpression from returning label
expressions to fix this.

 #KT-4515 Fixed
2014-02-24 22:40:14 +04:00
Tuomas Tynkkynen 998d2c5ec8 Add tests for JetRefactoringUtil.selectExpression
Add tests for JetRefactoringUtil.selectExpression, which is invoked by
e.g. extract variable when some text is selected.

Test cases under idea/testData/expressionSelection/ should contain
Kotlin files with the usual <selection> tags, with the expected result
of selectExpression in the last comment of the file.
2014-02-24 22:40:05 +04:00
Tal Man 89779b5013 2 Intentions for string templates:
the first removes curly braces from a simple name variable, ${x} -> $x
and the second does the opposite $x -> ${x}
2014-02-24 21:20:40 +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 62e8883138 Test for KT-365 Support renaming packages
#KT-365 Obsolete
2014-02-21 22:12:53 +04:00
Nikolay Krasko 7e4bb1d467 Test that lazy resolve is able to do propagation in Kotlin-Java-Kotlin hierarchy
Patch by Evgeny Gerashchenko
2014-02-20 16:31:25 +04:00
Nikolay Krasko f14ff9405d Force resolve descriptor type 2014-02-20 16:31:24 +04:00
Nikolay Krasko ac4fe93774 Add ability to filter out some particular classes from generator 2014-02-20 16:17:38 +04:00
Nikolay Krasko 558fca5eab Check reference to Java root class from library 2014-02-20 16:08:04 +04:00
Nikolay Krasko 9a8a8364dd KT-4344 "Overridden method parameters are not annotated" warnings from Java
#KT-4344 Fixed
2014-02-18 14:49:34 +04:00
Nikolay Krasko f14f2c19a8 Fix goto class action in Idea 13.1 2014-02-18 14:39:19 +04:00
max-kammerer 1c7bb85193 Merge pull request #372 from pk382/replace-dot-qualified-call-intention
New Intention Action: Replace a dot-qualified function call with an infix function call.
2014-02-17 13:20:02 +03:00
Natalia Ukhorskaya 9f3b73986a Update to IDEA 13.1 (134.1007) 2014-02-17 10:45:48 +04:00
Pradyoth Kukkapalli 44234c7c0a New Intention Action: Replace a dot-qualified function call with an infix function call. 2014-02-14 00:18:09 -05:00
Svetlana Isakova 4c1c9f8407 do not record smart cast to not nullable type separately 2014-02-12 12:48:14 +04:00
Svetlana Isakova 9063b3803e record smartcast to the most specific type 2014-02-12 12:48:14 +04:00
Svetlana Isakova 791fa22abb KT-4405 Control-flow analysis is not performed for some local declarations #KT-4405 Fixed 2014-02-12 12:48:13 +04:00
Svetlana Isakova 9ed57a5767 removed AutoCastReceiver
check subtype for receiver by AutoCastUtils.isSubTypeByAutoCast directly
 #KT-4403 Fixed
 #KT-4415 Fixed
2014-02-12 12:48:10 +04:00
Svetlana Isakova 5ef320173c generate pseudocode for functions in local classes
#KT-4405 In progress
 #KT-3501 Fixed
2014-02-11 21:07:10 +04:00
Svetlana Isakova 64e13114e2 store unsubstituted descriptor as REFERENCE_TARGET 2014-02-11 21:07:09 +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
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
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
Pavel V. Talanov 61153c87e0 Insert imports on copy/paste
Introduce KotlinCopyPasteReferenceProcessor
2014-02-04 20:19:52 +04:00
Pavel V. Talanov 4638806d11 Shorten references: Do not lookup packages when searching for conflicting declarations
Minor: use JetTreeVisitor
2014-02-04 17:09:37 +04:00
Alexey Sedunov 2ea1a89e4c Specify type explicitly: Add tests 2014-02-04 14:42:37 +04:00
Nikolay Krasko 5f71511788 Test for "KT-3769 Find usages gives no result for overrides"
#KT-3769 Obsolete
2014-02-04 12:31:36 +04:00
Alexey Sedunov fbb1c2921b Safe Delete: Add support of default and by-name parameters 2014-02-03 13:47:04 +04:00
Alexey Sedunov e52da4fce0 Support JetParameter in element description provider 2014-02-03 13:47:01 +04:00
Alexey Sedunov 0e9875aec3 Support moving into "else" branch of conditional expression
#KT-3877 Fixed
2014-01-29 15:58:53 +04:00
Alexey Sedunov 609154bab3 Generalize movable element constraint
#KT-4468 Fixed
 #KT-4376 Fixed
2014-01-29 15:58:51 +04:00
Alexey Sedunov 8a0867a9c3 Enable Type Hierarchy for Kotlin classes referenced by non-Kotlin code #KT-4414 Fixed 2014-01-29 15:58:51 +04:00
Natalia Ukhorskaya fd3f852a93 Annotation parameter must be constant on vararg and array arguments 2014-01-28 18:21:43 +04:00
Natalia Ukhorskaya a71e062504 Insert proper default value when overriding property of type float, double, char 2014-01-28 18:21:37 +04:00
Zalim Bashorov d032b5589c Frontend: fixed resolve annotation parameters on properties, accessors, accessor parameters, function parameters when not need complete analysis. 2014-01-27 15:34:55 +04:00
Alexey Sedunov 624ac55415 Add more "Safe Delete" tests for value parameters 2014-01-24 15:24:35 +04:00
Alexey Sedunov 001d95f4b8 Forbid safe delete action if target element is a property setter parameter 2014-01-24 15:24:32 +04:00
Alexey Sedunov 83c9c49125 Add Safe Delete tests for extension functions and properties 2014-01-24 15:24:30 +04:00
Alexey Sedunov fffae7b6a4 Forbid "safe delete" for anonymous objects 2014-01-24 13:10:23 +04:00
Alexey Sedunov 5cfb07072c Reuse Java safe delete for Kotlin classes and objects 2014-01-24 13:10:22 +04:00
Alexey Sedunov d432c10251 Reuse Java safe delete for non-local functions in Kotlin 2014-01-24 13:10:20 +04:00
Alexey Sedunov e70af5d372 Improvements in element description provider (proper treatment of light classes/methods, support of simple vs qualified names) 2014-01-24 13:10:19 +04:00