Commit Graph

30915 Commits

Author SHA1 Message Date
Yan Zhulanow 4ef6016ee8 Lint: Rename all Lint inspections to KLint to provide unique short names 2016-04-08 15:39:58 +03:00
Yan Zhulanow f4422b3b19 Kotlin Uast: Support type parameters on functions 2016-04-08 15:39:58 +03:00
Yan Zhulanow 668172d68e Lint, Minor: Group lint-related modules 2016-04-08 15:39:58 +03:00
Yan Zhulanow 4df9e9261e Lint: Rewrite Lint diagnostics using Uast. 2016-04-08 15:39:58 +03:00
Yan Zhulanow 126cc778e4 Lint: copy diagnostics from IDEA (br143) 2016-04-08 15:39:58 +03:00
Yan Zhulanow 92d2e7a0a9 Kotlin Uast: Initial implementation 2016-04-08 15:39:58 +03:00
Yan Zhulanow a13a1e1e4a Java Uast: Initial implementation 2016-04-08 15:39:58 +03:00
Yan Zhulanow 16de31aebe Uast: Unified AST (Kotlin, Java) interfaces set.
Goal: support Android Lint diagnostics in Kotlin by switching Lint scanners from the Java Lombok AST to the abstract AST (uast) with Java and Kotlin PsiElement-backed implementations.
2016-04-08 15:39:58 +03:00
Dmitry Petrov aca7050656 KT-11499 Normalize stacks on return from an inline function when the function is inlined at call site. 2016-04-08 14:52:55 +03:00
Michael Bogdanov a6044c81ff Write proper start label for loop parameter 2016-04-08 14:32:51 +03:00
Zalim Bashorov 441a442f34 Minor: update testdata 2016-04-08 13:45:37 +03:00
Zalim Bashorov f5ca949f2c IC: improve logging in tests and fix DataContainerVersionChangedTestGenerated#testWithError
Test logging improvements:
  * print which chunk building in the round for multimodule projects
  * print actions after cache changed
2016-04-08 13:45:37 +03:00
Kirill Rakhman da5c963a43 Fix let implement quickfix label for object expressions
Fixes #KT-11782
2016-04-08 10:37:25 +03:00
Valentin Kipyatkov cdab9d5103 KT-11710 "Replace 'if' with elvis operator": incorrect code generated for 'if' expression
#KT-11710 Fixed
2016-04-07 18:50:32 +03:00
Valentin Kipyatkov 6a65442095 KT-11811 There is no intention "Make protected" for a val declared in parameters of constructor
#KT-11811 Fixed
2016-04-07 18:50:32 +03:00
Valentin Kipyatkov a9fe999e0e Fixed StackOverflow in CanBeValInspection.kt 2016-04-07 18:50:31 +03:00
Valentin Kipyatkov 22a4bbe1aa KT-11805 Invert if-condition intention breaks code in case of end of line comment
#KT-11805 Fixed
2016-04-07 18:50:30 +03:00
Valentin Kipyatkov b258af5288 KT-11724 False suggestion to replace with compound assignment
#KT-11724 Fixed
2016-04-07 18:50:30 +03:00
Alexander Udalov 7c90fbe4de Compute return type for property getters more safely
Do not call `isError()` on property's type right after creation of
PropertyGetterDescriptor because the property has no getter yet (it's created
but not yet stored to the property, that happens a bit later), and `isError()`
leads to computation of the delegate type, which for delegated properties
performs some complex resolution (see `VariableTypeResolver#process`) which
relies on the fact that the property already has a getter.

Since the purpose of the original change (883e2e4d) was to support a quick fix
which would add the type to a property in an expression like "val x get() =
...", check the type (or initializer) presence in the PSI instead, this is
safer and is still suitable for the quick fix.

Also fix arguments to "wrong getter type" diagnostic: previously something
useless like "expected Int, actual Int" was reported

 #KT-11809 Fixed
2016-04-07 15:35:58 +03:00
Dmitry Petrov f1b061d662 Optimize coercion to Unit.
POP operations are backward-propagated.

Operation can't be transformed if its result is moved within stack
(by DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, or SWAP).

Unnecessary operations are replaced with NOPs (for debugger).
Unnecessary NOPs are removed.

KT-9922 Suboptimal generation for simple safe call with unused return value
KT-11116 Optimize methods returning Unit
2016-04-07 11:40:58 +03:00
Alexander Udalov c4a568efff Minor, add test cases for obsolete protected-related issues 2016-04-07 00:07:11 +03:00
Alexander Udalov 9eec5daf51 Minor, fix a few typos in NameResolution.adoc 2016-04-06 23:21:13 +03:00
Nikolay Krasko 9e88db7e58 Fix bad test modification 2016-04-06 21:46:02 +03:00
Nikolay Krasko 46a1028494 Temporary ad-hock jps-tests enable with testdata modification 2016-04-06 21:46:00 +03:00
Alexey Andreev 9fd19dd7fd KT-7819 Add test to ensure that lambda capturing this literal can be inlined 2016-04-06 16:16:56 +03:00
Alexey Andreev 05887f45f7 KT-7819 Implement non-local returns 2016-04-06 16:16:55 +03:00
Alexey Andreev a6e1bd1d89 KT-7819 Borrow tests for non-local returns from JVM backend 2016-04-06 16:16:55 +03:00
Pavel V. Talanov f7db1f934c IDELightClassGenerationSupport#getContextForClassOrObject: do not rely on resolution facade being unchanged
ResolutionFacade should only recompute its underlying structures in case of psi change (which is ok) or some exception, but relying on it being unchanged has led to numerous exceptions in backend when building light classes (EA-70985, EA-80756)
Changing this code may not be the solution but it can possibly move failures to other parts of the system, where they can be easier diagnosed
2016-04-06 16:09:17 +03:00
Nikolay Krasko 74091a12cf Update since to IDEA 2016.1 2016-04-06 14:20:55 +03:00
Nikolay Krasko 4b22685dc5 Change asm library path 2016-04-06 14:20:53 +03:00
Nikolay Krasko f648fddb84 Create repository for openapi.jar and idea_rt.jar on teamcity to avoid full idea download 2016-04-06 14:20:51 +03:00
Stanislav Erokhin 187c0d4dd0 Refactoring. Change Key for TAIL_RECURSION_CALL from ResolvedCall to Call. 2016-04-06 13:55:36 +03:00
Stanislav Erokhin 516d4df834 Refactoring. Remove isSafeCall from ResolvedCall. 2016-04-06 13:55:35 +03:00
Stanislav Erokhin bf08341ee4 Refactoring. Change type of ResolvedCall#extensionReceiver from Receiver to ReceiverValue 2016-04-06 13:55:35 +03:00
Stanislav Erokhin 63a2d8a416 Refactoring. Remove receiverArgument from ResolutionCandidate. 2016-04-06 13:55:34 +03:00
Valentin Kipyatkov 602de317d6 Minor improvement in convert to string template inspection: no highlighting when the expression is split onto multiple lines 2016-04-06 10:45:28 +03:00
Mikhail Glukhikh c32881e41b Fix: test renamed 2016-04-06 10:39:50 +03:00
Dmitry Petrov 8377eb4613 KT-11777: no parts for '<root>' 2016-04-06 10:01:01 +03:00
Nikolay Krasko d8a2cab708 Bad merge in AbstactIntentionTest that made tests useless 2016-04-05 22:12:31 +03:00
Dmitry Jemerov 01b0cfb552 don't parse lines starting with @ as KDoc tags if they're inside a Markdown code fence
#KT-11789 Fixed
2016-04-05 19:48:51 +02:00
Stanislav Erokhin ad002c4f09 Minor. Fix file name & regenerate tests. 2016-04-05 20:45:27 +03:00
Kirill Rakhman a895a3e3de ConvertToForEachFunctionCallIntention: convert 'continue' to 'return@forEach'
Fixed #KT-11764
2016-04-05 18:48:02 +02:00
Valentin Kipyatkov d5182ffe16 Minor change on code review 2016-04-05 19:33:08 +03:00
Valentin Kipyatkov e7fa0bec9a Ctrl-Q and other PsiElement-based features to work for synthetic java properties
#KT-11676 Fixed
2016-04-05 19:33:07 +03:00
Valentin Kipyatkov 2aba11abb8 Added test for generic operator 2016-04-05 19:33:07 +03:00
Valentin Kipyatkov 3aff4d4c17 Smart completion to use super type for override if no explicit type specified 2016-04-05 19:33:06 +03:00
Valentin Kipyatkov 7af67da4ac Better smart completion after "by" for override property with no explicit type specified 2016-04-05 19:33:06 +03:00
Valentin Kipyatkov f85de3aac7 Added better way to construct FuzzyType 2016-04-05 19:33:05 +03:00
Valentin Kipyatkov e18fb20d5a Completion after "by" for top-level properties 2016-04-05 19:33:05 +03:00
Valentin Kipyatkov fe9d6aca9a More correct test data 2016-04-05 19:33:04 +03:00