Commit Graph

489 Commits

Author SHA1 Message Date
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov 61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
Mikhail Zarechenskiy a63495aa0b Use language version settings of definitely known module 2017-09-15 08:16:25 +03:00
Mikhail Zarechenskiy b1d9abdf83 Propagate languageVersionSettings to resolution context 2017-09-14 18:27:34 +03:00
Mikhail Glukhikh 92215b41b9 Replace resolveToDescriptor with unsafeResolveToDescriptor
Now unsafeResolveToDescriptor is equivalent to resolveToDescriptorIfAny
but throws exception in case no descriptor is found.
Old version of resolveToDescriptor is kept intact but made deprecated.
Some clarifying comments were added
2017-09-14 17:20:37 +03:00
Mikhail Glukhikh 0f9d31c9d1 Patch resolveToDescriptorIfAny() for parameter case
Now property descriptor is returned for primary constructor val / var,
otherwise parameter descriptor is returned.
2017-09-14 15:08:06 +03:00
Mikhail Glukhikh 04b8f1db6e Minor: convert to expression body applied (resolutionApi) 2017-09-14 15:08:05 +03:00
Denis Zharkov b905ddeac9 Memoize deprecations-related computations
It might be helpful for performance as these methods are called
for each resolution candidate and in the same time they scan
the whole overridden tree of a callable member
2017-09-13 15:34:14 +03:00
Alexander Udalov f01e0ef335 Minor, rename renderer configuration parameter 2017-08-25 15:35:04 +03:00
Dmitry Jemerov 83a1d6e5ca Avoid exception from autoimport fix with misconfigured analyzer 2017-08-24 16:55:01 +02:00
Mikhail Glukhikh 3623f581b8 Eliminate a set of warnings, mostly nullability ones 2017-08-18 15:10:27 +03:00
Mikhail Glukhikh a12877e51c Add feature support for "smart casts on variables in closures"
So #KT-14486 Fixed
2017-08-16 12:34:04 +03:00
Alexey Tsvetkov 46a3a59b81 Fix missing lookups from deserialized JS descriptors 2017-08-10 21:19:42 +03:00
Dmitry Jemerov aafe7e6f1b Refactoring: move createResolverForModule() into ResolverForProjectImpl 2017-08-09 13:26:09 +02:00
Valentin Kipyatkov e52c3b4c81 Rewritten KDoc-link resolve and completion to work more reasonably 2017-08-08 22:06:04 +03:00
Valentin Kipyatkov 998814b1a1 Support for import aliases in both resolve and completion in KDoc 2017-08-08 22:06:04 +03:00
Valentin Kipyatkov 9361cd895c Support for import aliases in code completion
#KT-8848 Fixed
2017-08-08 22:06:04 +03:00
Alexander Udalov 4e77897bfd Pass LanguageSettingsProvider to AnalyzerFacade explicitly
This way is more flexible for example for tests, where configuring the
service implementation may be tricky (it's usually done in
KotlinCoreEnvironment in production code)
2017-07-28 20:15:28 +03:00
Simon Ogorodnik 094125c970 KT-19154: Fix auto-import to check receiver for members properly
#KT-19154 fixed
2017-07-25 16:16:57 +03:00
Alexey Sedunov e98af7bfc1 Create Class from Usage: Use type parameter bounds as supertypes
#KT-15242 Fixed
2017-07-17 16:09:55 +03:00
Simon Ogorodnik cc8933c82b KT-17074: Make completion respect DslMarker's
#KT-17074 fixed
2017-07-14 21:06:43 +03:00
Mikhail Glukhikh dfe2c16bc7 More cleanup: lift return / assignment out 2017-07-10 12:59:58 +03:00
Mikhail Glukhikh 1d2017b0fc Cleanup: apply "cascade if..." inspection (+ some others) 2017-07-07 18:15:32 +03:00
Mikhail Glukhikh 9c06739594 Cleanup: apply "lift out..." inspection (+ some others) 2017-07-07 18:15:30 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Mikhail Zarechenskiy f8617f6676 Adapt collecting synthetic constructors in IDE for completion 2017-06-16 16:44:53 +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 e67e0440bb Rename LexicalScope.Empty -> Base
"Empty" is slightly confusing because although the scope has no declared
symbols, it is not empty: it has a parent scope which can contain
symbols and can have parents as well
2017-06-05 10:27:38 +03:00
Pavel V. Talanov 40561dabed J2K JavaToKotlinClassMap 2017-05-16 22:00:58 +03:00
Mikhail Zarechenskiy 429f0e4f68 Adapt changes in IDE after moving SAM adapters to synthetic scope
The main change is that now to get static sam adapters one should do it using synthetic scopes and static scope of container
2017-05-05 21:30:10 +03:00
Alexey Sedunov fd41e266fb Quick Fixes: Add/remove 'suspend' in hierarchy
#KT-15903 Fixed
2017-04-24 14:55:37 +03:00
Alexey Sedunov c492f339e6 Quick Fixes: Fix AssertionError on rendering type parameter
#KT-17404 Fixed
2017-04-21 13:32:33 +03:00
Alexander Udalov a96b67ea29 Refactor, move TargetPlatform to ModuleInfo 2017-04-18 22:58:56 +03:00
Simon Ogorodnik 2380e0bacc Optimize PluginDeclarationProviderFactory.getStubBasedPackageMemberDeclarationProvider
Add cache for fast package exists check in specific module
 #KT-16850 fixed
2017-04-18 17:58:45 +03:00
Simon Ogorodnik 9ca65fcf99 Fix addition of wrong java.lang imports on optimize imports
Add check to star importer, to not import already imported fqNames
 #KT-15273 fixed
2017-04-18 17:45:45 +03:00
Alexander Udalov 7fe9b99087 Support different target platforms for modules in AnalyzerFacade
Instead of reusing the same AnalyzerFacade that is used for resolution
of a module to resolve its dependencies, analyze each dependency
module/library with a facade depending on its target platform. Introduce
and use CommonLibraryDetectionUtil in addition to
KotlinJavaScriptLibraryDetectionUtil, to detect common libraries (with
.kotlin_metadata files).

Note that before multi-platform projects, this was not needed because
there were only two platforms (JVM and JS), and JVM module had only JVM
modules/libraries as dependencies, JS module had only JS
modules/libraries as dependencies. Now, for example, a JVM module can
have a common module/library as a dependency, and it would be incorrect
to analyze that dependency with JvmAnalyzerFacade because that facade
does not know anything about .kotlin_metadata files.

The changes in Dsl.kt and KotlinCacheServiceImpl.kt are needed because
PsiElement.getJavaDescriptorResolver, called from some IDE code, started
to fail on a common module, because the container for a common module
does not have the JavaDescriptorResolver
2017-04-14 00:44:00 +03:00
Mikhail Glukhikh aed98a745e Do not use KtClassInitializer as analyzable parent
Fixes analyzeFully() semantics making it closer to compiler
Fixes two flaky tests for "leaking this" quick-fixes
2017-04-07 15:35:58 +03:00
Ilya Gorbunov dce0da68c6 Cleanup: post-cleanup after deprecation cleanup in compiler
Replace `takeIf { !expr }` with `takeUnless { expr }`.
Cleanup redundant parethesis as in `listOf((expr))`.
Replace `listOf(expr)` with `expr.let(::listOf)` where the former caused significant indentation change.
2017-03-23 16:48:38 +03:00
Valentin Kipyatkov b5dd2cc540 Completion of lambda parameters
Also changed policy for sorting of smart completion items in basic completion

 #KT-16800 Fixed
 #KT-12002 Fixed
2017-03-20 19:08:02 +03:00
Simon Ogorodnik f56af41d1e Fix TypeAliasConstructorDescriptor's to create only once when required
Some IDE features relates onto that same descriptors will remain same
between resolve calls
Fix it to be true for TypeAliasConstructorDescriptor's

 #KT-16265 fixed
2017-03-20 16:55:40 +03:00
Pavel V. Talanov babb3b557d J2K ImportPath: kotlinify 2017-03-15 20:51:17 +03:00
Simon Ogorodnik 5c4ba53f42 Optimization of Basic Code Completion
Now we first search for simple reference variants, then for extensions
 Because extension search is slow
 #KT-16856
2017-03-15 17:50:29 +03:00
Simon Ogorodnik 4906ddfc29 Optimization of Basic Code Completion
Now we don't perform code formatting on temporary psi used
  in ShadowedDeclarationFilter
  #KT-16856
2017-03-15 17:50:20 +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
Alexander Udalov cf7048dd0f Do not inject CompilerConfiguration into compiler front-end
Inject LanguageVersionSettings instead; all information relevant to the
analysis should be now passed via an instance of LanguageVersionSettings
(which should be renamed to a more general name in the future).

This is partially a revert of d499998 and related commits
2017-03-15 11:02:59 +03:00
Alexander Udalov f5d4dd33da Inject JvmTarget into some JVM-specific call checkers
This makes it possible to drop CompilerConfiguration from
CallCheckerContext, which in turn helps to avoid passing the entire
CompilerConfiguration instance through front-end
2017-03-15 11:02:57 +03:00
Nikolay Krasko 0a7a73d4be Refactoring: extract method for getting lexical scope without facade 2017-03-10 14:58:16 +03:00
Dmitry Jemerov c6bfb02754 Move JsAnalyzerFacade to ide-common module to enable its use in Dokka 2017-02-21 18:39:21 +01:00