Commit Graph

2477 Commits

Author SHA1 Message Date
Pavel V. Talanov a584de8a7e Prefer platform specific declarations when searching for library sources
Untested: test infrastructure needed

 #KT-23223 Fixed
2018-05-11 16:25:16 +02:00
Pavel V. Talanov f6b094781f Mpp resolve: ignore module dependencies on libraries of other platforms
These are not read by the compiler

Untested: test infrastructure needed

 #KT-20406 Fixed
2018-05-11 16:25:14 +02:00
Natalia Selezneva 41653e9a50 Introduce separate cache for scripts
^KT-22588 Fixed
2018-05-11 15:51:42 +03:00
Natalia Selezneva 71703636bc Optimization: do not load dependencies for scripts not under expected location 2018-05-11 15:51:37 +03:00
Natalia Selezneva 61c31ce030 Refactoring: move logic that script shouldn't be highlighted if there are any FATAL error to KotlinHighlightingUtil 2018-05-11 15:51:33 +03:00
Nikolay Krasko 9e2412b887 Create dummy method for light class without reformat (EA-115803) 2018-05-11 12:00:43 +03:00
Nikolay Krasko c9f31099f2 Fix binary compatibility issue after moving ModuleTestSourceInfo
Compatibility check revealed problem in truth-postfix-plugin.

https://github.com/droibit/truth-postfix-plugin/blob/b06adbf4e6563672da75b112b1bc7f1fc511a848/plugin/src/main/kotlin/com/github/droibit/plugin/truth/postfix/utils/TemplateUtils.kt
2018-05-11 12:00:43 +03:00
Natalia Selezneva 613ea94376 Allow reference search in scratches
^KT-23563 Fixed
^KT-23587 Fixed
2018-05-08 11:40:51 +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
Denis Zharkov 26714d56d8 Use WeakKeySoftValueMap in ResolveElementCache
Otherwise results are effectively retained in the maps until we're close
to OutOfMemory.
While we mostly need them for a short time (especially in the case we
run resolution during usages search).

The possible problem is that the values may become too short-living,
but now using these maps is a conventional solution for similar tasks in
Java resolve
2018-04-28 17:12:52 +03:00
Vyacheslav Gerasimov 8c88ac69df Cleanup .181 bunch files 2018-04-27 18:25:21 +03:00
Vyacheslav Gerasimov bc403ce744 Switch to 181 platform 2018-04-27 18:25:17 +03:00
Denis Zharkov b75024e3e0 Fix memory leak related to diagnostics computation within light classes
Before this change, when somebody has requested the exact light class
we also store LazyJvmDiagnostic for it in a map inside DiagnosticHolder.

The problem is that LazyJvmDiagnostic retains a lot of memory:
GenerationState, bindingContext, etc.

At the same time, it commonly happens that light classes are being computed from Java resolve and diagnostics are obviously
unnecessary there.

The solution has two parts:
1. We don't retain diagnostics until somebody explicitly requested them
2. We force computation of LazyJvmDiagnostic to avoid retaining
backend's parts

The solution has a kind of drawback: for an opened in editor Kotlin file,
we'll run back-end twice for contained classes (analysis parts should be reused, though)

 #KT-24048 Fixed
2018-04-27 16:13:59 +03:00
Natalia Selezneva 26f1d6ae7c Update Icon for .kts and .gradle.kts files
^KT-23431 Fixed
2018-04-27 13:52:31 +03:00
Nikolay Krasko 144c41576e Refactoring: inline KotlinInternalMode.enabled 2018-04-27 12:16:37 +03:00
Nikolay Krasko 82a21b3955 Move Kotlin internal actions to Internal menu and unify modes (KT-23975)
#KT-23975 Fixed
2018-04-27 12:16:36 +03:00
Nicolay Mitropolsky 8e91f31182 UnimplementedKotlinInterfaceMemberAnnotator: use modifier list to be compatible with 172 2018-04-26 20:40:26 +03:00
Mikhael Bogdanov ec0b9aa343 Skip @JvmDefault in UnimplementedKotlinInterfaceMemberAnnotator
#KT-23967 Fixed
2018-04-26 15:36:42 +02:00
Alexander Udalov 361f686124 Move ModuleMapping and BinaryModuleData to metadata.jvm 2018-04-23 18:42:32 +02:00
Alexander Udalov d0544a148a Minimize dependencies of ModuleMapping
Prepare it to be moved to metadata.jvm
2018-04-23 18:42:32 +02:00
Nikolay Krasko 5817a7fdac Prevent endless processing of problem pending events
If some pending event processing caused exception in PerModulePackageCacheService,
log the problem and consider event processed. Otherwise it is going to
be stuck there forever.
2018-04-23 16:41:14 +03:00
Nikolay Krasko 00119c309c Don't call findChild on invalid file in ImplicitPackagePrefixCache 2018-04-23 16:41:14 +03:00
Pavel V. Talanov 94fe170b7b MPP: analyze platform sources with expectedBy common sources
This allows to emulate current compiler behaviour

Introduce CombinedModuleInfo which is a combination of several other modules intended to be analyzed together
2018-04-20 20:00:11 +02:00
Mikhail Glukhikh ef3ba5f0b1 Test local inspections on the fly via highlighting
Fixes problem with INFORMATION highlight type in batch mode (IDEA 181).
It's no more required to report INFORMATIONs in unit tests in batch.
2018-04-18 16:14:43 +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 ecd2db3b48 Remove bunch files that are equal to base files 2018-04-16 15:55:53 +03: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
Nikolay Krasko 2260f66e02 Unify usage of ProgressManager.progressIndicator 2018-04-12 19:29:01 +03:00
Alexey Tsvetkov 2f4dcd609c 182: Remove deprecated StoragePathMacros usages
Deprecated `StoragePathMacros.PROJECT_CONFIG_DIR` and
`StoragePathMacros.PROJECT_FILE` were removed in Intellij.
2018-04-11 16:28:41 +03:00
Alexander Podkhalyuzin f5e0dfaf8c 181: Parameter state in PersistenceStateComponent is not null now in platform 2018-04-11 16:28:26 +03:00
Nikolay Krasko 577e6e5206 172: Try to remove unneeded commits in 172 branch
Revert "[Unneeded?] Revert "ExpressionOfTypeProcessor: get member name in read action""
This reverts commit 7ec59fc

Revert "[Unneeded] Revert "AbstractNavigateToLibraryTest: fix for invalid files""
This reverts commit 9e80c60

Revert "[Unneeded?] Revert "AbstractExtractionTest: fix for invalid files""
This reverts commit 0b2113b

Revert "[Unneeded] Revert "AbstractIntentionTest: `isApplicableOnPooled` made run under ProgressIndicator""
This reverts commit a41c247
2018-04-11 16:28:09 +03:00
Nikolay Krasko 9c38454c2e 172: [Unneeded?] Revert "ExpressionOfTypeProcessor: get member name in read action"
This reverts commit 32d8e0c72b877f0c0123bb56e0d92beaab410daa.
2018-04-11 16:28:09 +03:00
Nikolay Krasko 368dd193ac 172: Revert "Fix compilation after moving to idea 173"
This reverts commit fe121cc6aeadf63ca2c2819c9c7df59cc81caf5d.
2018-04-11 16:28:02 +03:00
Ilmir Usmanov 2cfe387bab Move coroutines to kotlin.coroutines package: compiler
Generate continuation type as kotlin.coroutines.Continuaion. This code will
fail at runtime since there is no stdlib backing this change yet.
However, in order to generate compatible stdlib we need a compiler, which
generates continuation type as kotlin.coroutines.Continuation.
Thus, firstly we support the change in the compiler, make it bootstrap
compiler and only then change stdlib and tests accordingly.
 #KT-23362
2018-04-10 22:51:46 +03:00
Natalia Selezneva a58bc7f301 Fix transitive module dependencies for scripts 2018-04-10 14:07:04 +03:00
Natalia Selezneva 429e0afe2a Fix the way how script SDK is found in IDE 2018-04-10 14:06:45 +03:00
Natalia Selezneva 8d9f539c79 Return correct ProjectFacade for script and its dependencies
^KT-22588 Fixed
2018-04-10 14:06:34 +03:00
Natalia Selezneva d75d0d8711 Refactor ScriptDependenciesModuleInfo
Do not mix ScriptDependenciesInfo for all project and for concrete script.
Rename ScriptDependenciesModuleInfo to ScriptDependenciesInfo
Rename ScriptDependenciesModuleSourceInfo to ScriptDependenciesSourceInfo
2018-04-10 14:06:29 +03:00
Natalia Selezneva 37a95765cb Add scriptDependencies moduleInfo for scripts located in module source 2018-04-10 14:06:16 +03:00
Natalia Selezneva c1dd86d323 Use module name from userData to get module info for scratch file 2018-04-10 14:06:09 +03:00
Pavel V. Talanov de71598794 Fix line markers for actual enum entries
#KT-22632 Fixed
2018-04-04 17:56:35 +02:00
Pavel V. Talanov 36d23e4501 Refactor: merge synonymous utils 2018-04-04 17:56:33 +02:00
Pavel V. Talanov 784936eb00 Show 'actual/expect' icons for declarations in addition to visibility 2018-04-04 17:56:33 +02:00
Pavel V. Talanov c86a6cf21d Minor: rename expect/actual icon constants
Reflect icons' content
2018-04-04 17:56:32 +02:00
Pavel V. Talanov 9c9cdee7f0 Refactor: move utils related to expect/actual declarations and MPPs
Move them to 'idea-analysis' module
2018-04-04 17:56:32 +02:00
Ilya Chernikov da56f54982 Use script compiler options on script dependencies in the IDE as well
further fixes #KT-19120
2018-04-04 16:58:14 +02:00
Natalia Selezneva 3d73786e98 Highlight scripts according to ScriptLocation annotation in ScriptDefinition 2018-03-30 14:43:17 +03:00
Dmitry Jemerov 9516c638ea Use more efficient file type check (avoid identifying file type by file) 2018-03-29 13:11:37 +02:00
Dmitry Jemerov 85ebe97597 Avoid unnecessary collection copy (KT-23384) 2018-03-29 13:11:36 +02:00
Mikhail Zarechenskiy 81ac3a4f2f Add ability to enable new inference in the platform 2018-03-28 18:32:28 +03:00