db5303c019
IDE: Rewrite AnalyzerFacade and implementations for JS and JVM to support creating separate analyzers for each module Introduce ModuleInfo which is an intermediate entity between configuration (tests or idea modules) and ModuleDescriptor Implement IdeaModuleInfos which represent IDEA modules, sdks and libraries Add (somewhat thin) test checking their behaviour Implement getModuleInfo() - utility to obtain IdeaModuleInfo for PsiElement Drop Project.getLazyResolveSession() - not possible to obtain resolve session for the whole project any more Adjust JavaResolveExtension accordingly KotlinSignature Intention/Marker - make sure that analyzed element is cls element (he's not in resolve scope otherwise) LightClasses: Create separate package light classes for each module Java code can only reference light class from the first module among it's dependencies Duplicate jvm signature is only reported on package declarations inside one module Injectors: Receive GlobalSearchScope as paramer for VirtualFileFinder and JavaClassFinder which allows to narrow analyzer scope JDR: Introduce ModuleClassResolver resolves java classes in correct java descriptor resolver (corresponding ModuleDescriptor) Add test checking that java classes belong to correct module Debugger: Provide context to analyze files created by debugger in Converter: Postprocessor now needs a context to analyze resulting code in JetPsiFactory: Add verification that files created by psi factory are not analyzed without context (that is almost never a good idea) Other: Use new API in various tests, utilities, run configuration producers and builtin serializers Various "TODO: (module refactoring)" which mark the unfinished parts
JavaScript Translation
This module performs the translation of Kotlin source code to JavaScript.
There are various Kotlin APIs to JavaScript environments and libraries in the js.libraries project.
Compiling the standard Kotlin library to JavaScript
- the kotlin-js-library module creates a jar containing all the Kotlin source code for the runtime and standard kotlin library code (both definitions and implementation code) to be compiled to JavaScript.
- the kotlin-js-tests module then compiles a selection of test cases from the Kotlin standard library for the JVM to JavaScript. These tests can then be run in a web browser using QUnit
- the kotlin-js-tests-junit then runs the JavaScript tests for the standard library inside JUnit using Selenium and the underlying JavaScript & QUnit so that the JavaScript can be tested as part of the maven continuous integration build.
Reusing JVM based test cases in JavaScript
Any Kotlin test cases using the org.junit.Test annotation and the kotlin.test package, such as this test case are automatically converted to JavaScript using QUnit.
This allows the test cases to be ran directly in a web page in any web browser.
Using the Kotlin Library in JavaScript
There is a simple sample which shows how to use the Kotlin Standard Library from inside JavaScript in a web page or in a JVM using kool.io's JavaFX browser
Contributing
We love contributions! The JavaScript translation could really use your help! If you fancy contributing:
- check the contributing section on general stuff like getting the code etc
- here's the list of current excluded standard library unit tests from the JavaScript JUnit test run; see if you can fix one of those? (Check the TODO commands and the links to specific issues)
- try fix one of the pending JavaScript translation issues