Commit Graph

700 Commits

Author SHA1 Message Date
Mikhail Glukhikh 1d2017b0fc Cleanup: apply "cascade if..." inspection (+ some others) 2017-07-07 18:15:32 +03:00
Vyacheslav Gerasimov 4cef8728d7 Add layout file name in completion for Android Extension properties
#KT-11051 Fixed
2017-07-07 03:24:19 +03:00
Vyacheslav Gerasimov f59859842a Fix Android extensions import rename
#KT-17890 Fixed
2017-07-07 03:24:10 +03:00
Nikolay Krasko 72611d1337 Fix extract refactoring for android extensions declarations (KT-11048)
Allow any target declarations in marking references. Otherwise conflicts
for references resolved to xml are not considered broken.

This also fix evaluate for extension fields.

 #KT-11048 Fixed
2017-07-05 20:21:13 +03:00
Valentin Kipyatkov 61d9a6b9cd Use the same way to check for ProcessCanceledException everywhere 2017-06-30 11:21:16 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Alexander Udalov 9274d963aa Create KotlinCoreEnvironment a bit later in tests
Before this change, diagnostic tests with Java source files failed
because KotlinCoreEnvironment was being created in the test's setUp,
even before the test data file has been split into .java/.kt and the
resulting .java files have been copied to a temporary directory. In
KotlinCoreEnvironment's constructor, we now inspect all roots for
module-info files, which involves calling VirtualFile.getChildren on all
roots in the configuration. CoreLocalVirtualFile.getChildren is
cached on the first access, and so because the temporary directory with
.java files was empty at this point, the VirtualFile for that directory
returned empty array in getChildren later in the test, resulting in
unresolved reference errors.

This is fixed by creating the environment _after_ the .java files have
been copied to a temporary directory. Note that slow assertions for
flexible types are now enabled in KtUsefulTestCase instead of
KotlinTestWithEnvironmentManagement, because BaseDiagnosticsTest no
longer inherits from the latter
2017-06-29 15:59:56 +03:00
Yan Zhulanow e7e0032cc8 Kapt3, minor, tests: Weaken regular expression for Metadata shrinking 2017-06-28 10:25:08 +03:00
Alexander Udalov 999e4cda1d Compute module mappings eagerly in JvmPackagePartProvider, refactor
Previously we traversed all notLoadedRoots on each request for package
parts with the given package FQ name. Since notLoadedRoots might contain
a lot of roots (which never transition into "loadedModules" because e.g.
they are not Kotlin libraries, but just Java libraries or SDK roots with
the META-INF directory), this was potentially hurting performance. It
seems it's more optimal to compute everything eagerly once
JvmPackagePartProvider is constructed.

Another problem with the previous version of JvmPackagePartProvider was
that it did not support "updateable classpath" which is used by REPL and
kapt2, it only used the initial roots provided in the
CompilerConfiguration. In REPL specifically, we would thus fail to
resolve top-level callables from libraries which were dynamically added
to the execution classpath (via some kind of a @DependsOn annotation).
In the new code, JvmPackagePartProvider no longer depends on
CompilerConfiguration to avoid this sort of confusion, but rather relies
on the object that constructed it (KotlinCoreEnvironment in this case)
to provide the correct roots. This is also beneficial because the
computation of actual VirtualFile-based roots from the ones in the
CompilerConfiguration might get trickier with modular Java 9 roots
2017-06-26 16:22:05 +03:00
Ilya Gorbunov 7efb9ddd4e Early return if value is null
The change is required to fix compilation for IDEA 172, where getValue()
became explicitly nullable.
2017-06-20 02:58:40 +03:00
Yan Zhulanow d07fd52c43 SamWithReceiver: Add general-purpose plugin and Gradle/Maven integrations 2017-06-19 20:28:47 +03:00
Vyacheslav Gerasimov f51e3ab90c Fix Android extensions property usage highlighting
#KT-10736 Fixed
2017-06-16 17:13:34 +03:00
Alexander Udalov 4844d720cc Remove dependency of module 'java-model-wrappers' on 'annotation-processing'
This breaks the circular dependency between them
2017-06-07 14:06:01 +03:00
Vyacheslav Gerasimov 643e3587cc Kotlin UAST should visit property delegate expression
#KT-15164 Fixed
2017-06-06 20:47:01 +03:00
Vyacheslav Gerasimov 15bfd4439a Fix AddTargetVersionCheckQuickFix, generate else branch with TODO
when surrounded statement used as expression

#KT-17786 Fixed
#KT-17788 Fixed
2017-06-06 20:46:53 +03:00
Vyacheslav Gerasimov 33c3ba815f Fix Android SuppressLint and Api quickfixes: proper annotation placing
#KT-17783 Fixed
 #KT-17787 Fixed
2017-06-06 20:46:40 +03:00
Pavel V. Talanov f3f2379e5a KtLightMemberModifierList:hasExplicitModifier("default") returns false
#KT-18070 Fixed
2017-06-06 17:11:17 +03:00
Alexander Udalov 7febd846e8 Export 'intellij-core' in module 'frontend'
Remove intellij-core from dependencies of modules which already depend
on frontend or any module that exports frontend (such as frontend.java)
2017-06-06 14:29:26 +03:00
Alexander Udalov 2ed027219c Remove dependency of module 'frontend' on 'plugin-api'
This breaks the circular dependency between them
2017-06-06 14:29:25 +03:00
Alexander Udalov 1df13e0bc9 Move TopDownAnalyzerFacadeForJVM to module 'cli'
It's only used in the command line compiler and in tests
2017-06-06 14:29:23 +03:00
Alexander Udalov cbaa676c3d Move some declarations between 'descriptors' and 'deserialization'
- Move the following from 'deserialization' to 'descriptors':
  NotFoundClasses.kt
  AdditionalClassPartsProvider.kt
  ClassDescriptorFactory.kt
  PlatformDependentDeclarationFilter.kt
  findClassInModule.kt
- Move the following form 'descriptors' to 'deserialization':
  BuiltInSerializerProtocol.kt
  builtInsPackageFragmentProvider.kt
- Extract a marker interface from BuiltInsPackageFragment and move its
  implementation to 'deserialization'
- Change the type of parameters in PlatformDependentDeclarationFilter
  and AdditionalClassPartsProvider to ClassDescriptor

This will help in getting rid of the circular dependency of
'descriptors' <-> 'deserialization'
2017-06-06 14:29:18 +03:00
Vyacheslav Gerasimov ca124d1e36 Remove Android api diagnostic error on Kotlin interface default methods
They don't require java 8 or any other special support to work on Android

#KT-18059 Fixed
2017-06-01 20:35:08 +03:00
Yan Zhulanow 4f132f6d40 Kapt: Fix output file reporting in IC
Fix REPORT_OUTPUT_FILES option passing to GenerationState created in kapt.

This fixes these tests:
Kapt3Incremental.testChangeAnnotatedPropertyType()
Kapt3Incremental.testRemoveAnnotations()
Kapt3Incremental.testRemoveSourceFile()
2017-05-30 22:09:20 +03:00
Alexey Andreev 8a8fdf1968 Command-line tool for JS DCE 2017-05-26 18:20:17 +03:00
Yan Zhulanow 7220183912 Kapt: Write @kotlin.Metadata annotation to Java stubs #KT-17937 2017-05-25 21:28:47 +03:00
Yan Zhulanow 141f12e71b Minor: Commit forgotten kapt test data 2017-05-25 21:28:40 +03:00
Ilya Chernikov 9d2ae54d2c Introduce other JVM options inheritance for daemon 2017-05-24 10:52:38 +02:00
Yan Zhulanow 87f3b574aa Kapt: Filter the content root items for the compile classpath properly 2017-05-23 16:45:40 +03:00
Yan Zhulanow 5ec16167bc Kapt: Preserve parameter names for abstract methods 2017-05-23 16:45:29 +03:00
Yan Zhulanow 1a342faf38 Kapt3: Ignore packages with Java keywords inside (KT-17184) 2017-05-23 16:45:19 +03:00
Yan Zhulanow 1c5765628e Kapt3: Fix flaky integration tests on Windows agents 2017-05-23 16:45:14 +03:00
Mikhail Glukhikh d185adfedd Fix UAST test 2017-05-16 16:43:29 +03:00
Yan Zhulanow 5d31e00d27 Allopen, Gradle: Fix JPS build on Windows (KT-17830)
Appears that plugin classpath can contain not only `File.separatorChar`, but also '/' on Windows. Without the proper handling of this case, Gradle importer may import the plugin JAR made for Gradle with shaded 'com.intellij' and cause an exception during the JPS build.
2017-05-15 14:42:01 +03:00
Mikhail Glukhikh 768e0fa738 Add forgotten KotlinAbstractUElement.hashCode() 2017-05-12 22:27:58 +03:00
Dmitry Jemerov 8337cd455f Fix reporting exception problems on Kotlin UAST fields (KT-17714) 2017-05-06 08:18:08 +02:00
Mikhail Zarechenskiy 7541a3754d Move SAM constructors to synthetic scope 2017-05-05 21:30:35 +03:00
Yan Zhulanow 7bbf9861d0 Kapt3: Simplify handling of annotation processing exceptions
The previous handling method was unreliable ("Don't know how to render diagnostic of type KAPT3_PROCESSING_ERROR", exceptions being lost).
2017-05-04 19:59:30 +03:00
Yan Zhulanow 3bf534b392 Kapt3: Support apt modes
Allow to run kapt in "annotation processing only" and "stub generation only" modes in order to support incremental compilation in Gradle.
Unfortunately, annotation processing can't be done incrementally cause it uses all module files, but the stub generation can be done incrementally.
2017-05-04 19:00:41 +03:00
Yan Zhulanow 99a05f5d61 Kapt3: Convert reference to KMutableMap.Entry correctly (KT-17567) 2017-05-04 18:46:43 +03:00
Yan Zhulanow 254e8156ac NoArg: Initialize properties in noarg constructor (KT-16692) 2017-05-04 18:46:42 +03:00
Ilya Chernikov 5745752841 Ignore empty lines at the end of the testdata, more tests
should finally fix source-section plugin tests on windows
2017-05-03 18:11:47 +02:00
Pavel V. Talanov 55a0e138fc Refactor: extract AnnotationDescriptor.annotationClass utility 2017-05-02 15:40:20 +03:00
Pavel V. Talanov 0571c62943 KtLightElements: make light annotations lazier
Allow to get annotation list and to invoke `findAnnotation` without building delegate
Introduce KtLightNullabilityAnnotation which holds nullability information and is built
    before delegate is built
2017-05-02 15:40:17 +03:00
Alexander Udalov d8d3bafbe9 Introduce "-Xreport-output-files" to report source-output mapping for JPS
This makes "-verbose" not required for JPS to run correctly and
therefore allows to print more useful debugging stuff in the compiler
and read them in CLI, for example. The output will also be more readable
because there'll be no "output" messages
2017-04-28 20:49:28 +03:00
Alexander Udalov 7f5d87ea17 Rename PathUtil.getJdkClassesRoots to avoid confusion
Two of these methods return roots given a path to the JRE, and the third
one returns roots given a path to the _JDK_.
2017-04-27 20:35:14 +03:00
Yan Zhulanow 14fde339ef Minor: Fix Android JPS test 2017-04-27 18:52:12 +03:00
Yan Zhulanow 8354d25800 Android Extensions: Fix availability in Android/JPS projects (KT-17610) 2017-04-27 18:52:11 +03:00
Yan Zhulanow 63243b99fa Kapt3: Check if the 'tools.jar' is present in the plugin classpath (KT-17456)
Kapt3 won't work without the 'tools.jar' file provided, but we shouldn't throw an exception in this case.
This commit adds the warning message (and disables Kapt if it can't be used).
2017-04-27 18:52:10 +03:00
Yan Zhulanow 20e362e363 Kapt3: Do not generate "options not recognized" for "kapt.kotlin.generated" option (KT-17418)
"kapt.kotlin.generated" AP option is always present (and it's the way to say the arbitrary processors about the target directory for generated Kotlin source files).
In this commit, the "fake" empty annotation processor is added to consume the option if no other processor does it.
2017-04-27 18:52:09 +03:00
Vyacheslav Gerasimov 5f09e18394 Fix Android api issues reporting for generic collection method calls
#KT-16712 Fixed
2017-04-27 16:02:37 +03:00