Commit Graph

584 Commits

Author SHA1 Message Date
Dmitry Savvinov ba36fafb84 Create JsAnalyzerFacade with allowSliceRewrite=true
Other facades (JVM, Common, Native) are already created with such flag.
This should stop some known 'rewrite at slice'-exceptions from being
thrown (KT-21405, KT-29705).

For a more thorough investivation and details, refer to KT-30031.

Also, see KT-30030: even though it was fixed by the different commit,
the same scenario probably can be used to investigate other rewrites
(even though they will reproduce much less frequently than original
issue)

^KT-21405 Fixed
^KT-29705 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Gridin 147521d6cb Add intention to introduce import alias
#KT-16118 Fixed
 #KT-30007 Fixed
2019-02-21 12:25:09 +03:00
Dmitry Gridin 6bf119b262 Refactoring 2019-02-21 12:25:08 +03:00
Dmitriy Dolovov 45f028d353 CIDR: Avoid Java errors during KTS analysis in CIDR
There is no Java support in CIDR. Therefore:
- analyze KTS in CIDR using Common platform
- disable error highlighting for KTS in CIDR

Issue #KT-29953 Fixed
2019-02-18 11:27:31 +07:00
Sergey Rostov 0f2fb4ff82 Build: remove intellijCore/annotations.jar usages 2019-01-28 13:43:08 +03:00
Sergey Rostov c716ef112e Got rid of @TestOnly usages on fields 2019-01-28 13:43:08 +03:00
Nikolay Krasko 046a0e059c Always add last version of idea for which change is needed to BUNCH
BUNCH directive should contain last idea IDEA version this change is
meant for.
2019-01-18 19:42:43 +03:00
Sergey Rostov 883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Dmitriy Dolovov 2c327564d5 CIDR: Better detection when running in CIDR-based IDE
- Drop unnecessary bunch files for `KotlinFacetType` and `KotlinFacetTypeImpl`
- Use cached val `isRunningInCidrIde` to check if the code is running under CIDR
2018-12-19 11:20:54 +07:00
Yan Zhulanow 3c8714696d Add a LookupLocation to 'getSyntheticExtensionProperties()', use it in 'DebuggerFieldSyntheticScopeProvider' 2018-12-12 21:40:43 +09:00
Toshiaki Kameyama 2683b25728 "Change type" quick fix: fix false negative in 'when' branch #KT-8820 Fixed 2018-11-09 11:09:02 +03:00
Mikhail Glukhikh 688fc386b6 Refactoring: introduce resolve to property descriptor 2018-10-11 17:14:17 +03:00
Natalia Selezneva 8f8c431524 Fix Optimize import for scripts not under source roots
KT-17231 Fixed
KT-21981 Fixed
2018-09-21 22:58:14 +03:00
Alexander Udalov 5dc563a9af Split deprecationUtil.kt to several files, move to subpackage
Also move interface Deprecation to subpackage "deprecation"
2018-09-14 14:43:23 +03:00
shiraji fd3fe52eb4 Fix the problem with code completion of type extension method
KT-23834 Fixed
2018-09-11 14:24:45 +03:00
Mikhail Glukhikh ad4da3d761 Code cleanup: convert flatMap { it } into flatten() 2018-09-07 16:32:18 +03:00
Pavel V. Talanov b59f134f78 Fix completing members for receivers shadowed by DslMarker
#KT-20396 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov 0c1d25d5ac Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
    leading to strange completion order

 #KT-25588 Fixed
2018-08-16 13:59:38 +02:00
Denis Zharkov 9f3a902ff3 Take into account refined applicability of dsl-marker in IDE
After the previous change, when being applied to a function type
with receiver it's assumed to work just as it's applied to receiver type

Thus, it's necessary to fix relevant IDE features relied on DSL markers

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Mikhail Zarechenskiy 659289b41a Report diagnostics about experimentality on unsigned literals
#KT-25580 Fixed
2018-08-06 17:45:22 +03:00
Nikolay Krasko 759ffafb0a Render flexible types with enhancement as enhanced in IDE (KT-25622)
Main targets for the fix is completion, parameters info, inlay hints and
override/implement.

Other IDE functions might be affected.

 #KT-24911 Fixed
 #KT-25616 Fixed
 #KT-25622 Fixed
2018-08-03 16:00:09 +03:00
Vyacheslav Gerasimov 53b1a8bd37 Remove hacks introduced for 172 platform compatibility 2018-08-02 19:32:18 +03:00
Vyacheslav Gerasimov a2bf417d75 Remove 172 bunchset 2018-08-02 19:32:18 +03:00
Vyacheslav Gerasimov 0103c0d2fd Switch to 182 platform 2018-08-02 18:17:06 +03:00
Dmitry Savvinov f90b29c2e3 Support contracts in PartialBodyResolveFilter
Previously, PartialBodyResolveFilter didn't know about contracts and was
filtering out calls of such functions, leading to unstable completion in
cases like that:

fun test(x: Any?) {
    require(x is String)
    x.<caret>
}

However, PartialBodyResolveFilter works by pure PSI, while to determine
if function has a contract we have to resolve it.

To solve it, we do something very similar to what has been done with
Nothin-returning functions: introduce
KotlinProbablyContractedFunctionShortNameIndex, which collects all
function which *may* have a contract during indexing.

^KT-25275 Fixed
2018-07-27 16:59:24 +03:00
Simon Ogorodnik ad6eac6ec6 KT-22815: Cleanup findKDoc logic 2018-07-20 18:41:18 +03:00
Simon Ogorodnik 1bd02472a2 KT-22815: Fix documentation for primary constructor params/props 2018-07-20 18:41:14 +03:00
Simon Ogorodnik 9ec0ce6ec8 KT-22815: Show documentation for function value/type params 2018-07-20 18:41:08 +03:00
Alexander Udalov 4122021090 Add BinaryVersion to DeserializationContext
This will be useful to implement version-dependent deserialization,
which is needed for gradual fixes of issues in metadata

 #KT-25120 In Progress
2018-07-18 17:58:46 +02:00
Alexander Udalov ae6627fe94 Simplify code in JS serialization related to module descriptors
Do not use `JsModuleDescriptor<...>` where only its `data` is needed
2018-07-17 20:26:31 +02:00
Alexander Udalov f766b2c473 Improve "optimize imports" behavior on default imports
Optimize imports to classes when there's an import of a type alias to
that class with the same name. This results in "java.lang.*" imports
being optimized in favor of the corresponding type aliases in "kotlin.*"
which are imported by default
2018-07-16 13:45:11 +02:00
Alexander Udalov 1f0fb4823f Simplify DefaultImportProvider, introduce "low priority imports"
Previously, packages `java.lang` and `kotlin.jvm` were imported on JVM
by default on the same rights, causing problems when the same classifier
existed both in `java.lang` and `kotlin.jvm`. Since the only known case
of such conflict were type aliases to JVM classes, the corresponding
classes (expansions of those type aliases) were manually excluded from
default imports. This made the code in DefaultImportProvider complicated
and resulted in multiple problems, regarding both correctness and
performance (see 82364ad3e5, a9f2f5c7d0, dd3dbda719).

This change adds a new concept, a "low priority import", and treats
`java.lang` as such. Since these imports are now separated from the rest
of default imports in LazyImportScope via secondaryClassImportResolver,
conflicts between classifiers are handled naturally: the one from
`kotlin.jvm` always wins (unless the one from `java.lang` is imported
explicitly, of course). This approach is simpler, safer and does not
require any memory to cache anything.

Skip ResolveToJava.kt test for javac-based resolve; it now fails because
of a weird issue which I didn't have time to investigate (this is OK
because it's a corner case of an experimental functionality)
2018-07-16 13:45:11 +02:00
Simon Ogorodnik 75fa02646b EA-109046: Add diagnostic to catch NPE 2018-07-11 20:50:02 +03:00
Alexander Udalov e25bc2865f Remove PackagePartProvider from ResolverForProjectImpl
To be able to move it to JVM-specific modules, and to provide a
replacement for common module analysis
2018-07-10 15:16:49 +02:00
Alexander Udalov 959c2f4843 Get rid of split packages in descriptors, descriptors.jvm, deserialization
Also move some other files to related packages and reformat moved files
2018-07-06 14:08:35 +02:00
Alexey Sedunov 694997651a Override/Implement: Fix processing of unresolved types
#KT-17350 Fixed
2018-06-19 12:22:40 +03:00
Nikolay Krasko 580e2972db Initial settings for incompatible API inspection 2018-05-17 12:27:30 +03:00
Mikhail Glukhikh 0f2879aa32 Rename: SOURCE_CODE_SHORT_NAMES_IN_TYPES -> *_SHORT_NAMES_NO_ANNOTATIONS 2018-05-16 13:01:37 +03:00
Mikhail Glukhikh 06f7e77006 Introduce new type renderers (no parameters & built-in annotations) 2018-05-16 13:01:37 +03:00
Denis Zharkov 8e1b0c5ab7 Optimize memory footprint for PartialBodyResolveFilter
There is a single PartialBodyResolveFilter instance per module
and each of them were containing just the same sets of available
in project Nothing-typed functions (including duplicating String instances),
in case of Kotlin project it might sum up to 27M of heap.

The solution is to share the global sets between all modules in a project
2018-04-28 17:12:52 +03:00
Nikolay Krasko 349f16aa64 Fix AbstractScratchRunActionTest.kt and remove usages of projectDisposable 2018-04-18 13:59:36 +03:00
Pavel V. Talanov 33a312c26d Do not throw when trying to resolve java outside project model
#KT-23444 Fixed
 #KT-22825 Fixed
2018-04-17 16:19:49 +02:00
Nikolay Krasko 1fb2b40684 Fix 182 branch after QueryExecutor and subclasses update
Parameter taking Processor<T> were replaced with Processor<? super T>.
https://github.com/JetBrains/intellij-community/commit/aaed1ccb910f6f4a9ea2f96894d99b6e35a59ef9
https://github.com/JetBrains/intellij-community/commit/c6b40a53ee5b2a0807c55adafb59edb453090915

Instead of updating all usages, use ExecutorProcessor to avoid
different source code for different IDEAs.
2018-04-14 15:29:38 +03:00
Vyacheslav Gerasimov 7c02d55b23 Remove explicit jar specification from ide modules build scripts
They often change between ide versions and difficult to maintain
2018-04-09 21:47:48 +03:00
Alexander Podkhalyuzin b78869ecfc Fixed aliased imports cache #KT-23430 Fixed 2018-03-29 16:05:00 +02:00
Dmitry Jemerov 20cd193030 Delete remains of external annotations support from compiler 2018-03-29 09:45:07 +02:00
Mikhail Glukhikh 9170aa0674 Distinguish PARTIAL_WITH_CFA resolve mode from just PARTIAL
So #KT-23182 Fixed
2018-03-28 12:04:33 +02:00
Alexey Tsvetkov 8a82c1618c Use Plugins DSL in Kotlin Gradle scripts
When plugins DSL is used, there is no need to
manually generate typesafe accessors for extensions and
conventions (by running `./gradlew kotlinDslAccessorsSnapshot`).
2018-03-26 16:09:29 +03:00
Nikolay Krasko 0b0eb210b6 Refactoring: get module language settings in ResolverForProjectImpl 2018-03-23 18:04:06 +03:00
Nikolay Krasko 586860e03a Refactoring: store correspondent module info in module content 2018-03-23 18:04:01 +03:00