Commit Graph

1846 Commits

Author SHA1 Message Date
Nikolay Krasko 6ca5ba3615 Don't call getClassDescriptor for local declarations (KT-15259)
#KT-15259 Open
2016-12-21 13:13:10 +03:00
Nikolay Krasko c076ad5a8d Don't assign type parameters from original proto if type is substituted with Any (KT-15128)
#KT-15128 Fixed
2016-12-20 15:16:23 +03:00
Dmitry Jemerov bc22b67995 Index and locate .kotlin_metadata files in IDE 2016-12-19 17:40:13 +01:00
Alexey Sedunov a84275b057 Minor: Rename "Default" platform to "Common" 2016-12-19 18:31:46 +03:00
Alexey Sedunov 332d1f6405 Multi-platform Projects: Enable multi-platform projects for platform modules which depend on common modules 2016-12-19 18:27:49 +03:00
Alexey Sedunov eac0c9b2ed Kotlin Facet: Add "Use project settings" option 2016-12-19 18:27:47 +03:00
Denis Zharkov f0cda8ac8d Fix indexing of suspend function types 2016-12-15 23:58:27 +03:00
Mikhail Zarechenskiy feefe8d6ff Propagate coroutine settings support from facet into the language version settings 2016-12-15 23:58:10 +03:00
Dmitry Petrov 80bd916f5d 'SuspendFunction$n' should not be visible in member scopes (should be unresolved).
'SuspendFunction$n' class descriptors are created on demand by KotlinBuiltIns (and cached).
On serialization, types constructed with 'SuspendFunction$n' are written as 'Function$n' with extra flag (SUSPEND_TYPE).
On deserialization, corresponding 'SuspendFunction$n' classes are used.
2016-12-15 23:58:05 +03:00
Stanislav Erokhin 6b4cdee887 Fix deserialization for SuspendFunction. 2016-12-15 23:57:57 +03:00
Stanislav Erokhin 42440f50dc Remove soft keyword coroutine & isCoroutine from ValueParameterDescriptor. 2016-12-15 23:57:56 +03:00
Dmitry Petrov 9dc458375a Build proper modifier list stubs for 'SuspendFunction$n<...>' types. 2016-12-15 23:57:43 +03:00
Dmitry Petrov cf4fb1eb25 Since '@A R.() -> T' is now parsed as '@A (R.() -> T)',
receiver type with modifiers or annotations should be surrounded in parentheses on rendering: '(@A R).() -> T'

This also fixes stub builder tests (which check that stubs are consistent with rendered descriptors).
2016-12-15 23:57:42 +03:00
Dmitry Petrov a15d423db4 Support modifiers on types in parser
(required for 'suspend' on functional types).

TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.

Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.

Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.

In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
2016-12-15 23:57:41 +03:00
Nikolay Krasko ab04f900df Add name of script file to script module info 2016-12-15 14:33:16 +03:00
Nikolay Krasko e359b9b6de Remove the code for idea 144 2016-12-15 14:33:13 +03:00
Nikolay Krasko 88b3d9ff3f Make sdk info and library info difference more clear in debugger 2016-12-15 14:33:11 +03:00
Mikhail Glukhikh 7649232f86 Platform header annotator: implementation + simple multi-platform highlighting tests #KT-14905 Fixed 2016-12-13 19:02:23 +03:00
Mikhail Glukhikh 57da92b862 Infrastructure change: module descriptor now knows its platform kind & its sources kind 2016-12-13 18:53:55 +03:00
Mikhail Glukhikh 04df23941f Minor fix of problem with non-existent ProjectFileIndex 2016-12-13 18:53:44 +03:00
Dmitry Jemerov baad540516 Workaround for added @NotNull annotation on ProjectFileIndex.getInstance() 2016-12-13 12:40:03 +01:00
Stanislav Erokhin dbe8edda5f Remove propertyDelegate and fix unused parameter checker for provideDelegate. 2016-12-12 23:14:09 +03:00
Stanislav Erokhin 9dc9fb578f Rename toDelegateFor to provideDelegate. 2016-12-12 23:14:07 +03:00
Dmitry Petrov e2b6d2d849 Drop 'propertyDelegated' convention (without additional deprecation ceremony). 2016-12-12 23:13:58 +03:00
Dmitry Jemerov 2cc42ba151 Highlight code fragments only when they have a context (part of EA-84233 - assert: GetModuleInfoKt$getModuleInfo$.invoke) 2016-12-12 17:50:27 +01:00
Dmitry Jemerov d5e90b4123 Remove unnecessary uses of getContainingKtFile() (EA-83360 - CCE: KtElementImplStub.getContainingKtFile) 2016-12-12 17:50:11 +01:00
Dmitry Jemerov a7bd910dbb Don't try to calculate icon for invalid PSI elements
#KT-13443 Fixed
2016-12-12 16:24:51 +01:00
Yan Zhulanow cbef0250aa Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848) 2016-12-09 20:01:21 +03:00
Alexander Udalov 789483e1eb Remove old mechanism of metadata version error reporting 2016-12-09 01:59:36 +03:00
Alexey Andreev 85733b47f3 Add support of external modifier in classes and properties to IDEA stub builder 2016-12-08 15:41:44 +03:00
Nikolay Krasko fc5b493fd3 Run full resolve in debugger with write action priority (KT-14602)
#KT-14602 Fixed
2016-12-07 17:32:38 +03:00
Nikolay Krasko 726471d98e Avoid loading psi for compiled kotlin file if it's possible to get declaration by name from stubs 2016-12-05 17:22:42 +03:00
Alexey Sedunov 9a4fa3a871 Presentation: Add icons for type aliases 2016-11-30 14:35:27 +03:00
Nikolay Krasko dc1e3ae441 Allow to search builtins descriptors in stubs by name 2016-11-28 14:38:34 +03:00
Nikolay Krasko 3537673417 Don't enable search stub declaration by name if file doesn't contain descriptor key
This might cause irrelevant declarations found with the same name.
2016-11-28 14:38:34 +03:00
Nikolay Krasko b816c182f0 Try to avoid loading ast for decompiled files (KT-14804)
#KT-14804 Fixed
2016-11-28 14:38:34 +03:00
Alexander Udalov 0dc31af73d Introduce KotlinMetadataFinder#hasMetadataPackage
Before creating a MetadataPackageFragment, check that the corresponding
directory (across the classpath) contains at least one .kotlin_metadata file.
Otherwise we're creating packages for every simple name queried during the
resolution and sometimes prefer a (empty) package to the existing class, for
example when the latter class is star-imported
2016-11-25 20:50:15 +03:00
Alexander Udalov bfb7b21472 Load definitions of symbols from .kotlin_metadata files
Extract AbstractDeserializedPackageFragmentProvider out of
JvmBuiltInsPackageFragmentProvider and implement it a little bit differently in
MetadataPackageFragmentProvider. The main difference is in how the package
fragment scope is constructed: for built-ins, it's just a single scope that
loads everything from one protobuf message. For metadata, package scope can
consist of many files, some of which store information about classes and others
are similar to package parts on JVM, so a ChainedMemberScope instance is
created.

Introduce a bunch of interfaces/methods to deliver the needed behavior to the
'deserialization' module which is not JVM-specific and does not depend on the
compiler code: MetadataFinderFactory,
PackagePartProvider#findMetadataPackageParts, KotlinMetadataFinder#findMetadata.
Note that these declarations are currently only implemented in the compiler; no
metadata package parts/fragments will be found in IDE or reflection
2016-11-25 20:50:13 +03:00
Alexey Andreev 20669c1b97 JS: fix building stubs for JS library that contains classes in default package 2016-11-24 17:49:11 +03:00
Dmitry Jemerov 1570886be3 Don't throw exception when resolving out-of-content-root PSI elements to descriptors (EA-92177 assert: ResolverForProjectImpl.descriptorForModule) 2016-11-23 18:29:25 +01:00
Dmitry Jemerov 956e1c70dc Provide toString() for classes that extend GlobalSearchScope (to diagnose package fragment errors) 2016-11-23 18:29:24 +01:00
Dmitry Jemerov ebbbe1b801 Include exception in report, not only log it (EA-90231 - assert: ClsJavaStubByVirtualFileCache.createStub) 2016-11-23 18:29:22 +01:00
Dmitry Jemerov f9f590d270 More diagnostics for EA-85926 and EA-77163 2016-11-23 18:29:21 +01:00
Alexander Udalov 22e1221c75 Support "default platform" in IDE via facet settings 2016-11-22 18:19:02 +03:00
Dmitry Jemerov baf321a193 Highlight escape sequences in character literals
#KT-13795 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov b742c8a63d Implement "Show non-public" filter for Kotlin structure view
#KT-14217 Fixed
2016-11-22 13:20:35 +01:00
Dmitry Jemerov f586eebe16 KotlinStructureViewModel: cleanup after J2K 2016-11-22 13:20:35 +01:00
Dmitry Jemerov 4b591bf41f KotlinStructureViewModel: J2K 2016-11-22 13:20:35 +01:00
Dmitry Jemerov bf97e64c1d KotlinStructureViewModel: rename to .kt 2016-11-22 13:20:35 +01:00
Dmitry Jemerov f4ce63f6d7 Collect local declarations under properties (KT-14215); improve presentation of object declarations
#KT-14215 Fixed
2016-11-22 13:20:35 +01:00