Commit Graph

37833 Commits

Author SHA1 Message Date
Dmitry Jemerov f0e890797a Disable "Create type alias from usage" fix when language level doesn't support type aliases
#KT-16036 Fixed
2017-01-30 12:37:31 +01:00
Dmitry Jemerov 17c73cea7f Disable "Introduce type alias" refactoring when type aliases aren't supported by the current language level 2017-01-30 12:37:31 +01:00
Dmitry Jemerov 720da176db Exclude keywords from completion if the corresponding feature is unsupported by the language level selected for the module 2017-01-30 12:32:41 +01:00
Alexander Udalov eb61a1c5a8 Make KTypeProjection's constructor public
To make it easier to create a KTypeProjection instance given a KVariance
instance (otherwise you currently need to do a "when" on it). Also it's exposed
via automatically generated "copy" anyway
2017-01-30 11:31:20 +03:00
Alexander Udalov e5680565b3 JS: drop "-kjsm" flag, merge logic with "-meta-info"
#KT-16049 Fixed
2017-01-30 11:31:03 +03:00
Alexander Udalov 17b0b7704f JS: minor, drop obsolete VFS_PROTOCOL 2017-01-30 11:31:02 +03:00
Alexander Udalov ef42e3e4aa JS: write full version (major.minor.patch) to .meta.js 2017-01-30 11:31:02 +03:00
Alexander Udalov 038e4da83c Do not crash JS decompiler on non-existing .jar entries
See the comment for clarification
2017-01-30 11:31:02 +03:00
Alexander Udalov b5fef84e9c Update tests on decompiled text for JS
Because .kjsm files now contain all declarations from the package (contrary to
the JVM decompiler which produces one file for one class/package facade), some
common decompiled text tests started to behave differently on JVM and JS.
Update two of them (Modifiers, ClassWithClassObject) to make results the same,
copy another (TypeAliases) to JVM-/JS-specific tests with different outputs
2017-01-30 11:31:02 +03:00
Alexander Udalov 805e3e4d0f Drop tests on JS decompiled text / stub consistency
They're no longer needed because the logic of the decompiler / stub builder is
now trivial (see KotlinJavaScriptDeserializerForDecompiler,
KotlinJavaScriptStubBuilder) and after it's merged to the decompiler for
built-ins, it's going to be tested anyway with BuiltInDecompilerConsistencyTest
2017-01-30 11:31:02 +03:00
Alexander Udalov 1045689911 JS: simplify KotlinJavascriptSerializationUtil
Inline recently introduced SerializerCallbacks
2017-01-30 11:31:02 +03:00
Alexander Udalov 63c24c56ec JS: serialize .kjsm package-wise, adapt decompiler & stub builder
Instead of multiple .kjsm files for different classes and .kotlin_string_table,
.kotlin_file_table, .kotlin_classes files for each package, serialize the
contents of each package to a single foo/bar/baz/baz.kjsm file. The short name
of the file is the last segment in the FQ name of the package, or
"root-package" if the package is root.

There are two main reasons for this change:
1) Such structure takes less space, is more IO-friendly and will not cause
   multiple exceptions as the old one, where we sometimes tried to read
   non-existing files
2) This is exactly the same format that is used to serialize built-in
   declarations (.kotlin_builtins) at the moment, which will allow us to reuse
   some code

Also write a separate Header protobuf message to the beginning of the .kjsm
file. This will be used as arguments of the kotlin.Metadata annotation are used
in the JVM-specific parts of the compiler: to be able to provide some general
information about the binary file without parsing the whole protobuf data.

This commit breaks decompiled text & stub builder consistency tests. This is OK
because they're removed in a future commit.

Fixes EA-79605, EA-81947, EA-84277 and maybe EA-86787

 #KT-10894 Fixed
 #KT-14124 Fixed
 #KT-15755 Fixed
2017-01-30 11:31:02 +03:00
Alexander Udalov 46bf057b47 JS: do not generate .meta.js and .kjsm for built-ins 2017-01-30 11:31:02 +03:00
Alexander Udalov 4b81dfb7c1 JS: improve binary representation format of metadata in .meta.js
Instead of writing many different files and serializing this "virtual file
system" to a byte array in a protobuf message, just write the needed stuff
directly, as fields in the Library message. Make it consist of many Part
messages, where the Part message is equivalent to the BuiltIns message in
builtins.proto. The next step would be to combine Library.Part and BuiltIns,
which will allow us to simplify some serialization-related code soon.

In this commit, no changes happened to the .kjsm format. But since the code
that serialized the abovementioned files was shared, a temporary abstraction
over two serialization formats was made, see SerializerCallbacks.

This commit temporarily breaks .kjsm decompiler and stub builder
2017-01-30 11:31:01 +03:00
Dmitry Petrov 77ea0614f9 Fix testData in smart completion test
(abbreviation is preserved for 'arrayListOf').
2017-01-30 10:51:47 +03:00
Vyacheslav Gerasimov 7bd6314ee1 Implemented building Kotlin Android projects with Jack toolchain enabled
#KT-13275 Fixed
Implemented KotlinJillTask for converting kotlin classes to jace format which could be consumed by Jack transform task
2017-01-29 23:39:53 +03:00
Zalim Bashorov 29ac01f2e2 KJS: allow to use packages with names starting with "kotlin" only if the -Xallow-kotlin-package command line option is specified
#KT-14668 Fixed
2017-01-29 17:21:01 +03:00
Ilya Gorbunov 7195e26ae2 Rollback Closeable.use implementation as it was in 1.0 in order not to call functions that were introduced in 1.1 from this inline function.
#KT-16026
2017-01-29 02:41:12 +03:00
Ilya Gorbunov 36436ae240 Maven build: change module build order. 2017-01-29 01:15:14 +03:00
Simon Ogorodnik b422b0e24d KT-14722 completion list isn't filled up for typealias to object
#KT-14722 fixed
2017-01-28 21:42:39 +03:00
Stanislav Erokhin e38ca44595 Create different KotlinBuiltIns for modules with different language feature settings.
For sdkModule we create builtIns with default language feature settings.
Also when we create sdkModuleResolverProvider we create builtIns cache.
Then for every other module we get builtIns cached by value isAdditionalBuiltInsFeatureSupported.
2017-01-28 19:13:48 +01:00
Ilya Chernikov 7c0cdf90cf Move daemon session flag files to daemon discovery dir by default + minor fixes:
- Move flag files from the temp dir, because right now JPS cleans temp dir on each build start. Should fix KT-15707, also may affect KT-15562.
- change compiler runner to allow the fix above
- Fix flag file name filtering
- Fix ifAlive handling on the new compile method in the daemon.
2017-01-28 15:36:06 +01:00
Dmitry Jemerov ddbb476211 Add quickfix to increase language level by editing build.gradle 2017-01-28 13:14:39 +01:00
Dmitry Jemerov c170c7b98f Add quickfix to enable coroutines by editing build.gradle
#KT-15955 Fixed
2017-01-28 13:14:39 +01:00
Dmitry Jemerov da6640971f Import new Gradle coroutines DSL setting into Kotlin facet 2017-01-28 13:14:39 +01:00
Dmitry Jemerov c7115e7233 Copy language and API version from compiler options to version info 2017-01-28 13:14:39 +01:00
Stanislav Erokhin 6ef96017e8 Mute test and create issue KT-15972. 2017-01-28 03:25:47 +03:00
Stanislav Erokhin ec2eec33e3 Added hint url for coroutines and multiplatform diagnostics. 2017-01-28 03:25:45 +03:00
Stanislav Erokhin b033ad1b2b Add positioning strategy DECLARATION_NAME for DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE. 2017-01-28 03:25:44 +03:00
Stanislav Erokhin 2aa2df75ae Make property java available on KClass<T> where T is type parameter without upper bounds. 2017-01-28 03:25:43 +03:00
Ilya Chernikov bd47337be2 Using stdlib instead of runtime in the JSR 223 engines 2017-01-27 22:20:45 +01:00
Ilya Chernikov b8b044c6b0 Reuse script args substitution for replacing bindings in JSR 223 sample engines, fixes KT-15450 2017-01-27 22:20:44 +01:00
Ilya Chernikov b86ed0c5d9 Comment out failing test part - temporary, see TODO 2017-01-27 22:20:44 +01:00
Ilya Chernikov 0b689a4ecb PR-1021 review: minor fixes
# Conflicts:
#	compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/GenericReplCompilingEvaluator.kt
#	compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/GenericReplEvaluator.kt
#	compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt
2017-01-27 22:20:44 +01:00
apatrida 5ad06e1e92 PR-1021: Merge Keplin project scripting code into Kotlin core.
Overhauls the scripting layers (GenericRepl and related, and JSR223 and related)
Adds repeating modes (none, only latest eval'd line, or random order)
Also adds better thread-safe IO capturing, default imports, SimpleRepl wrapper, more unit tests

NOTE: the script-util part of the pull request was rejected due to various problems and incompatibilities.
It may be incorporated into the code later.

(originally cherry picked from commit 6f7d517)
2017-01-27 22:20:44 +01:00
Ilya Chernikov 8caf607378 PR-1021 preparations: prepare files to preserve important history
- Split GenericRepl.kt into separate files
- Rename Repl.kt
2017-01-27 22:20:44 +01:00
mglukhikh 34dd259900 Changelog 1.1.0: issue 15790 removed 2017-01-27 23:40:25 +03:00
Mikhail Glukhikh d8a4a32e9f Do not report UNUSED_PARAMETER in function literal for 1.0 compatibility mode #KT-16010 Fixed 2017-01-27 23:39:08 +03:00
Mikhail Glukhikh 9fdf16e5d7 Quick-fix to add 'suspend' to the receiver of startCoroutine / createCoroutine #KT-15738 Fixed 2017-01-27 23:39:04 +03:00
Mikhail Glukhikh 5f455bbe3a Do not suggest renaming to underscore in 1.0 compatibility mode #KT-16019 Fixed 2017-01-27 23:39:01 +03:00
Mikhail Glukhikh 67e207acb0 Do not suggest destructuring in function literal in 1.0 compatibility mode #KT-15134 Fixed 2017-01-27 23:38:59 +03:00
Mikhail Glukhikh 3cd4d7cbfe Operator to function: rem or mod depending on version #KT-15969 Fixed 2017-01-27 23:38:57 +03:00
Roman Elizarov a1571657f3 Updated test to experimental package 2017-01-27 23:24:13 +03:00
Roman Elizarov 8dc318dd92 Fixed KT-15963 (coroutines machinery should not use equals on results) 2017-01-27 23:24:13 +03:00
Denis Zharkov c362a9154b Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED 2017-01-27 23:24:13 +03:00
Denis Zharkov 246946bc18 Move buildSequence/buildIterator to kotlin.coroutines.experimental 2017-01-27 23:24:13 +03:00
Denis Zharkov 35e9f0a89a Update a test result temporary
Currently common stdlib doesn't contain Continuation interface
2017-01-27 23:24:13 +03:00
Denis Zharkov 68fc6fa217 Support non-CoroutineImpl instances in createCoroutine 2017-01-27 23:24:13 +03:00
Denis Zharkov 463af85f78 Minor. Update light-classes test data after coroutine-related changes 2017-01-27 23:24:13 +03:00
Denis Zharkov 1d5144b168 Move coroutine-related diagnostic tests to run them with stdlib
It's necessary because all coroutine related declarations (Continuation, etc)
are now in the stdlib
2017-01-27 23:24:13 +03:00