Commit Graph

634 Commits

Author SHA1 Message Date
Alexander Udalov 861d9a1620 Use null instead of CompilerMessageLocation.NO_LOCATION in MessageCollector 2017-04-11 12:08:31 +03:00
Yan Zhulanow 3ee65ac499 Kapt: Support specifying javac options (KT-17245) 2017-04-10 22:48:17 +03:00
Vyacheslav Gerasimov 107879a78a Implement getTypeElement for UastKotlinPsiVariable
#KT-16849 Fixed
2017-04-10 12:40:33 +03:00
Vyacheslav Gerasimov 1d134ffc72 Register Android api quickfixes for inlined api inspection
#KT-14857 Fixed
2017-04-10 12:39:40 +03:00
Pavel V. Talanov 4f701285b1 Light class builder: do not generate methods delegating to DefaultImpls in kotlin classes
Class APIs from java point of view stays the same so we can avoid generating those methods
Otherwise we have to calculate all supertypes when getMethods() is called,
    which imposes severe performance penalties
We have to pretend these methods are not 'abstract' (also we consider them 'default' for safety)
    so java highlighting does not report "class should be abstract" for all inheritors
We have to manually report "class should be abstract" on some of the java inheritors,
    specifically those that are implementing interfaces directly
	    as opposed to extending kotlin classes implementing those interfaces
2017-04-09 15:09:01 +03:00
Ilya Chernikov 30048f8f49 Fix CRLF handling in source-sections plugin 2017-04-06 10:02:49 +02:00
Ilya Chernikov 88652154c9 Port compiler to the script-runtime with script base classes 2017-04-06 10:02:45 +02:00
Yan Zhulanow 21da11fe18 Fix 'kotlin-spring' and 'kotlin-noarg' Gradle plugin importing (KT-17049)
Allopen and Noarg plugins now use 'presets' that should be handled in the Gradle importer as well.
2017-04-05 18:13:14 +03:00
Mikhail Glukhikh 7a53b2f4c8 Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity

So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +03:00
Dmitry Jemerov f9495aa0d7 Introduce and use KotlinPaths.getStdlibPath()
Also support renaming .jar file when updating an existing library
2017-04-04 11:21:06 +02:00
Vyacheslav Gerasimov ba5e78a917 Replace deprecated Iterators.emptyIterator() in JavaContext.java
with ContainerUtil.emptyIterator()
2017-03-27 21:35:11 +03:00
Alexey Tsvetkov 9d95c841a6 Use connect-and-lease when using daemon in JPS & Gradle
Relates to KT-15562 "Service is dying".

This commit includes multiple changes:
 1. JPS & Gradle daemon clients are refactored to use `connectAndLease` from `KotlinCompilerClient`.
 `connectAndLease` was introduced in previous commits
 2. `withKotlin` was removed because `connectAndLease` already covers retrying on connection error
 3. Gradle flag files creation is changed:
   * client-alive flag file lives as long as Gradle instance lives,
   * session-alive flag file lives until the end of a build.
2017-03-24 19:03:36 +03:00
Ilya Chernikov 8eaeadddfa Disable flaky statistical benchmark tests for source sections plugin and JSR 223 2017-03-23 18:11:36 +01:00
Yan Zhulanow cba523958e Android Extensions: Support Dialog classes (KT-16957) 2017-03-22 22:03:22 +03:00
Yan Zhulanow f1e303e18d Minor: Update kapt tests for Kotlin 1.1 2017-03-22 22:03:21 +03:00
Yan Zhulanow e93bc4c00d Kapt3, minor: Enable parameter name saving in javac ClassReader 2017-03-22 22:03:19 +03:00
Yan Zhulanow 7535778ed4 AllOpen, NoArg: Check for the Gradle plugin in the classpath properly
Path segments in the plugin classpath entries are separated by the system file separator, not by '/'.

This fixes KT-16901
2017-03-22 22:03:19 +03:00
Yan Zhulanow 8ac14ab930 Android Extensions: Allow to disable IDE support (KT-12741)
Enable IDE plugin only if it is enabled in the build.gradle file.
2017-03-22 22:03:17 +03:00
Yan Zhulanow 5d4cefcc30 AllOpen: Do not make private members open (KT-16627) 2017-03-22 22:03:00 +03:00
Yan Zhulanow bb0a46ac17 Kapt3: Ignore inner classes with clashing names (KT-16458)
Ignore classes (and references to such classes in declaration signatures) if one of the containing classes has the same simple name. This is forbidden in Java, thus should not be present in kapt source stubs.
2017-03-22 22:02:30 +03:00
Yan Zhulanow 47ab47d6d1 Kapt3: Support 'processors' option in the compiler plugin (KT-8558)
Support specifying qualified names of annotation processors in the kapt3 compiler plugin (feature-parity with javac).
2017-03-22 22:02:27 +03:00
Yan Zhulanow d30dbf25b5 Kapt1: Allow to use spaces in the collected identifiers (KT-12769) 2017-03-22 22:02:26 +03:00
Yan Zhulanow 948207be30 AllOpen, NoArg: Use the bundled plugins in Maven projects
Use the bundled compiler plugins for Maven projects (as we do for Gradle projects already) because the plugin provided as a dependency in the POM file may have an incompatible version.
2017-03-22 22:02:25 +03:00
Alexey Sedunov bab762b761 Implement post-refactoring optimization of unused imports
#KT-15822 Fixed
 #KT-13755 Fixed
2017-03-22 13:36:11 +03:00
Ilya Chernikov 08f6b6c93c minor: get rid of the compiler-test dependency in source-sections test 2017-03-21 16:30:50 +01:00
Ilya Chernikov 4043f491da minor: replace Pair with data class in daemon client connectAndLease call
backport from 1.0.7
2017-03-21 16:30:47 +01:00
Ilya Chernikov 4b430b49a7 Implement source sections compiler plugin
allows to compile only parts of the source files, denoted by top-level
"sections" (function with lambda param calls), but preserving original
file line/column numbers for easier diagnostics. Allow e.g. to compile
gradle "buildscript" section without preprocessing original file in
advance. See tests for examples.
2017-03-21 16:30:46 +01:00
Alexey Tsvetkov 40574d31ac JPS tests: avoid using deprecated API 2017-03-20 18:46:00 +01:00
Nikolay Krasko 82a2a705fb Do not wrap analyze into write action priority in tests
In tests the code is executed in EDT and runInReadActionWithWriteActionPriority fails

See: MergingUpdateQueue.setPassThrough() and ExternalToolPassFactory() constructor
2017-03-20 18:45:36 +01:00
Nikolay Krasko 2eb6c393a4 Move android modules to Java 8 SDK 2017-03-20 18:45:29 +01:00
Dmitry Jemerov b10073465c fix compilation of new lint checks against IDEA 163 2017-03-20 18:45:22 +01:00
Dmitry Jemerov a2b0b3d6eb fix compilation against branch 163 2017-03-20 18:45:15 +01:00
Yan Zhulanow 24c9b6e171 Migrate IDEA plugin code to Android Studio 2.2 (br 145) 2017-03-20 18:45:15 +01:00
Pavel V. Talanov daef8a0eed Light classes in IDE: Make light class delegate construction a two step process
Step 0: Light class object is created, no delegates are computed
Step 1: constructs dummy delegate which can not be relied upon to know signature of any member
		It can be used to construct light field and light method objects
		(which can correctly respond to some queries) before constructing real delegate
Step 2:
		Construct real delegate if dummy delegate is not enough to respond to a query

This speeds up multiple scenarios where getMethods() and getFields() are called on numerous classes

Dummy delegate's faster consruction is achieved by using specially setup dumb analysis instead of ide analysis

Introduce LazyLightClassDataHolder: which manages creation of Step 1 and Step 2 delegates
Introduce MemberIndex: keeping track of member creation order, helps matching light class delegates created in different contexts
KtLightMethod and Field: make use of dummy delegate
KtLightMethod no longer extends LightMethod since it requires eager delegate construction
KtLightMethod now implements PsiAnnotationMethod for convenience (ClsMethodImpl implements PsiAnnotationMethod)
2017-03-15 20:54:55 +03:00
Mikhail Glukhikh 045a23ae10 Cleanup: apply "Convert lambda to reference" 2017-03-15 17:36:02 +03:00
Mikhail Glukhikh b121bf8802 Cleanup: fix some compiler warnings (mostly deprecations, javaClass) 2017-03-15 17:35:31 +03:00
Mikhail Glukhikh d0cc1635db Cleanup: apply "Use synthetic property access syntax" 2017-03-15 16:13:40 +03:00
Vyacheslav Gerasimov b8563f7fcf Fix KotlinUastTypesTest.testCycleInTypeParameters 2017-03-15 00:20:40 +03:00
Yan Zhulanow f6734e74e1 Minor, SamWithReceiver: Fix services for kotlinc CLI execution
Move service files to META-INF to support execution from CLI (using PluginCliParser).
2017-03-14 18:36:40 +03:00
Dmitry Jemerov 006062499c Optimize imports (to fix compilation under 171 branch) 2017-03-13 16:34:48 +01:00
Dmitry Petrov a087ea559f Eliminate redundant CHECKCAST instructions
CHECKCAST is redundant if the corresponding static type exactly matches the target type.
CHECKCAST instructions to-be-reified should not be eliminated.

KT-14811 Unnecessary checkcast generated in parameterized functions
KT-14963 unnecessary checkcast java/lang/Object
2017-03-13 09:04:31 +03:00
Vyacheslav Gerasimov 830bf62d94 Fix SOE from UAST in containsLocalType
containsLocalType now properly handles start projections
#KT-16680 Fixed
2017-03-10 17:30:21 +03:00
Alexey Sedunov 641a9a7153 Kotlin Facet: Get rid of duplicating data in facet configuration 2017-03-09 23:06:12 +03:00
Dmitry Jemerov 01a9d9a284 Support lazy conversion of parent chain; correctly check expected class 2017-03-09 17:07:43 +01:00
Dmitry Jemerov 8c3936a0ee Update to UAST 0.12 2017-03-09 17:07:43 +01:00
Vyacheslav Gerasimov 1376c8f8cf Implement quickfixes for Android Lint api issues
#KT-16624 Fixed
#KT-16625 Fixed
#KT-14947 Fixed
2017-03-03 16:22:36 +03:00
Vyacheslav Gerasimov 39010ab847 Fix broken isReferenceTo checking code for Android extensions
#KT-16132 Fixed
2017-03-03 16:17:52 +03:00
Dmitry Jemerov ea228a2fa8 Fix testdata for SimpleKotlinRenderLogTest 2017-02-16 11:43:16 +01:00
Dmitry Jemerov 41f7950ab8 UAST tests: don't null out the application if we have a valid one that we restored from a previous test 2017-02-15 18:21:37 +01:00
Dmitry Jemerov 95bfe8668d UAST tests no longer leave a disposed application around 2017-02-15 12:56:21 +01:00