Commit Graph

397 Commits

Author SHA1 Message Date
Nikolay Krasko 67f353903e Show lint diagnostics even if there're errors in the file (KT-12022)
It also affects working with KotlinChangeLocalityDetector. Right after error is fixed in local context file is still reported as having errors and diagnostics are not counted.

 #KT-12022 Fixed
2016-09-02 13:41:24 +03:00
Yan Zhulanow 1a94e2202b Minor: Fix compilation error 2016-08-29 18:30:27 +03:00
Yan Zhulanow 7810678389 Kapt: Fix type arguments in JeDeclaredType. In case of type variable, JeTypeVariableType should be returned
(cherry picked from commit ed34ec0)
2016-08-29 16:31:16 +03:00
Yan Zhulanow ebcc762ae9 Kapt: JeTypeElement getInterfaces() and getSuperClass() should provide reference type mirrors
(cherry picked from commit 5f50ab6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow cd44540965 Kapt: Support String[] in annotation proxy
(cherry picked from commit 5e9eab9)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 0042a59fb6 Kapt: Use also the compile classpath, not only apt classpath
(cherry picked from commit d810119)
2016-08-29 16:31:16 +03:00
Yan Zhulanow a8b577cd09 Kapt: Support nested annotations property.
Also do not rely on Java class comparison, check against qualified names.
(cherry picked from commit 7610945)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 49bd303988 Kapt: Fix broken assertion
(cherry picked from commit 36b0b52)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 9960e7f7cd Kapt: Get rid of the 'compiler-tests' dependency in 'plugins-tests'
(cherry picked from commit bb370f1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 46f9e02c06 Kapt: Fix type arguments order for JeDeclaredType, should not use substitutor
(cherry picked from commit a9c77e1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow d07e6c752b Kapt: Support default packages in Filer
(cherry picked from commit 3ced8a6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 8c4fb0a709 Kapt: Support inherited annotations
(cherry picked from commit 02a3e6b)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 407af3a0e5 Kapt: Gradle plugin for the new kapt
(cherry picked from commit f4fc8f1)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 399059729d Kapt: verbose output mode
(cherry picked from commit e6067d5)
2016-08-29 16:31:16 +03:00
Yan Zhulanow f5d58d9944 Kapt: Provide toString() implementations for no-types
(cherry picked from commit df9c825)
2016-08-29 16:31:16 +03:00
Yan Zhulanow badf8dbc53 Kapt: Fixes in KotlinElements:
1. 'overrides()' when 'type' extends containing(overrider) and implements containing(overridden). According to documentation, In this case the function should return true.
2. Handle both kotlin.Deprecated and java.lang.Deprecated for Kotlin in 'isDeprecated'.
3. Fix 'isFunctionalInterface'.
(cherry picked from commit a14d7ce)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 462c7d91d2 Kapt: Calculate constant values in the similar way.
Always use originalElement in JeAnnotationValue factory.
(cherry picked from commit 0ff9584)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 4710fab49f Kapt: Use the base types in KotlinProcessingEnvironment
(cherry picked from commit ed8e2e4)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 927280f7ce Kapt: add some JeElement tests
(cherry picked from commit 948a4b6)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 0fc92c784b Kapt: add JeElementRenderer
(cherry picked from commit 3eecf78)
2016-08-29 16:31:16 +03:00
Yan Zhulanow cd09f2bcb8 Kapt: Minor, refactor JeAnnotationMirror:getElementValues()
(cherry picked from commit 649b938)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 23b343bb03 Kapt: annotation-processing is not dependent on 'cli' module anymore
(cherry picked from commit 4591f13)
2016-08-29 16:31:16 +03:00
Yan Zhulanow f61367df28 Kapt: Fixes on review
(cherry picked from commit be31262)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 5b8e6abdeb Kapt: Support Java source root processing.
Support resource file writing.
(cherry picked from commit 7a06a91)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 9d2144f221 Kapt: Support "*" in supported annotation qualified names (all annotations)
(cherry picked from commit 27ec053)
2016-08-29 16:31:16 +03:00
Yan Zhulanow a73cf65840 Kapt: Check DEFAULT modifier only in Java 8
(cherry picked from commit 71c8dfb)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 53921c3f74 Kapt: Drop custom annotation stub factory, implement it with AnnotationParser in sun.reflect as done in Javac
(cherry picked from commit 82dcbf3)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 6eb3d7e002 Kapt: Refactor kapt type wrappers. Now every ordinary (not NoType) type has a backed PsiType so it's easy to call utility functions from IntelliJ.
(cherry picked from commit 0a684aa)
2016-08-29 16:31:16 +03:00
Yan Zhulanow 0181dd000d Kapt: Implement Annotation Processing plugin in Kotlin (KT-13499)
(cherry picked from commit 32c461a)
2016-08-29 16:31:16 +03:00
Yan Zhulanow cc12a6c228 Kapt: Add APT wrappers for PSI elements
(cherry picked from commit 1214513)
2016-08-29 16:31:16 +03:00
Mikhail Glukhikh 692623cb55 Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X) 2016-07-27 16:24:18 +03:00
Nikolay Krasko 2783c9bde2 Fix AbstractAnnotationProcessorBoxTest on Windows: load text without \r 2016-07-07 02:51:25 +03:00
Alexander Udalov 6ba32ed624 Refactor CallChecker and subclasses
Encapsulate everything that is needed in checkers into CallCheckerContext. Pass
an instance of this context instead of BasicCallResolutionContext to checkers.

Also pass an instance of the element to report errors on: this is useful
because before this, every checker had its own way of determining where should
the error be reported on. Some of them, for example, were not doing anything if
Call#calleeExpression returned null, which is wrong, see operatorCall.kt

 #KT-12875 Open
2016-06-29 19:20:00 +03:00
Yan Zhulanow bb083a51cc KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin file.
newOutputStreamSupplier() is deprecated and was deleted in Guava 18.
2016-06-29 17:52:25 +03:00
Michael Bogdanov 3b419e8ba3 Fix for KT-11964: No TABLESWITCH in when on enum bytecode if enum constant is imported
#KT-11964 Fixed
2016-06-29 09:32:45 +03:00
Mikhael Bogdanov db5d9940df Added 'isInline' implementation to property accessor descriptors 2016-06-24 17:05:48 +03:00
Yan Zhulanow 6e6c9682ec Fix KT-12173 (Kotlin Lint False Positive for "Toast created but not shown" inside SAM adapter).
(cherry picked from commit 4940d3b)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 1720f8b4ff KT-12681 (Lint: run from main menu / Analyze: Kotlin inspections reports only java source)
Cause we've copied Lint diagnostics to the Kotlin project, there's no harm in making them Kotlin-only.
(cherry picked from commit 7105648)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 8f75ababde KT-12674 "Calling new methods on older versions" errors for inlined constants
Inlined constants from Java should not be detected.
(cherry picked from commit b34ee4e)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 206e439595 KT-12023 Kotlin Lint: Cast doesn't trigger minSdk error
Check Kotlin as/is types.
(cherry picked from commit c0db8e0)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 1de05b965e KT-12015 (Kotlin Lint False Positive for Bundle.getInt())
Java approach is not sufficient here, in Kotlin receivers can be implicit.
Use Kotlin extension/dispatch receivers to figure out the receiver type for our method call.
(cherry picked from commit cdedf1d)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 530ab42de6 Android Extensions: Fix KT-10969 (NullPointerException when finding view in Fragment if getView() is null)
(cherry picked from commit 80f5852)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 2cd0e9c8d8 Fix EA-80764. Do not try to get the resource manager for the disposed module
(cherry picked from commit c3bd243)
(cherry picked from commit cddcf02)
2016-06-24 15:10:19 +03:00
Yan Zhulanow e0243fd568 Fix EA-82394. PsiType.getClassName() can return null. Return "<anonymous type>" in that case.
(cherry picked from commit 8be1335)
(cherry picked from commit 5101596)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 1a0acf3208 Fix EA-82166. NPE. loadModel() can return null, and it's a bad idea to call methods on a null pointer.
(cherry picked from commit cf033d0)
(cherry picked from commit 37dc0ae)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 001d5397c5 Fix EA-82449. Do not run Lint diagnostics if the project is already disposed
(cherry picked from commit 98b2899)
(cherry picked from commit 2179ee8)
2016-06-24 15:10:19 +03:00
Yan Zhulanow c5e0f992e5 KT-12387 Fix Performance problem with Lint in IDE
Call checkCanceled() before running Lint diagnostics (UastScanner)
(cherry picked from commit c6e328a)
(cherry picked from commit 696475e)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 4ee19cce93 Fix #KT-12047 (Kotlin Lint: "Missing @JavascriptInterface on methods" does not report anything)
(cherry picked from commit 61e8e01)
(cherry picked from commit dbc54e2)
2016-06-24 15:10:19 +03:00
Yan Zhulanow d1447faf2b Fix #KT-12015 (Kotlin Lint False Positive for Bundle.getInt()).
Android firstly checks API version against the function call receiver type, so we should do the same to be consistent.
(cherry picked from commit c3d01ec)
(cherry picked from commit 5c78acc)
2016-06-24 15:10:19 +03:00
Denis Zharkov 1b82e43d76 Add LanguageFeatureSettings parameter to single method in checkers interfaces
This parameter will be used further for target-dependent checks

Also introduce SimpleDeclarationChecker/SimpleCallChecker sub-interfaces (more weak ones)
Implementing them instead of base checkers is more convenient in most cases
2016-06-09 17:57:15 +03:00