Commit Graph

4359 Commits

Author SHA1 Message Date
Nikolay Krasko f14f2c19a8 Fix goto class action in Idea 13.1 2014-02-18 14:39:19 +04:00
Nikolay Krasko bd859efb39 Generator for goto symbols test 2014-02-17 22:12:09 +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
Nikolay Krasko 86767c2349 Remove write action for paste for better idea actual behaviour emulation 2014-02-17 10:45:48 +04:00
Natalia Ukhorskaya 9f3b73986a Update to IDEA 13.1 (134.1007) 2014-02-17 10:45:48 +04:00
Pavel V. Talanov 6c77ea91c5 Generate Injectors: simplify and remove redundancy 2014-02-14 16:47:21 +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
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 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
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 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
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
Andrey Breslav 8dc9aecbf8 DescriptorSearchRule removed 2014-02-05 18:12:01 +04:00
Andrey Breslav e119ca27ca AnnotationLoadingUtil created. Relevant code/constants moved there 2014-02-05 18:11:51 +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
Alexey Sedunov 7e1c9194f1 Implement navigation to references from Call Hierarchy view
#KT-4518 Fixed
2014-02-05 16:28:16 +04:00
Pavel V. Talanov c6c1389144 Imports on copy/paste UI: do not show misleading icon in dialog 2014-02-05 12:42:19 +04:00
Pavel V. Talanov ccaf87bc17 Imports on copy/paste: Check whether import is needed before showing the user
Minor: rename ImportInsertHelper.doNeedImport -> needImport
2014-02-05 11:43:05 +04:00
Pavel V. Talanov 61153c87e0 Insert imports on copy/paste
Introduce KotlinCopyPasteReferenceProcessor
2014-02-04 20:19:52 +04:00
Pavel V. Talanov 2f55959578 Refactor: rewrite JetReferenceContributor to kotlin
Add additional utilities to track what psi elements are capable of holding references
2014-02-04 17:09:45 +04:00
Pavel V. Talanov 41f9dcba91 Refactor: unite two hierarchies or reference, use common code across all references
Jet*Reference#getTargetDescriptors() no longer returns nullable value (convention is dropped)
Use ResolvedCall#getCandidateDescriptor() instead of ResolvedCall#getResultingDescriptor() because unsubstituted descriptors are expected
Add JetReference#resolveMap() function
2014-02-04 17:09:44 +04:00
Pavel V. Talanov f06cef684e Refactor: introduce JetReference, rename: JetPsiReference -> AbstractJetReference
Add resolveToDescriptors() to JetReference trait
Rewrite JetPsiReference to kotlin
2014-02-04 17:09:43 +04:00
Pavel V. Talanov cdc6e1b5ba Refactor: move utilities to a separate file 2014-02-04 17:09:42 +04:00
Pavel V. Talanov 8e19ba9851 Fix JetSimpleNameExpression#getReceiver
Correct behaviour for unary, binary expressions and type references
Add instanceof checks in TipsManager so it's clear it only takes care of certain types of JetSimpleNameExpression
2014-02-04 17:09:41 +04:00
Pavel V. Talanov 11c1e29287 Copy paste: annotations for IDEA classes and corresponding changes in ConvertJavaCopyPastePostProcessor 2014-02-04 17:09:39 +04:00
Pavel V. Talanov 7daf7374f8 Minor: JavaCopyPastePostProcessor -> ConvertJavaCopyPastePostProcessor for clarity 2014-02-04 17:09:38 +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
Andrey Breslav 30f49f3c9a Invalidate per-file cache on exceptions 2014-02-04 15:24:27 +04:00
Andrey Breslav e60bd514fa StorageManager&ExceptionTracker delivered where needed
- GlobalContext introduced to group the two
- Caches track exceptions
2014-02-04 15:24:27 +04:00
Andrey Breslav 2da51a49dc Invalidate ResolveElementCache on exceptions from storage manager 2014-02-04 15:23:15 +04:00
Alexey Sedunov 950e8d521b Remove unjustified assertion 2014-02-04 14:42:39 +04:00
Alexey Sedunov 2ea1a89e4c Specify type explicitly: Add tests 2014-02-04 14:42:37 +04:00