Compare commits

...

313 Commits

Author SHA1 Message Date
teamcity
aaa3c5cf51 Auto-merge beta4 with beta4 2016-01-19 15:13:59 +03:00
Nikolay Krasko
2dd1f1569b Dummy change to see build in TeamCity dependencies 2016-01-19 14:22:15 +03:00
teamcity
5703ce9ba2 Auto-merge beta4 with beta4 2016-01-18 20:06:09 +03:00
Zalim Bashorov
2f8b891552 Don't fail when create IncrementalCacheImpl for target without output directory, and fail when try to use this info instead.
#KT-10505 Fixed
(cherry picked from commit c1dbfee)
2016-01-18 18:06:51 +03:00
Zalim Bashorov
d31a066145 Don't fail when output directory not specified for "friend" build target
#KT-10505 Fixed
(cherry picked from commit d9af947)
2016-01-18 18:06:41 +03:00
Zalim Bashorov
9de637a159 Report error when output directory not specified for build target
#KT-10505 Fixed
(cherry picked from commit 3df091e)
2016-01-18 18:06:32 +03:00
Natalia Ukhorskaya
43fcadae3f Gradle plugin: fix compatibility with android-gradle plugin 2.0.0-alpha5
#KT-10676 Fixed
(cherry picked from commit d4fcb59)
2016-01-18 17:36:35 +03:00
teamcity
59cb6d360e Auto-merge beta4 with beta4 2016-01-13 00:21:38 +03:00
Nikolay Krasko
53f92f35d4 Remove assert that isn't valid in UpSource (UP-5742) 2016-01-12 21:41:54 +03:00
teamcity
53a65efb9d Auto-merge beta4 with beta4 2016-01-11 15:00:18 +03:00
Michael Bogdanov
b4840bddc5 Always generate ACC_SUPER flag for all classes; Fix for KT-10260: java.lang.VerifyError in Android 4.x when Instant Run is used
#KT-10260 Fixed
(cherry picked from commit 0274ce4)
2016-01-11 13:02:34 +03:00
teamcity
9090d5d657 Auto-merge beta4 with beta4 2015-12-23 18:03:09 +03:00
Pavel V. Talanov
3b253d10f3 Fix a problem caused by getting project using an invalid psi element 2015-12-23 16:47:40 +03:00
Yan Zhulanow
19c3382a19 Always compile Android projects without JDK in classpath #KT-10479 2015-12-23 16:43:47 +03:00
Nikolay Krasko
46d364c4f6 Fix compilation in Idea 141 2015-12-22 18:35:31 +03:00
teamcity
8c2baf1618 Auto-merge beta4 with beta4 2015-12-22 17:38:26 +03:00
Dmitry Petrov
65a1c7b040 Fix KT-10472: compare all overloads including varargs in a single pass. 2015-12-22 17:10:55 +03:00
Stanislav Erokhin
0cffd955ea Hack for unavailable archive.apache.org: use bintray.com instead
(cherry picked from commit de6f520)
2015-12-22 16:47:43 +03:00
Nikolay Krasko
3847dd9794 Make add test lib quick-fix applicable only when there is unresolved import 2015-12-22 16:24:08 +03:00
Nikolay Krasko
bc5911e64b Add library for Gradle 2015-12-22 16:24:07 +03:00
Nikolay Krasko
6f96192e2f Determine maven library version from kotlin-stdlib 2015-12-22 16:24:07 +03:00
Nikolay Krasko
9f378345fc Add libraries to maven 2015-12-22 16:24:07 +03:00
Nikolay Krasko
760052b917 Add kotlin-test.jar to classpath quickfix 2015-12-22 16:24:07 +03:00
Nikolay Krasko
f3d7d034ea Bad testdata 2015-12-21 19:47:15 +03:00
teamcity
90eb9020fa Auto-merge beta4 with beta4 2015-12-21 18:22:13 +03:00
Nikolay Krasko
3c7a1fa98c Merge branch 'beta4' into beta4_/br141 2015-12-21 17:43:59 +03:00
Sergey Mashkov
035fe187c1 kotlin-test: exclude OnlyInpuType from dist kotlin-test as well 2015-12-21 15:50:46 +03:00
Sergey Mashkov
e1a0caa27b kotlin-test: exclude OnlyInputTypes annotation from jar 2015-12-21 15:50:38 +03:00
Sergey Mashkov
e0061f5f37 rename kotlin.test to kotlin-test 2015-12-21 15:50:27 +03:00
Nikolay Krasko
128ddd5237 Enable version auto-increment and bootstrapping 2015-12-21 13:52:18 +03:00
Dmitry Petrov
b8094b2073 Prohibit functions (and constructors) with multiple vararg parameters.
(cherry picked from commit fab072e)
2015-12-21 13:28:27 +03:00
teamcity
3f49ccd924 Auto-merge beta4 with beta4 2015-12-21 09:19:11 +03:00
Andrey Breslav
e3924564ed Reserve "async* {}", extend the quick-fix 2015-12-21 07:07:15 +03:00
Andrey Breslav
3bb8d69760 Minor. Additional test for "async {}" 2015-12-21 07:07:15 +03:00
Stanislav Erokhin
c926c135ca Completion fix for reserved 'async' syntax 2015-12-21 07:07:15 +03:00
Nikolay Krasko
8714672ced Quick fix for deprecated async syntax 2015-12-21 07:07:15 +03:00
teamcity
d5f32b626d Auto-merge beta4 with beta4 2015-12-19 12:02:16 +03:00
Ilya Gorbunov
bbc8941d76 Deprecate IndexingIterable and IndexingIterator and provide Iterator.withIndex() instead of the latter. 2015-12-19 09:58:28 +03:00
Ilya Gorbunov
2a18ab2d76 Deprecate some top-level constants to make 'em private later. 2015-12-19 09:58:26 +03:00
Nikolay Krasko
646122068e Merge remote-tracking branch 'origin/beta4' into beta4_/br141 2015-12-19 03:09:58 +03:00
Ilya Chernikov
280c41a64d Working around cancellation-related exception in case of different versions of daemon and client 2015-12-18 22:20:59 +01:00
Nikolay Krasko
bc94c6cd86 Merge tag 'build-1.0.0-beta-4524' into idea_continuous/br141 2015-12-18 20:50:12 +03:00
Nikolay Krasko
10a40d43a9 Compilation fix 2015-12-18 20:48:30 +03:00
Nikolay Krasko
2b124a6a7c Merge tag 'build-1.0.0-beta-4491' into idea_continuous/br141
Conflicts:
	idea/src/META-INF/plugin.xml
	j2k/tests/org/jetbrains/kotlin/j2k/AbstractJavaToKotlinConverterForWebDemoTest.kt
2015-12-17 20:39:14 +03:00
Nikolay Krasko
1a8dd30801 Bug in idea br141 inner classes generic parameter processing - disable tests 2015-12-17 20:08:33 +03:00
Nikolay Krasko
571f596920 Fix errors - remove builtins reference resolver 2015-12-17 14:20:36 +03:00
Nikolay Krasko
f8d9ba0fc5 Merge tag 'build-1.0.0-beta-4478' into idea_continuous/br141
Conflicts:
	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt
2015-12-17 13:36:57 +03:00
Nikolay Krasko
26e5fa7206 Test data reorder 2015-12-16 18:49:47 +03:00
Nikolay Krasko
18b1790a90 Junit 4.12->4.11 in br141 and modify test data for one test 2015-12-16 18:44:30 +03:00
Nikolay Krasko
2f1565badb Fix tests in debugger 2015-12-16 14:45:28 +03:00
Nikolay Krasko
4b94fb84f0 Revert "Revert "Original type is taken into account when intersecting possible types in resolve #KT-10232 Fixed""
This reverts commit 170a0393f6.
2015-12-15 22:03:01 +03:00
Nikolay Krasko
792b34936c Merge tag 'build-1.0.0-beta-4421' into idea_continuous/br141 2015-12-15 20:19:17 +03:00
Nikolay Krasko
f87e2633c0 Fix compile errors after merge 2015-12-15 18:00:52 +03:00
Nikolay Krasko
7c4c98fc20 Revert "Implement 'Skip simple getters' for debugger"
This reverts commit ea8de883ac.
2015-12-15 18:00:50 +03:00
Nikolay Krasko
b44215bc70 Fixes after merge 2015-12-15 18:00:37 +03:00
Nikolay Krasko
f52c3ae3ec Merge tag 'build-1.0.0-beta-4413' into idea_continuous/br141
Conflicts:
	core/descriptors/src/org/jetbrains/kotlin/builtins/BuiltInSerializerProtocol.kt
	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/KotlinDecompiledFileViewProvider.kt
	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/KtDecompiledFile.kt
	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/common/ProtoBufUtil.kt
	idea/src/META-INF/plugin.xml
	idea/src/org/jetbrains/kotlin/idea/debugger/KotlinPositionManager.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinBreakpointHandlerFactory.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinLambdaSmartStepIntoTarget.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinMethodSmartStepIntoTarget.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
	idea/src/org/jetbrains/kotlin/idea/highlighter/KotlinTestRunLineMarkerContributor.kt
	idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt
	idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInlinedFunctionalExpression.kt
	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java
	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java
2015-12-15 16:04:50 +03:00
Nikolay Krasko
0a35656c34 Revert "Update kotlin run configuration editor"
This reverts commit a19708693b.
2015-12-04 14:55:32 +03:00
Nikolay Krasko
1295c6fdd1 Merge tag 'build-1.0.0-beta-4093' into idea_continuous/br141 2015-12-04 14:53:56 +03:00
Nikolay Krasko
cad98a6906 Fix compilation errors in br141 in move dialog 2015-12-03 15:20:44 +03:00
Nikolay Krasko
49b1f78a9f Merge tag 'build-1.0.0-beta-4058' into idea_continuous/br141 2015-12-03 12:50:03 +03:00
Nikolay Krasko
d52896b601 Suppress failure in testInlineFunctionsCircularDependency tests 2015-12-02 19:27:35 +03:00
Nikolay Krasko
c503129083 Update test data in br141 2015-12-02 19:26:50 +03:00
Nikolay Krasko
dd9dfe0177 Mute "smap" test in br141 2015-12-02 18:27:30 +03:00
Nikolay Krasko
802dd0003b Fix smap test-data in br141 2015-12-02 18:27:06 +03:00
Nikolay Krasko
fd1cb69d29 Merge remote-tracking branch 'origin/master' into idea_continuous/br141 2015-12-01 20:53:29 +03:00
Nikolay Krasko
8a66175682 Revert idea_continuous/br141 settings 2015-12-01 20:49:16 +03:00
Nikolay Krasko
c2f8386b02 Workaround failure in testInlineFunctionsCircularDependency tests
There's difference in bytecode produced with non-incremental and incremental compilers between br141 and master because of ASM version
2015-12-01 19:35:38 +03:00
Nikolay Krasko
aa1a99a6eb Fix testdata in br141
- old ASM can't read multiple line numbers
- impossible to place breakpoint inside lambda
2015-12-01 19:26:32 +03:00
Nikolay Krasko
51f0cebba3 Revert line number update because of old ASM in br141 2015-12-01 18:52:50 +03:00
Nikolay Krasko
d82ef969ac Merge branch 'beta3' into idea_continuous/br141 2015-12-01 17:52:46 +03:00
Nikolay Krasko
50dcd08cb5 Enable auto-increment 2015-12-01 15:27:00 +03:00
Pavel V. Talanov
df6298de39 Minor, getModuleInfo: improve on failure messages 2015-12-01 14:55:41 +03:00
Pavel V. Talanov
a9c1e57230 getModuleInfo: Provide utility to default to null instead of logging an error
Use it to workaround cases when java resolve references some unexpected classes/files, referencing non-physical Dummy.java in particular
2015-12-01 14:55:39 +03:00
Pavel V. Talanov
378a964c2f getModuleInfo: Correct module info for members of light classes for decompiled Kotlin classes 2015-12-01 14:55:38 +03:00
Stanislav Erokhin
170a0393f6 Revert "Original type is taken into account when intersecting possible types in resolve #KT-10232 Fixed"
This reverts commit fe04cc513b.
2015-12-01 13:02:45 +03:00
Nikolay Krasko
95d4dd4962 Enable bootstrapping in branch 2015-12-01 00:02:09 +03:00
Nikolay Krasko
288248c964 Remove android extension plugin from relay 2015-11-30 23:58:28 +03:00
Nikolay Krasko
8d271d3d4d Disable clearing handlers in br141 - no such method 2015-11-30 20:47:35 +03:00
Nikolay Krasko
6c898b4c3e Fix compile errors after merge 2015-11-30 20:47:08 +03:00
Nikolay Krasko
0c65310b9e Replace IdeModifiableModelsProvider -> MavenModifiableModelsProvider 2015-11-30 20:26:25 +03:00
Nikolay Krasko
1bc76d0753 Comment Gradle configurator in br141 2015-11-30 20:24:43 +03:00
Nikolay Krasko
0b49512ade Merge with beta3 2015-11-30 20:21:27 +03:00
Nikolay Krasko
e58a45c9d8 Remove some tests no working on idea 141 and make change signature work with invalid old indecies 2015-11-11 18:14:37 +03:00
Nikolay Krasko
7906615ae9 Merge tag 'build-1.0.0-beta-2403' into beta2_/br141 2015-11-11 14:32:24 +03:00
Nikolay Krasko
eeeb26ddda Merge tag 'build-1.0.0-beta-2385' into idea_continuous/br141 2015-11-11 03:12:56 +03:00
Nikolay Krasko
e4905931b6 Revert unwrapping usages lost in merge 2015-11-10 17:30:15 +03:00
Nikolay Krasko
40cecdaa33 Patch debugger test data 2015-11-10 17:29:59 +03:00
Nikolay Krasko
e8e9e27903 Restore KotlinReportSubmitter 2015-11-10 17:29:42 +03:00
Nikolay Krasko
3e1cd44df8 Fix compile errors after merge 2015-11-10 15:29:02 +03:00
Nikolay Krasko
12447eace1 Merge tag 'build-1.0.0-beta-2364' into idea_continuous/br141
# Conflicts:
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/KotlinJavascriptMetaFile.kt
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/KtClsFile.kt
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/KtClsFileBase.kt
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/kotlinFileViewProviders.kt
#	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt
#	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt
#	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/KotlinLightProjectDescriptor.java
#	idea/src/META-INF/plugin.xml
#	idea/src/org/jetbrains/kotlin/idea/debugger/KotlinPositionManager.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/DebuggerSteppingHelper.java
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
#	idea/src/org/jetbrains/kotlin/idea/findUsages/handlers/KotlinFindClassUsagesHandler.kt
#	idea/src/org/jetbrains/kotlin/idea/highlighter/KotlinTestRunLineMarkerContributor.kt
#	idea/src/org/jetbrains/kotlin/idea/quickfix/KotlinAddOrderEntryActionFactory.kt
#	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureUsageProcessor.java
#	idea/tests/org/jetbrains/kotlin/idea/codeInsight/AbstractOverrideImplementTest.kt
#	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java
#	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java
#	idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java
#	idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionTestGenerated.java
#	idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java
#	idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java
#	idea/tests/org/jetbrains/kotlin/search/JUnitMembersSearcherTest.java
#	plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCase.java
2015-11-10 14:52:58 +03:00
Nikolay Krasko
a7ad17fd6d Merge tag 'build-1.0.0-beta-2181' into idea_continuous/br141 2015-11-10 13:58:04 +03:00
Natalia Ukhorskaya
27140671db Drop smart step into: cannot be implemented on 141 2015-10-30 15:48:19 +03:00
Natalia Ukhorskaya
d36e01dbdd Fix debugger tests 2015-10-30 15:45:06 +03:00
Natalia Ukhorskaya
c9cb0abfad Fix wrong merge 2015-10-30 15:27:01 +03:00
Natalia Ukhorskaya
b0bb109209 Merge remote-tracking branch 'origin/master' into idea_continuous/br141
Conflicts:
	idea/src/org/jetbrains/kotlin/idea/debugger/JetPositionManager.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
	idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/multipleBreakpointsAtLine.kt
	idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceAnonymousObjectCapturedInClosure.kt
	idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/twoLambdasOnOneLineFirst.kt
	idea/testData/debugger/tinyApp/src/stepping/custom/severalFunLiterals.kt
	idea/testData/debugger/tinyApp/src/stepping/custom/severalFunLiteralsInClass.kt
	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java
2015-10-30 15:19:07 +03:00
Natalia Ukhorskaya
d80eb5765e Fix some errors after merge 2015-10-30 15:00:29 +03:00
Natalia Ukhorskaya
3c74b0fcce Revert 932542891b
Stepping for inline functions: add test for last statement in for
2015-10-30 12:48:37 +03:00
Natalia Ukhorskaya
6f9ed63dc9 Revert e534636f03
Support multiple breakpoints at one line (especially for lambdas)
2015-10-30 12:47:25 +03:00
Natalia Ukhorskaya
d56512fd57 Revert 17a564495d
Stepping for inline function: filter out inline function body lines from step over  #KT-9665 Fixed
2015-10-30 12:43:15 +03:00
Natalia Ukhorskaya
b84c73eab2 Revert 66a5351cd0
Do not show fake local variables for inline function/argument in Variables View for Debugger
2015-10-30 12:41:33 +03:00
Natalia Ukhorskaya
1ce461dbfa Revert cdcafb8199
Fix stepping for inline function inside while statement
2015-10-30 12:40:09 +03:00
Natalia Ukhorskaya
39348e38ec Merge remote-tracking branch 'origin/master' into idea_continuous/br141
Conflicts:
	idea/src/META-INF/plugin.xml
	idea/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinLineBreakpointType.java
	idea/src/org/jetbrains/kotlin/idea/debugger/breakpoints/breakpointTypeUtils.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinLambdaSmartStepIntoTarget.kt
	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
	idea/testData/debugger/tinyApp/outs/breakpointInInlineFun.out
	idea/testData/debugger/tinyApp/outs/ceAnonymousObjectCapturedInClosure.out
	idea/testData/debugger/tinyApp/outs/customLibClassName.out
	idea/testData/debugger/tinyApp/outs/fwAbstractProperty.out
	idea/testData/debugger/tinyApp/outs/fwBackingField.out
	idea/testData/debugger/tinyApp/outs/fwInitializer.out
	idea/testData/debugger/tinyApp/outs/fwPropertyInInterface.out
	idea/testData/debugger/tinyApp/outs/localFunInLibrary.out
	idea/testData/debugger/tinyApp/outs/severalFunLiterals.out
	idea/testData/debugger/tinyApp/outs/severalFunLiteralsInClass.out
	idea/testData/debugger/tinyApp/outs/stepIntoStdlibInlineFun2step.out
	idea/testData/debugger/tinyApp/outs/twoLambdasOnOneLineFirst.out
	idea/testData/debugger/tinyApp/outs/withoutBodyProperties.out
	idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverIfWithInline.kt
	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt
	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java
	idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java
2015-10-30 12:36:50 +03:00
TeamCityServer
177897e1f9 Auto-merge with tag <default> 2015-10-26 19:09:28 +03:00
Nikolay Krasko
81edaa94aa Merge tag 'build-1.0.0-beta-1175' into idea_continuous/br141 2015-10-26 17:25:14 +03:00
teamcity
fb3c9c8479 Auto-merge M15 with <default> 2015-10-21 16:52:31 +03:00
Valentin Kipyatkov
3aff0f1107 J2K: fixed conversion of Throwable.getMessage(), Throwable.getCause(), Map.Entry.getKey() and Map.Entry.getValue()
(cherry picked from commit 36ea9cf)
2015-10-21 13:48:44 +03:00
Nikolay Krasko
cbb5e27c14 Merge remote-tracking branch 'origin/M15' into M15_/br141 2015-10-21 12:41:52 +03:00
Nikolay Krasko
5c294538d7 Merge branch 'M15_/br143' into M15_/br141 2015-10-21 00:33:55 +03:00
Michael Bogdanov
5857a02841 Stable element order in redeclaration diagnostic
(cherry picked from commit d054c6b)
2015-10-20 19:45:50 +02:00
Nikolay Krasko
ddf714b93c Temporary get jps-build-test library from last idea because it was built with the newer kotlin 2015-10-20 19:51:38 +03:00
Denis Zharkov
541001fdb1 Mixin kotlin.Number methods into j.l.Number member scope
#KT-9672 Fixed
2015-10-20 19:43:34 +03:00
Ilya Gorbunov
b389f1947d Add deprecated xxxValue() extensions to Number for migration. 2015-10-20 18:25:24 +03:00
Nikolay Krasko
62dde8bf14 Fix tearDown in android tests 2015-10-20 18:22:31 +03:00
Dmitry Jemerov
dfe854796b rename Kt to Kotlin in KtType, KtIcons 2015-10-20 16:44:48 +02:00
Nikolay Krasko
dbae0bcb59 Fix compilation and debugger tests 2015-10-20 17:15:42 +03:00
Ilya Gorbunov
3cab96599f Correct deprecation message for StringBuilder { }. 2015-10-20 16:33:34 +03:00
Andrey Breslav
b53d935e83 Create empty sources JAR for kotlin-osgi-bundle 2015-10-20 16:25:14 +03:00
Nikolay Krasko
d6806a3307 Merge remote-tracking branch 'origin/M15' into idea_continuous/br141
# Conflicts:
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/KotlinClsFileBase.kt
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/kotlinFileViewProviders.kt
#	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt
#	idea/src/org/jetbrains/kotlin/idea/actions/ShowExpressionTypeAction.kt
#	idea/src/org/jetbrains/kotlin/idea/codeInsight/KotlinExpressionTypeProvider.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/KotlinSourcePositionHighlighter.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinLineBreakpointType.java
#	idea/src/org/jetbrains/kotlin/idea/debugger/breakpoints/breakpointTypeUtils.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/DebuggerSteppingHelper.java
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinLambdaSmartStepIntoTarget.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinMethodSmartStepIntoTarget.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
#	idea/src/org/jetbrains/kotlin/idea/highlighter/KotlinRunLineMarkerContributor.kt
#	idea/src/org/jetbrains/kotlin/idea/highlighter/KotlinTestRunLineMarkerContributor.kt
#	idea/src/org/jetbrains/kotlin/idea/inspections/UnusedSymbolInspection.kt
#	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureUsageProcessor.java
#	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JavaMethodDeferredKotlinUsage.kt
#	idea/src/org/jetbrains/kotlin/idea/search/ideaExtensions/KotlinClassesWithAnnotatedMembersSearcher.kt
#	idea/src/org/jetbrains/kotlin/idea/util/DebuggerUtils.java
#	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java
2015-10-20 14:21:43 +03:00
Dmitry Jemerov
5e3884718b use standard exception reporter in release branch 2015-10-20 13:08:42 +02:00
Mikhail Glukhikh
1d97c742b7 Java 8 tests fixed (txt only) 2015-10-20 12:12:31 +03:00
Nikolay Krasko
a185f07ff5 Merge remote-tracking branch 'origin/master' into M15 2015-10-20 04:19:14 +03:00
Ilya Gorbunov
8fb533f44b Fix legacy package facade name usage. 2015-10-20 04:09:52 +03:00
Ilya Gorbunov
a186b5ee0d Alter regex in verify script for versions like 1.0.0-beta+1005 2015-10-20 03:18:17 +03:00
Nikolay Krasko
588812bede Merge tag 'build-0.15.903' into idea_continuous/br141 2015-10-20 02:52:12 +03:00
Ilya Gorbunov
d20daf9766 ReplaceWith for File.recurse 2015-10-20 02:35:10 +03:00
Ilya Gorbunov
20b1cfee0f Fix deprecations in tests 2015-10-20 02:34:56 +03:00
Ilya Gorbunov
eceae7ccda Provide deprecated unconstrained contains, indexOf, lastIndexOf methods for migration. 2015-10-20 02:34:41 +03:00
Ilya Gorbunov
d70a7c1b66 Generate contains, indexOf, lastIndexOf with @NoInfer 2015-10-20 02:34:27 +03:00
Dmitry Jemerov
22bce2e129 fix main class name for builtin serializer 2015-10-20 00:49:48 +02:00
Dmitry Jemerov
fcc0143ae1 disable perf output by default (M15) 2015-10-20 00:26:32 +02:00
Nikolay Krasko
b0b8ad2ccb Restore old uninvalidate files 2015-10-20 01:25:27 +03:00
Nikolay Krasko
9e2f16397c Fix compile errors 2015-10-19 15:11:05 +03:00
Nikolay Krasko
3066ac3d07 Merge build-0.15.848 into idea_continuous/br141
# Conflicts:
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/breakpoints/KotlinLineBreakpointType.java
#	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureUsageProcessor.java
#	idea/tests/org/jetbrains/kotlin/idea/KotlinLightQuickFixTestCase.java
#	idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.java
#	plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCaseBase.java
2015-10-19 14:26:14 +03:00
teamcity
5faa8ca374 Auto-merge M15 with <default> 2015-10-16 16:39:46 +03:00
Nikolay Krasko
5671b72b5b Process request for searching class with empty qualified name without errors 2015-10-16 16:23:10 +03:00
teamcity
8b9995f404 Auto-merge M15 with <default> 2015-10-15 19:57:42 +03:00
Ilya Chernikov
01309eb51c Removing dependency of kotlin plugin from daemon client (kotlinr), it should only depend on rmi-interface 2015-10-15 14:39:38 +02:00
teamcity
a2ea50a084 Auto-merge M15 with <default> 2015-10-15 05:32:49 +03:00
Nikolay Krasko
d8b44f405f Merge remote-tracking branch 'origin/M15' into M15_/br141 2015-10-15 03:13:08 +03:00
Nikolay Krasko
c0eb547afe In br141 java test finder have no restriction for physical files so it can work for Kotlin light classes 2015-10-14 16:50:01 +03:00
Nikolay Krasko
4a58a1d17d Merge branch 'M15' into M15_/br141
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/actions/generate/KotlinGenerateActionBase.kt
2015-10-14 16:49:01 +03:00
Nikolay Krasko
9f06becea7 Fixes for tests generated actions and quickfixes 2015-10-13 21:20:16 +03:00
Nikolay Krasko
933cead115 Merge remote-tracking branch 'origin/M15' into M15_/br141 2015-10-13 15:56:16 +03:00
Nikolay Krasko
d0cbf80bee Fix bad previous merges in Kotlin debugger 2015-10-13 15:44:44 +03:00
Nikolay Krasko
ac0a43132c Fix compile errors 2015-10-12 17:52:17 +03:00
Nikolay Krasko
936e029820 Merge 0.15.449 into idea_continous/br141 2015-10-12 14:16:08 +03:00
Nikolay Krasko
3b53a3fe3e Revert more changes after merge in debugger 2015-10-11 20:12:12 +03:00
Nikolay Krasko
b0e7c45168 Revert "Debugger: do not compute location during creation of step command"
This reverts commit d441f2cf8a.
2015-10-11 20:04:50 +03:00
Nikolay Krasko
977e61f7d1 Revert new markers for running testsˆ 2015-10-11 20:04:16 +03:00
Nikolay Krasko
3fd5961613 Fix KotlinAnnotatedElementSearcher 2015-10-11 20:03:44 +03:00
Nikolay Krasko
a9479b6710 Revert "use IDEA 15 UI for "Show expression type""
This reverts commit d6ea701901.
2015-10-11 19:43:58 +03:00
Nikolay Krasko
2f7bb20d7f No ContextAwareActionHandler in idea 141 2015-10-11 19:38:51 +03:00
Nikolay Krasko
751ea6bc9f Merge tag 'build-0.15.407' into idea_continuous/br141 2015-10-11 19:36:43 +03:00
TeamCityServer
038b6beb71 Auto-merge with tag <default> 2015-10-08 02:11:42 +03:00
TeamCityServer
15ef568dec Auto-merge with tag <default> 2015-10-07 23:05:36 +03:00
TeamCityServer
a0d097485a Auto-merge with tag <default> 2015-10-07 21:34:57 +03:00
Nikolay Krasko
4575042216 Merge tag 'build-0.15.234' into idea_continuous/br141
# Conflicts:
#	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/kotlinFileViewProviders.kt
#	idea/src/META-INF/plugin.xml
2015-10-07 20:02:53 +03:00
Nikolay Krasko
1e2c86ff43 Fix compilation in idea141 2015-10-06 20:35:13 +03:00
Nikolay Krasko
7228710069 Merge tag 'build-0.15.184' into idea_continuous/br141 2015-10-06 20:01:59 +03:00
TeamCityServer
bccb16615d Auto-merge with tag <default> 2015-10-02 20:14:21 +03:00
Nikolay Krasko
c2ba523a22 Revert "jna-util.jar was renamed to jna-platform.jar"
This reverts commit 9ab4aafa01.
2015-10-02 18:01:57 +03:00
Nikolay Krasko
b56c71cdc2 Method absent in Idea 141 added to fix compilation 2015-10-02 15:14:50 +03:00
Nikolay Krasko
f560590159 Merge tag 'build-0.15.76' into idea_continuous/br141 2015-10-02 13:48:55 +03:00
Nikolay Krasko
889460ff56 Merge tag 'build-0.14.437' into M14_/br141 2015-09-29 15:11:59 +03:00
Nikolay Krasko
8a91ddae10 Merge remote-tracking branch 'origin/M14' into M14_/br141 2015-09-28 16:31:15 +03:00
Nikolay Krasko
2332424696 Merge and revert all commits relates to update idea to 142.5047.6 2015-09-28 16:30:46 +03:00
Nikolay Krasko
61b32fea7c Merge commit '58fa2d3b533267f8035e6be0b3e2b77176b7d18f' into M14_/br141 2015-09-28 16:08:22 +03:00
Nikolay Krasko
3c393282cd Fix typo in extension 2015-09-28 16:02:29 +03:00
Dmitry Jemerov
daa2618146 change expected output according to changes in output due to PERF removal 2015-09-28 14:59:54 +02:00
Dmitry Kovanikov
b322636064 Minor: rename Kotlin console... action name to Kotlin REPL 2015-09-28 15:52:15 +03:00
Dmitry Kovanikov
f2c13980d1 Add icon to Kotlin console... action 2015-09-28 15:52:14 +03:00
Dmitry Kovanikov
5788d54521 KT-9262: don't show warning about non-existent location after typing ':quit' 2015-09-28 15:52:13 +03:00
Dmitry Kovanikov
9a037c1254 KT-9263: don't show error message when user tries to execute command in non-existed REPL console 2015-09-28 15:52:13 +03:00
Dmitry Kovanikov
d69bba12e9 KT-9249: show text representation of first shortcut inside repl placeholder 2015-09-28 15:52:12 +03:00
Dmitry Jemerov
a2b346f6ee dependency on java-i18n plugin
(cherry picked from commit 93e2827)
2015-09-28 14:49:56 +02:00
Mikhail Glukhikh
4203677824 ReplaceWith now functions correctly in built-ins #KT-9351 Fixed 2015-09-28 15:41:34 +03:00
Dmitry Jemerov
0d5e7a0cfc fix 'operator' modifier inspection
#KT-9349 Fixed
(cherry picked from commit ee1175d)
2015-09-28 14:40:18 +02:00
Nikolay Krasko
5a15353273 Modify cleanup test, that can't modify deprecated symbol because of invalid element
Add additional test for deprecated symbol
2015-09-28 15:40:03 +03:00
Nikolay Krasko
012c975c61 Setup building against M14 2015-09-28 14:41:15 +03:00
Nikolay Krasko
81bf3227fa Regenerate KotlinSteppingTestGenerated 2015-09-28 14:40:51 +03:00
Nikolay Krasko
a2f06278c8 Revert "IDEA 142.4859.6: Update LineNumberTestGenerated test data (due to IDEA's ASM upgrade to 5.0.4 which supports multiline labels)"
This reverts commit b4efe33efa.
2015-09-28 14:30:58 +03:00
Dmitry Jemerov
183328efe7 fix expected output that changed due to perf removal 2015-09-28 13:28:35 +02:00
Dmitry Jemerov
b1c87bab9e disable perf output by default (M13 only) 2015-09-28 13:28:15 +02:00
Nikolay Krasko
7a1135d715 Suppress warning in proguard about jna classes 2015-09-28 09:08:39 +03:00
Nikolay Krasko
17eead516c Update to IDEA 142.5047.6 2015-09-28 09:08:38 +03:00
Natalia Ukhorskaya
f0a4b4ed32 Add missing readAction 2015-09-28 09:08:38 +03:00
Natalia Ukhorskaya
0c520c5d65 jna-util.jar was renamed to jna-platform.jar 2015-09-28 09:08:37 +03:00
Natalia Ukhorskaya
61881ea3a8 Fix compilation errors 2015-09-28 09:08:37 +03:00
Natalia Ukhorskaya
735a690c60 Rewrite DebuggerTests (do not use FrameTree) 2015-09-28 09:08:36 +03:00
Nikolay Krasko
8389066f28 Fix after merge 2015-09-28 02:37:27 +03:00
Nikolay Krasko
8973ed5217 Merge remote-tracking branch 'origin/master' into idea_continuous/br141
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
#	idea/testData/debugger/tinyApp/outs/stepOverInlinedLambda.out
#	idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInlinedLambda.kt
#	idea/tests/org/jetbrains/kotlin/findUsages/AbstractJetFindUsagesTest.java
#	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java
#	update_dependencies.xml
2015-09-28 02:37:07 +03:00
Nikolay Krasko
645834e6f6 Fix compile errors 2015-09-28 02:24:52 +03:00
Nikolay Krasko
a8ae730c7f No method with icon create from vararg 2015-09-28 01:56:03 +03:00
Michael Nedzelsky
58fa2d3b53 get rid of internal JvmVersion annotation in kotlin-jdbc 2015-09-27 20:38:42 +03:00
Michael Nedzelsky
a00b390282 fix check for internal from another module in imports and file level annotations 2015-09-27 20:38:38 +03:00
Nikolay Krasko
4c9a076a8d Merge remote-tracking branch 'origin/master' into idea_continuous/br141
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
#	idea/testData/debugger/tinyApp/outs/stepOverInlinedLambda.out
#	idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInlinedLambda.kt
#	idea/tests/org/jetbrains/kotlin/findUsages/AbstractJetFindUsagesTest.java
#	idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java
#	update_dependencies.xml
2015-09-25 21:29:12 +03:00
Nikolay Krasko
08d42b1333 Revert to downloading bootstrap from default branch 2015-09-25 18:13:37 +03:00
Nikolay Krasko
717c7b7caf Merge tag 'build-0.14.390' into idea_continuous/br141 2015-09-25 18:11:32 +03:00
Nikolay Krasko
eb078d5840 Temporary disable repl setup 2015-09-25 15:57:39 +03:00
Nikolay Krasko
f3b1cd0a71 Fix compilation after merge 2015-09-25 15:56:09 +03:00
Nikolay Krasko
5a116129d2 Merge remote-tracking branch 'origin/master' into idea_continuous/br141 2015-09-25 15:54:56 +03:00
Natalia Ukhorskaya
cae65bdebc Change until version of plugin for Android Studio compatibility
(cherry picked from commit 94e827747e)
2015-09-17 17:53:43 +03:00
Nikolay Krasko
712c88a900 Fix compilation 2015-09-12 17:54:14 +03:00
Nikolay Krasko
74b59aa00e Fix in debugger test data 2015-09-12 17:23:12 +03:00
Nikolay Krasko
155cf874df Fix test by inserting errors without replacing all file 2015-09-12 17:14:27 +03:00
Nikolay Krasko
c477e1825e Merge remote-tracking branch 'origin/M13' into idea_continuous/br141
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureUsageProcessor.java
#	idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out
#	idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out
#	update_dependencies.xml
2015-09-11 13:06:43 +03:00
Nikolay Krasko
c4295de0c6 Fix compilation 2015-09-11 10:36:23 +03:00
Nikolay Krasko
fd5394665b Merge remote-tracking branch 'origin/M13' into idea_continuous/br141 2015-09-10 22:34:50 +03:00
Nikolay Krasko
a46af42022 Update dependencies files 2015-09-10 22:26:59 +03:00
Nikolay Krasko
ad77a8c416 Merge remote-tracking branch 'origin/M13' into idea_continuous/br141 2015-09-09 21:37:11 +03:00
Nikolay Krasko
39e9916629 Revert debugger test data 2015-09-09 15:42:24 +03:00
Nikolay Krasko
643147049e Merge tag 'build-0.13.1223' into idea_continuous/br141 2015-09-09 15:39:46 +03:00
Nikolay Krasko
de9c143ef4 Fixes after merge 2015-09-08 17:48:17 +03:00
Nikolay Krasko
2b656af7a7 Merge tag 'build-0.13.1180' into idea_continuous/br141
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/debugger/render/DelegatedPropertyFieldDescriptor.kt
#	idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt
#	idea/src/org/jetbrains/kotlin/idea/findUsages/handlers/KotlinFindClassUsagesHandler.kt
#	idea/src/org/jetbrains/kotlin/idea/util/DebuggerUtils.java
#	idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out
#	idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out
2015-09-08 17:32:20 +03:00
Nikolay Krasko
86c96b6011 Take method with internal visibility in br141 to local code 2015-09-07 18:15:08 +03:00
Nikolay Krasko
e7401cdaf9 Merge tag 'build-0.13.1098' into idea_continuous/br141 2015-09-07 16:29:19 +03:00
Nikolay Krasko
f8a5f91fb8 Merge tag 'build-0.13.1055' into idea_continuous/br141 2015-09-07 16:23:36 +03:00
Nikolay Krasko
ce1ec60db8 Fix compilation errors after revert 2015-09-07 16:22:20 +03:00
Nikolay Krasko
722a3f722f Revert "Debugger: support stepping over inline function"
This reverts commit 73946050c1.
2015-09-07 16:07:01 +03:00
Nikolay Krasko
91a43b2cb1 Revert "Minor: extract method"
This reverts commit 4980780268.
2015-09-07 16:04:31 +03:00
Nikolay Krasko
d10061ba70 Revert "Debugger for inline functions: check for available strata (faster than compute source position)"
This reverts commit ba686c701e.
2015-09-07 16:04:18 +03:00
Nikolay Krasko
4ed1e6cf26 Revert "Debugger: support stepping out inline function"
This reverts commit 060b6e6b15.
2015-09-07 16:04:02 +03:00
Nikolay Krasko
e94108ef4f Revert "Minor: do less work in debug thread during stepping commands for inline functions"
This reverts commit c836060f3a.
2015-09-07 16:02:49 +03:00
Nikolay Krasko
0b37cd6058 Merge tag 0.13.1022 into idea_continuous/br141
# Conflicts:
#	idea/src/META-INF/plugin.xml
#	idea/src/org/jetbrains/kotlin/idea/highlighter/KotlinRunLineMarkerContributor.kt
#	idea/src/org/jetbrains/kotlin/idea/inspections/UnusedImportInspection.kt
#	idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.java
#	update_dependencies.xml
2015-09-07 15:56:08 +03:00
Nikolay Krasko
5fc2118915 Downgrade to idea 141 api 2015-09-07 15:03:22 +03:00
Nikolay Krasko
081b4ed18c Revert "searcher for more efficient search of Kotlin classes which have methods annotated with @Test"
This reverts commit 724f13954a.
2015-09-07 14:55:36 +03:00
Nikolay Krasko
b9c55cc78e Merge tag 0.13.1022 into idea_continuous/br141
# Conflicts:
#	idea/src/META-INF/plugin.xml
#	idea/src/org/jetbrains/kotlin/idea/highlighter/KotlinRunLineMarkerContributor.kt
#	idea/src/org/jetbrains/kotlin/idea/inspections/UnusedImportInspection.kt
#	idea/tests/org/jetbrains/kotlin/idea/quickfix/AbstractQuickFixTest.java
#	update_dependencies.xml
2015-09-07 14:45:31 +03:00
Nikolay Krasko
053e7c7551 No kotlin libraries in 141 2015-09-03 17:17:18 +03:00
Nikolay Krasko
49db752021 Better merging in debugger tests 2015-09-03 13:58:17 +03:00
Nikolay Krasko
5a46e39a53 Adjust test data for idea 141 after merge 2015-09-03 13:57:47 +03:00
Nikolay Krasko
30924091e6 Revert "Run/Debug editor gutter drop down does not work in Kotlin files (KT-8720)"
This reverts commit 142ab96a5a.
2015-09-03 13:07:17 +03:00
Nikolay Krasko
5d68b0eb2f Revert "Update to 142.4245.2"
This reverts commit 6975afba3e.
2015-09-03 13:02:04 +03:00
Nikolay Krasko
2de8168a87 Revert "Update to 142.4245.2: Update Kotlin run line marker info to new API"
This reverts commit 5554a44f0f.
2015-09-03 13:00:23 +03:00
Nikolay Krasko
112d9e56f7 Revert "Update to 142.4245.2: register RunLineMarkerProvider not only for Java language (temp)"
This reverts commit ca907c4985.
2015-09-03 13:00:20 +03:00
Nikolay Krasko
377aabf9d5 Revert "Update to 142.4245.2: Fix compilation after update"
This reverts commit a946db98a1.
2015-09-03 13:00:18 +03:00
Nikolay Krasko
b18adfdd6a Revert "Update to 142.4245.2: Fix test data in pull up"
This reverts commit 339f8ee2ab.
2015-09-03 13:00:15 +03:00
Nikolay Krasko
d16c38327b Revert "Update to 142.4245.2: Debugger tests: changes in testData"
This reverts commit ffe41b88a7.
2015-09-03 13:00:13 +03:00
Nikolay Krasko
a9d9d91311 Revert "Update to 142.4245.2: Fix compilation"
This reverts commit 11331e74fd.
2015-09-03 13:00:10 +03:00
Nikolay Krasko
bacb0d3a51 Revert "Update to 142.4245.2: Temprorary modify test data after IDEA update"
This reverts commit 1132652026.
2015-09-03 13:00:02 +03:00
Nikolay Krasko
9a82813b5c Merge tag 'build-0.13.969' into idea_continuous/br141
# Conflicts:
#	idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractKotlinSteppingTest.kt
#	idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt
#	update_dependencies.xml
2015-09-03 12:58:54 +03:00
Nikolay Krasko
3e22c15d24 Don't check for JS module 2015-08-25 14:08:47 +03:00
Nikolay Krasko
f4eeeb03c4 Revert "Debugger tests: changes in testData"
This reverts commit be5c1d0a44.
2015-08-25 11:07:56 +03:00
Nikolay Krasko
66a1ef5e1f Remove copying kotlin runtime from br141 2015-08-25 00:40:37 +03:00
TeamCityServer
d7d100e361 Auto-merge with tag <default> 2015-08-24 23:45:07 +03:00
TeamCityServer
987028171a Auto-merge with tag <default> 2015-08-24 20:45:51 +03:00
TeamCityServer
4413312f30 Auto-merge with tag <default> 2015-08-24 18:37:38 +03:00
TeamCityServer
db5b197921 Auto-merge with tag <default> 2015-08-24 16:43:27 +03:00
Nikolay Krasko
99b28d5c05 Merge tag 'build-0.13.717' into idea_continuous/br141
Conflicts:
	update_dependencies.xml
2015-08-24 15:37:42 +03:00
TeamCityServer
b5b9d3b25c Auto-merge with tag <default> 2015-08-21 15:59:31 +03:00
Stanislav Erokhin
8663dc7dae Fix after merge 2015-08-20 20:21:26 +03:00
Stanislav Erokhin
2b0699e5c9 Revert "Debugger tests: migrate to new API"
This reverts commit 9b0cfd4027.
2015-08-20 19:22:25 +03:00
Stanislav Erokhin
d1e327adde Manual merge 2015-08-20 19:12:59 +03:00
TeamCityServer
32e907167a Auto-merge with tag <default> 2015-08-19 23:04:31 +03:00
TeamCityServer
42a6f722c5 Auto-merge with tag <default> 2015-08-19 20:57:24 +03:00
TeamCityServer
1100cd5f6b Auto-merge with tag <default> 2015-08-19 10:45:55 +03:00
TeamCityServer
aa53e883a9 Auto-merge with tag <default> 2015-08-19 04:24:38 +03:00
TeamCityServer
db74c98145 Auto-merge with tag <default> 2015-08-18 20:54:21 +03:00
Yan Zhulanow
b5d9823845 Merge tag 'build-0.13.615' into idea_continuous/br141 2015-08-18 19:04:58 +03:00
TeamCityServer
57e6873e38 Auto-merge with tag <default> 2015-08-14 23:11:07 +03:00
TeamCityServer
db104cd818 Auto-merge with tag <default> 2015-08-14 20:08:36 +03:00
TeamCityServer
246535a43e Auto-merge with tag <default> 2015-08-13 19:10:15 +03:00
TeamCityServer
8cf466f98b Auto-merge with tag <default> 2015-08-13 19:07:26 +03:00
TeamCityServer
ed13cc3a4a Auto-merge with tag <default> 2015-08-13 17:39:18 +03:00
TeamCityServer
d846189110 Auto-merge with tag <default> 2015-08-12 20:38:59 +03:00
TeamCityServer
9afee1d2d9 Auto-merge with tag <default> 2015-08-12 19:01:25 +03:00
TeamCityServer
17e1abeead Auto-merge with tag <default> 2015-08-12 16:51:38 +03:00
TeamCityServer
48ac53da40 Auto-merge with tag <default> 2015-08-12 14:20:35 +03:00
TeamCityServer
a4f80bdaa1 Auto-merge with tag <default> 2015-08-11 21:56:02 +03:00
TeamCityServer
ab0add4c9b Auto-merge with tag <default> 2015-08-11 15:28:21 +03:00
TeamCityServer
2ebbc432d7 Auto-merge with tag <default> 2015-08-11 15:08:12 +03:00
TeamCityServer
c5e9e04899 Auto-merge with tag <default> 2015-08-11 12:13:47 +03:00
TeamCityServer
1ed0d4f56a Auto-merge with tag <default> 2015-08-11 07:03:48 +03:00
TeamCityServer
961d691656 Auto-merge with tag <default> 2015-08-11 06:14:09 +03:00
TeamCityServer
c970c96b71 Auto-merge with tag <default> 2015-08-11 04:06:15 +03:00
TeamCityServer
c6d3ff7936 Auto-merge with tag <default> 2015-08-10 23:46:41 +03:00
TeamCityServer
825946f2d7 Auto-merge with tag <default> 2015-08-10 19:31:08 +03:00
TeamCityServer
07152e250f Auto-merge with tag <default> 2015-08-10 18:26:12 +03:00
Nikolay Krasko
dab7669ea4 Merge tag 'build-0.13.480' into idea_continuous/br141
Conflicts:
	.idea/runConfigurations/All_Tests.xml
	.idea/runConfigurations/IDEA.xml
	.idea/runConfigurations/IDEA__No_ProcessCanceledException_.xml
	idea/src/META-INF/plugin.xml
	update_dependencies.xml
2015-08-10 15:20:12 +03:00
Natalia Ukhorskaya
7a7de2c70e Do not fail of kotlin-runtime.jar is not found 2015-08-07 10:17:52 +03:00
Natalia Ukhorskaya
a01c77b478 Fix debugger tests 2015-08-06 18:20:02 +03:00
Natalia Ukhorskaya
a2e131d825 Fix compilation errors 2015-08-06 17:41:14 +03:00
Natalia Ukhorskaya
6f3275e644 Revert SourcePositionHighlighter for lambdas ff0a064908 2015-08-06 16:08:18 +03:00
Natalia Ukhorskaya
2187afa611 Merge tag 'build-0.13.394' into idea_continuous/br141
Conflicts:
	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt
	idea/src/META-INF/plugin.xml
	j2k/src/org/jetbrains/kotlin/j2k/JavaToKotlinTranslator.kt
	update_dependencies.xml
2015-08-06 16:02:27 +03:00
teamcityserver
83103e83b5 Auto-merge with tag <default> 2015-07-27 14:08:26 +03:00
teamcityserver
8459e515dd Auto-merge with tag <default> 2015-07-24 23:58:14 +03:00
teamcityserver
479010a800 Auto-merge with tag <default> 2015-07-24 20:44:07 +03:00
teamcityserver
03e874fcb7 Auto-merge with tag <default> 2015-07-24 16:41:57 +03:00
Nikolay Krasko
a6275bbe1a Downgrade to idea 141 API 2015-07-24 13:38:09 +03:00
Nikolay Krasko
0c14e93f2b Merge tag 'build-0.13.109' into idea_continuous/br141
Conflicts:
	idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractKotlinSteppingTest.kt
	plugins/android-idea-plugin/android-idea-plugin.iml
2015-07-24 12:51:57 +03:00
Nikolay Krasko
cd7ec5d473 Revert "Removed workaround for exception in IDEA."
2820dbf181
2015-07-24 12:46:39 +03:00
Nikolay Krasko
134c54196f Use templates in non-inline mode 2015-07-24 12:46:36 +03:00
Nikolay Krasko
c6954c12d3 Revert "Minor test data update after moving to new idea"
87e94aa20b
2015-07-24 12:45:15 +03:00
Nikolay Krasko
9fe570240a Fix compilation 2015-07-23 15:44:58 +03:00
Nikolay Krasko
bf1e81cbf0 Merge tag 'build-0.13.76' into idea_continuous/br141 2015-07-23 14:52:16 +03:00
Nikolay Krasko
2a1a389cac Merge tag 'build-0.13.47' into idea_continuous/br141
Conflicts:
	.idea/runConfigurations/IDEA.xml
	.idea/runConfigurations/IDEA__No_ProcessCanceledException_.xml
	idea/idea-test-framework/src/org/jetbrains/kotlin/idea/test/testUtils.kt
2015-07-22 13:21:32 +03:00
Nikolay Krasko
f149d48791 Ignore tests 2015-07-21 14:27:19 +03:00
Nikolay Krasko
600c567224 Restore mapping for built-in psi files 2015-07-21 13:50:38 +03:00
Nikolay Krasko
5556d4f77c Insert non-inline template in idea 141 2015-07-21 13:27:52 +03:00
teamcityserver
464c4d281f Auto-merge with tag <default> 2015-07-21 12:12:46 +03:00
teamcityserver
8bf23ba822 Auto-merge with tag <default> 2015-07-21 00:19:46 +03:00
Nikolay Krasko
d90fa2baa2 Revert "Move kotlin runtime jars to separate folder and attach them during debug idea start"
This reverts commit 796e05983c.
2015-07-20 17:15:36 +03:00
Nikolay Krasko
d3f62b0b51 Merge tag 'build-0.12.1313' into idea_continuous/br141
Conflicts:
	update_dependencies.xml
2015-07-20 16:44:21 +03:00
Nikolay Krasko
dd4cbf1eb6 Port KotlinLightPlatformCodeInsightFixtureTestCase 2015-07-17 20:41:50 +03:00
Nikolay Krasko
4d275967fa Revert debugger api 2015-07-17 20:41:48 +03:00
Nikolay Krasko
99ad891e8e Downgrade multi-selection check to old API 2015-07-17 19:28:05 +03:00
Nikolay Krasko
74a717564c Merge tag 'build-0.12.1274' into idea_continuous/br141
Conflicts:
	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureUsageProcessor.java
	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JavaMethodDeferredKotlinUsage.kt
	idea/testData/debugger/tinyApp/outs/frameSimple.out
	idea/testData/refactoring/changeSignature/JavaMethodOverridesChangeParamBefore.1.kt
	idea/testData/refactoring/changeSignature/JavaMethodOverridesChangeParamBefore.java
	idea/testData/refactoring/changeSignature/JavaMethodOverridesReplaceParamAfter.1.kt
	idea/testData/refactoring/changeSignature/JavaMethodOverridesReplaceParamAfter.java
	idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java
	idea/tests/org/jetbrains/kotlin/idea/resolve/AbstractReferenceResolveTest.java
	plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCase.java
	plugins/android-idea-plugin/tests/org/jetbrains/kotlin/android/KotlinAndroidTestCaseBase.java
	update_dependencies.xml
2015-07-17 19:03:07 +03:00
Nikolay Krasko
f6f95c2767 Restore usages filtering 2015-07-06 20:28:39 +03:00
Nikolay Krasko
e21b7c336f Revert "Change Signature: Support Kotlin functions overriding Java methods"
This reverts commit 4eeff03525.

Conflicts:
	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureProcessor.java
	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureUsageProcessor.java
	idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/JavaMethodDeferredKotlinUsage.kt
	idea/tests/org/jetbrains/kotlin/idea/refactoring/changeSignature/JetChangeSignatureTest.java
2015-07-06 20:27:38 +03:00
Nikolay Krasko
102becd680 Revert creating new psi file each time in provider file create
Revert "Getting decompiled file content through getPsi() doesn't work for local class files" (d564f44aad)
Revert "Refactoring: rename file" (dde295011b)
Revert "Create file must return new file, as old one can be invalidated (KT-8266)" (ef477f99e9)
2015-07-06 19:17:21 +03:00
Nikolay Krasko
8c7f9dc7b3 Compilation fix: no junit-4.12 in idea 141. Replace with 4.11 2015-07-06 19:17:20 +03:00
Nikolay Krasko
31b43ea690 Compilation fix: no parameter with empty parameters list 2015-07-06 19:17:19 +03:00
Nikolay Krasko
9e2474b685 More memory for tests 2015-07-06 19:17:18 +03:00
Nikolay Krasko
5d03ade4f5 Revert commits responsible for update to idea 15
ef7cc6ae10 "Force openning project"
3d8f04e4fe "Update test data: Idea can't parse description with "ctrl+ alt + b" promotion"
2820dbf181 "Removed workaround for exception in IDEA."
66a4e0f299 "Mute error about org.iq80.snappy.Snappy"
549987b27f "Ignore actions with empty message"
94db320f7a "Update hack for restore validity of builtins files"
53ab02e877 "Generate private constructors for enums in coverter"
b64aff9f9a "Add actions with "Supress " prefix to irrelevant group"
737ad5b9e0 "Search in index under read action in tests"
3136e5eefd "removed registration of deprecated extensions points without implementations"
c2a1dc4c90 "Fix compilation errors"
aaa4e747db "Fix tests: type for string  isn't now rendered by default"
ba6b378378 "Fix tests: register JavaClassSupers service in WebDemoTest"
757b963731 "Register JavaClassSupers service"
73b2de95ab "Create from Usage: Do not delete temporary file as this operation is not supported by IDEA anymore"
8e51f1aadd "Idea moved to junit-4.12"
2ebdd32267 "Make compatible with 142 idea branch"
2536648e60 "Update to Idea 15 eap (142.2491.1)"
2015-07-06 19:17:17 +03:00
500 changed files with 2215 additions and 3640 deletions

View File

@@ -1,16 +1,16 @@
<component name="libraryTable">
<library name="junit-4.12">
<library name="junit-4.11">
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/annotations" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/hamcrest-core-1.3.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/junit-4.12.jar!/" />
<root url="jar://$PROJECT_DIR$/ideaSDK/lib/junit-4.11.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/dependencies/hamcrest-core-1.3-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/junit-4.12-sources.jar!/" />
<root url="jar://$PROJECT_DIR$/dependencies/junit-4.11-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="IDEA" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=450m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=450m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin,$PROJECT_DIR$/out/artifacts/KotlinAndroidExtensions -Dkotlin.internal.mode.enabled=true" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=250m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true -Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" />
<option name="VM_PARAMETERS" value="-Xmx800m -XX:ReservedCodeCacheSize=64m -XX:MaxPermSize=250m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=../system-idea -Didea.config.path=../config-idea -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin,$PROJECT_DIR$/out/artifacts/KotlinAndroidExtensions -Didea.ProcessCanceledException=disabled -Dkotlin.internal.mode.enabled=true" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/ideaSDK/bin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />

View File

@@ -88,12 +88,5 @@
origin.version="${relay.origin.version}"
plugin.subdir="BareKotlin"
substituted.version="${relay.substitute.version}"/>
<substitudeVersionInPlugin
plugin.jar.name="kotlin-android-extensions"
plugin.path="${relay.plugins.dir}/kotlin-android-extensions-plugin-${relay.origin.version}.zip"
origin.version="${relay.origin.version}"
plugin.subdir="KotlinAndroidExtensions"
substituted.version="${relay.substitute.version}"/>
</target>
</project>

View File

@@ -502,7 +502,7 @@
<zipgroupfileset dir="${basedir}/lib" includes="*.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/core" includes="*.jar" excludes="util.jar"/>
<zipfileset src="${idea.sdk}/lib/jna-platform.jar"/>
<zipfileset src="${idea.sdk}/lib/jna-utils.jar"/>
<zipfileset src="${idea.sdk}/lib/oromatcher.jar"/>
<zipfileset src="${idea.sdk}/jps/jps-model.jar"/>
<zipfileset src="${dependencies.dir}/jline.jar"/>
@@ -969,7 +969,7 @@
<target name="pack-kotlin-test">
<pack-runtime-jar jar-name="kotlin-test.jar" implementation-title="${manifest.impl.title.kotlin.test}">
<jar-content>
<fileset dir="${output}/classes/kotlin.test" includes="**/*"/>
<fileset dir="${output}/classes/kotlin.test" includes="**/*" excludes="kotlin/internal/OnlyInputTypes*,kotlin/internal"/>
</jar-content>
</pack-runtime-jar>
</target>
@@ -1077,4 +1077,5 @@
<target name="build-bootstrap-artifacts" depends="dist,zip-compiler"/>
<target name="build-artifacts" depends="dist,zip-compiler,kotlin-for-upsource,zip-test-data"/>
<!-- Dummy change to see build in TeamCity dependencies -->
</project>

View File

@@ -51,7 +51,7 @@ public class InterfaceImplBodyCodegen(
override fun generateDeclaration() {
v.defineClass(
myClass, V1_6, ACC_PUBLIC or ACC_FINAL,
myClass, V1_6, ACC_PUBLIC or ACC_FINAL or ACC_SUPER,
typeMapper.mapDefaultImpls(descriptor).internalName,
null, "java/lang/Object", ArrayUtil.EMPTY_STRING_ARRAY
)

View File

@@ -297,8 +297,8 @@ public class MultifileClassCodegen(
}
companion object {
private val FACADE_CLASS_ATTRIBUTES = Opcodes.ACC_PUBLIC or Opcodes.ACC_FINAL
private val OPEN_FACADE_CLASS_ATTRIBUTES = Opcodes.ACC_PUBLIC
private val FACADE_CLASS_ATTRIBUTES = Opcodes.ACC_PUBLIC or Opcodes.ACC_FINAL or Opcodes.ACC_SUPER
private val OPEN_FACADE_CLASS_ATTRIBUTES = Opcodes.ACC_PUBLIC or Opcodes.ACC_SUPER
private fun getOnlyPackageFragment(packageFqName: FqName, files: Collection<KtFile>, bindingContext: BindingContext): PackageFragmentDescriptor? {
val fragments = SmartList<PackageFragmentDescriptor>()

View File

@@ -46,7 +46,7 @@ public class MultifileClassPartCodegen(
override fun generateDeclaration() {
v.defineClass(element, Opcodes.V1_6,
Opcodes.ACC_FINAL or Opcodes.ACC_SYNTHETIC,
Opcodes.ACC_FINAL or Opcodes.ACC_SYNTHETIC or Opcodes.ACC_SUPER,
filePartType.internalName,
null,
"java/lang/Object",

View File

@@ -63,7 +63,7 @@ public class PackagePartCodegen extends MemberCodegen<KtFile> {
@Override
protected void generateDeclaration() {
v.defineClass(element, V1_6,
ACC_PUBLIC | ACC_FINAL,
ACC_PUBLIC | ACC_FINAL | ACC_SUPER,
packagePartType.getInternalName(),
null,
"java/lang/Object",

View File

@@ -86,7 +86,7 @@ public class SamWrapperCodegen {
ClassBuilder cv = state.getFactory().newVisitor(JvmDeclarationOriginKt.OtherOrigin(erasedInterfaceFunction), asmType, file);
cv.defineClass(file,
V1_6,
ACC_FINAL,
ACC_FINAL | ACC_SUPER,
asmType.getInternalName(),
null,
OBJECT_TYPE.getInternalName(),

View File

@@ -88,7 +88,7 @@ public class ScriptCodegen extends MemberCodegen<KtScript> {
v.defineClass(scriptDeclaration,
V1_6,
ACC_PUBLIC,
ACC_PUBLIC | ACC_SUPER,
classType.getInternalName(),
null,
"java/lang/Object",

View File

@@ -47,7 +47,7 @@ public class MappingClassesForWhenByEnumCodegen {
cb.defineClass(
srcFile,
V1_6,
ACC_FINAL | ACC_SYNTHETIC | ACC_PUBLIC,
ACC_PUBLIC | ACC_FINAL | ACC_SUPER | ACC_SYNTHETIC,
mappingsClass.getInternalName(),
null,
OBJECT_TYPE.getInternalName(),

View File

@@ -26,6 +26,8 @@ public class CLIConfigurationKeys {
CompilerConfigurationKey.create("message collector");
public static final CompilerConfigurationKey<List<CompilerPlugin>> COMPILER_PLUGINS =
CompilerConfigurationKey.create("compiler plugins");
public static final CompilerConfigurationKey<Boolean> REPORT_PERF =
CompilerConfigurationKey.create("enable perf");
private CLIConfigurationKeys() {
}

View File

@@ -59,6 +59,7 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
val configuration = CompilerConfiguration()
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageSeverityCollector)
configuration.put(CLIConfigurationKeys.REPORT_PERF, arguments.reportPerf)
if (IncrementalCompilation.isEnabled()) {
val incrementalCompilationComponents = services.get(javaClass<IncrementalCompilationComponents>())

View File

@@ -28,8 +28,8 @@ import com.intellij.mock.MockApplication
import com.intellij.openapi.Disposable
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.extensions.ExtensionsArea
import com.intellij.openapi.extensions.*
import com.intellij.openapi.fileTypes.ContentBasedFileSubstitutor
import com.intellij.openapi.fileTypes.FileTypeExtensionPoint
import com.intellij.openapi.fileTypes.PlainTextFileType
import com.intellij.openapi.project.Project
@@ -43,14 +43,13 @@ import com.intellij.psi.FileContextProvider
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.augment.PsiAugmentProvider
import com.intellij.psi.compiled.ClassFileDecompilers
import com.intellij.psi.impl.JavaClassSupersImpl
import com.intellij.psi.impl.PsiElementFinderImpl
import com.intellij.psi.impl.PsiTreeChangePreprocessor
import com.intellij.psi.impl.compiled.ClsCustomNavigationPolicy
import com.intellij.psi.impl.compiled.ClsStubBuilderFactory
import com.intellij.psi.impl.file.impl.JavaFileManager
import com.intellij.psi.meta.MetaDataContributor
import com.intellij.psi.stubs.BinaryFileStubBuilders
import com.intellij.psi.util.JavaClassSupers
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.asJava.JavaElementFinder
import org.jetbrains.kotlin.asJava.KtLightClassForFacade
@@ -342,10 +341,12 @@ public class KotlinCoreEnvironment private constructor(
}
private fun registerAppExtensionPoints() {
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), ContentBasedFileSubstitutor.EP_NAME, javaClass<ContentBasedFileSubstitutor>())
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), BinaryFileStubBuilders.EP_NAME, javaClass<FileTypeExtensionPoint<Any>>())
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), FileContextProvider.EP_NAME, javaClass<FileContextProvider>())
//
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), MetaDataContributor.EP_NAME, javaClass<MetaDataContributor>())
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), ClsStubBuilderFactory.EP_NAME, javaClass<ClsStubBuilderFactory<*>>())
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), PsiAugmentProvider.EP_NAME, javaClass<PsiAugmentProvider>())
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), JavaMainMethodProvider.EP_NAME, javaClass<JavaMainMethodProvider>())
//
@@ -385,7 +386,6 @@ public class KotlinCoreEnvironment private constructor(
registerFileType(KotlinFileType.INSTANCE, KotlinParserDefinition.STD_SCRIPT_SUFFIX)
registerParserDefinition(KotlinParserDefinition())
getApplication().registerService(javaClass<KotlinBinaryClassCache>(), KotlinBinaryClassCache())
getApplication().registerService(javaClass<JavaClassSupers>(), javaClass<JavaClassSupersImpl>())
}
}
@@ -407,7 +407,6 @@ public class KotlinCoreEnvironment private constructor(
private fun registerProjectServicesForCLI(projectEnvironment: JavaCoreProjectEnvironment) {
with (projectEnvironment.getProject()) {
registerService(javaClass<CoreJavaFileManager>(), ServiceManager.getService(this, javaClass<JavaFileManager>()) as CoreJavaFileManager)
val cliLightClassGenerationSupport = CliLightClassGenerationSupport(this)
registerService(javaClass<LightClassGenerationSupport>(), cliLightClassGenerationSupport)
registerService(javaClass<CliLightClassGenerationSupport>(), cliLightClassGenerationSupport)

View File

@@ -11,7 +11,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="library" name="intellij-core" level="project" />
<orderEntry type="library" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" name="junit-4.11" level="project" />
<orderEntry type="library" exported="" name="javax.inject" level="project" />
<orderEntry type="library" scope="TEST" name="kotlin-test" level="project" />
</component>

View File

@@ -20,9 +20,11 @@ import com.intellij.util.containers.ContainerUtil
import java.lang.reflect.*
import java.util.ArrayList
import java.util.LinkedHashSet
import java.util.concurrent.ConcurrentHashMap
private object ClassTraversalCache {
private val cache = ContainerUtil.createConcurrentWeakKeySoftValueMap<Class<*>, ClassInfo>()
private val cache = ContainerUtil.createConcurrentWeakKeySoftValueMap<Class<*>, ClassInfo>(
100, 0.75f, Runtime.getRuntime().availableProcessors(), ContainerUtil.canonicalStrategy())
fun getClassInfo(c: Class<*>): ClassInfo {
val classInfo = cache.get(c)

View File

@@ -16,8 +16,10 @@
package org.jetbrains.kotlin.daemon.client
import com.intellij.openapi.progress.ProcessCanceledException
import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade
import org.jetbrains.kotlin.daemon.common.LoopbackNetworkInterface
import org.jetbrains.kotlin.daemon.common.RmiFriendlyCompilationCancelledException
import org.jetbrains.kotlin.daemon.common.SOCKET_ANY_FREE_PORT
import org.jetbrains.kotlin.incremental.components.LookupInfo
import org.jetbrains.kotlin.incremental.components.LookupTracker
@@ -80,6 +82,13 @@ class CompilerCallbackServicesFacadeServer(
override fun lookupTracker_isDoNothing(): Boolean = lookupTracker_isDoNothing
override fun compilationCanceledStatus_checkCanceled() {
compilationCancelledStatus!!.checkCanceled()
try {
compilationCancelledStatus!!.checkCanceled()
}
catch (e: ProcessCanceledException) {
// avoid passing exceptions that may have different serialVersionUID on across rmi border
// TODO: doublecheck whether we need to distinguish different cancellation exceptions
throw RmiFriendlyCompilationCancelledException()
}
}
}

View File

@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.daemon.common
import org.jetbrains.kotlin.incremental.components.LookupInfo
import org.jetbrains.kotlin.load.kotlin.incremental.components.JvmPackagePartProto
import org.jetbrains.kotlin.modules.TargetId
import java.io.Serializable
import java.rmi.Remote
import java.rmi.RemoteException
@@ -81,7 +82,13 @@ interface CompilerCallbackServicesFacade : Remote {
// ----------------------------------------------------
// CompilationCanceledStatus
@Throws(RemoteException::class)
@Throws(RemoteException::class, RmiFriendlyCompilationCancelledException::class)
fun compilationCanceledStatus_checkCanceled(): Unit
}
class RmiFriendlyCompilationCancelledException: Exception(), Serializable {
companion object {
private val serialVersionUID: Long = 8228357578L // just a random number, but should never be changed to avoid deserialization problems
}
}

View File

@@ -484,7 +484,7 @@ class CompileServiceImpl(
}
private fun clearJarCache() {
ZipHandler.clearFileAccessorCache()
// ZipHandler.clearFileAccessorCache()
val classloader = javaClass.classLoader
// TODO: replace the following code with direct call to CoreJarFileSystem.<clearCache> as soon as it will be available (hopefully in 15.02)
try {

View File

@@ -20,6 +20,8 @@ import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.daemon.common.CompilerCallbackServicesFacade
import org.jetbrains.kotlin.daemon.common.DummyProfiler
import org.jetbrains.kotlin.daemon.common.Profiler
import org.jetbrains.kotlin.daemon.common.RmiFriendlyCompilationCancelledException
import org.jetbrains.kotlin.progress.CompilationCanceledException
import java.util.concurrent.TimeUnit
val CANCELED_STATUS_CHECK_THRESHOLD_NS = TimeUnit.MILLISECONDS.toNanos(100)
@@ -30,7 +32,12 @@ class RemoteCompilationCanceledStatusClient(val facade: CompilerCallbackServices
val curNanos = System.nanoTime()
if (curNanos - lastChecked > CANCELED_STATUS_CHECK_THRESHOLD_NS) {
profiler.withMeasure(this) {
facade.compilationCanceledStatus_checkCanceled()
try {
facade.compilationCanceledStatus_checkCanceled()
}
catch (e: RmiFriendlyCompilationCancelledException) {
throw CompilationCanceledException()
}
}
lastChecked = curNanos
}

View File

@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.cfg;
import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.TokenSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
@@ -285,6 +286,6 @@ public final class WhenChecker {
}
public static void checkReservedPrefix(@NotNull BindingTrace trace, @NotNull KtWhenExpression expression) {
KtPsiUtilKt.checkReservedPrefixWord(trace, expression.getWhenKeyword(), "sealed", "sealed when");
KtPsiUtilKt.checkReservedPrefixWord(trace, expression.getWhenKeyword(), "sealed", TokenSet.EMPTY, "sealed when");
}
}

View File

@@ -420,6 +420,8 @@ public interface Errors {
DiagnosticFactory0<KtParameter> USELESS_VARARG_ON_PARAMETER = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<KtDeclaration> MULTIPLE_VARARG_PARAMETERS = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
// Named parameters
DiagnosticFactory0<KtParameter> DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE = DiagnosticFactory0.create(ERROR, PARAMETER_DEFAULT_VALUE);

View File

@@ -234,6 +234,7 @@ public class DefaultErrorMessages {
MAP.put(ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE, "An anonymous function is not allowed to specify default values for its parameters");
MAP.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless");
MAP.put(MULTIPLE_VARARG_PARAMETERS, "Declarations with multiple vararg-parameters are prohibited");
MAP.put(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT, "Projections are not allowed on type arguments of functions and properties");
MAP.put(SUPERTYPE_NOT_INITIALIZED, "This type has a constructor, and thus must be initialized here");

View File

@@ -241,11 +241,15 @@ public interface KtTokens {
TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, EXCLEXCL, MUL, PLUS,
MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR,
SAFE_ACCESS, ELVIS,
// MAP, FILTER,
RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ,
NOT_IN, NOT_IS,
IDENTIFIER);
TokenSet BINARY_OPERATIONS = TokenSet.create(AS_KEYWORD, AS_SAFE, IS_KEYWORD, IN_KEYWORD, MUL, PLUS,
MINUS, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR,
ELVIS, RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ,
NOT_IN, NOT_IS);
TokenSet AUGMENTED_ASSIGNMENTS = TokenSet.create(PLUSEQ, MINUSEQ, MULTEQ, PERCEQ, DIVEQ);
TokenSet ALL_ASSIGNMENTS = TokenSet.create(EQ, PLUSEQ, MINUSEQ, MULTEQ, PERCEQ, DIVEQ);
}

View File

@@ -24,6 +24,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiWhiteSpace;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.codeInsight.CommentUtilCore;
import com.intellij.util.containers.ContainerUtil;
@@ -608,9 +609,21 @@ public class KtPsiUtil {
return prev;
}
/**
* Example:
* code: async* {}
* element = "{}"
* word = "async"
* suffixTokens = [+, -, *, /, %]
*
* result = async
*/
@Nullable
public static PsiElement getPreviousWord(@NotNull PsiElement element, @NotNull String word) {
public static PsiElement getPreviousWord(@NotNull PsiElement element, @NotNull String word, @NotNull TokenSet suffixTokens) {
PsiElement prev = prevLeafIgnoringWhitespaceAndComments(element);
if (prev != null && suffixTokens.contains(prev.getNode().getElementType())) {
prev = PsiTreeUtil.prevLeaf(prev, false);
}
if (prev != null && prev.getNode().getElementType() == KtTokens.IDENTIFIER && word.equals(prev.getText())) {
return prev;
}

View File

@@ -23,6 +23,7 @@ import com.intellij.psi.PsiParameter
import com.intellij.psi.PsiParameterList
import com.intellij.psi.PsiWhiteSpace
import com.intellij.psi.stubs.StubElement
import com.intellij.psi.tree.TokenSet
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.kotlin.KtNodeTypes
import org.jetbrains.kotlin.diagnostics.DiagnosticSink
@@ -434,8 +435,8 @@ fun canPlaceAfterSimpleNameEntry(element: PsiElement?): Boolean {
return !BAD_NEIGHBOUR_FOR_SIMPLE_TEMPLATE_ENTRY_PATTERN.matches(entryText)
}
fun checkReservedPrefixWord(sink: DiagnosticSink, element: PsiElement, word: String, message: String) {
KtPsiUtil.getPreviousWord(element, word)?.let {
fun checkReservedPrefixWord(sink: DiagnosticSink, element: PsiElement, word: String, suffixTokens: TokenSet, message: String) {
KtPsiUtil.getPreviousWord(element, word, suffixTokens)?.let {
sink.report(Errors.UNSUPPORTED.on(it, message))
}
}

View File

@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.psi.stubs.elements
import com.intellij.psi.PsiElement
import com.intellij.psi.stubs.StubElement
import com.intellij.psi.stubs.StubInputStream
import com.intellij.psi.stubs.StubOutputStream

View File

@@ -130,6 +130,7 @@ class DeclarationsChecker(
declaration.checkTypeReferences()
modifiersChecker.checkModifiersForDeclaration(declaration, constructorDescriptor)
identifierChecker.checkDeclaration(declaration, trace)
checkVarargParameters(declaration, constructorDescriptor)
}
private fun checkModifiersAndAnnotationsInPackageDirective(file: KtFile) {
@@ -323,11 +324,13 @@ class DeclarationsChecker(
else if (aClass is KtEnumEntry) {
checkEnumEntry(aClass, classDescriptor)
}
for (memberDescriptor in classDescriptor.declaredCallableMembers) {
if (memberDescriptor.kind != CallableMemberDescriptor.Kind.DECLARATION) continue
val member = DescriptorToSourceUtils.descriptorToDeclaration(memberDescriptor) as? KtFunction
if (member != null && memberDescriptor is FunctionDescriptor) {
checkFunctionExposedType(member, memberDescriptor)
checkVarargParameters(member, memberDescriptor)
}
}
}
@@ -650,7 +653,16 @@ class DeclarationsChecker(
trace.report(IMPLICIT_NOTHING_RETURN_TYPE.on(nameIdentifier ?: function))
}
}
checkFunctionExposedType(function, functionDescriptor)
checkVarargParameters(function, functionDescriptor)
}
private fun checkVarargParameters(declaration: KtDeclaration, callableDescriptor: CallableDescriptor) {
val numberOfVarargParameters = callableDescriptor.valueParameters.count { it.varargElementType != null }
if (numberOfVarargParameters > 1) {
trace.report(MULTIPLE_VARARG_PARAMETERS.on(declaration))
}
}
private fun checkFunctionExposedType(function: KtFunction, functionDescriptor: FunctionDescriptor) {

View File

@@ -88,17 +88,9 @@ class OverloadingConflictResolver(private val builtIns: KotlinBuiltIns) {
CandidateCallWithArgumentMapping.create(candidateCall) { it.arguments.filter { it.getArgumentExpression() != null } }
}
val (varargCandidates, regularCandidates) = conflictingCandidates.partition { it.resultingDescriptor.hasVarargs }
val mostSpecificRegularCandidates = regularCandidates.selectMostSpecificCallsWithArgumentMapping(discriminateGenericDescriptors)
val mostSpecificCandidates = conflictingCandidates.selectMostSpecificCallsWithArgumentMapping(discriminateGenericDescriptors)
return when {
mostSpecificRegularCandidates.size > 1 ->
null
mostSpecificRegularCandidates.size == 1 ->
mostSpecificRegularCandidates.single()
else ->
varargCandidates.selectMostSpecificCallsWithArgumentMapping(discriminateGenericDescriptors).singleOrNull()
}
return mostSpecificCandidates.singleOrNull()
}
private fun <D : CallableDescriptor, K> Collection<CandidateCallWithArgumentMapping<D, K>>.selectMostSpecificCallsWithArgumentMapping(
@@ -139,7 +131,7 @@ class OverloadingConflictResolver(private val builtIns: KotlinBuiltIns) {
/**
* Returns `true` if `d1` is definitely not less specific than `d2`,
* `false` if `d1` is definitely less specific than `d2` or undecided.
* `false` otherwise.
*/
private fun <D : CallableDescriptor, K> compareCallsWithArgumentMapping(
call1: CandidateCallWithArgumentMapping<D, K>,
@@ -160,6 +152,11 @@ class OverloadingConflictResolver(private val builtIns: KotlinBuiltIns) {
return it
}
val hasVarargs1 = call1.resultingDescriptor.hasVarargs
val hasVarargs2 = call2.resultingDescriptor.hasVarargs
if (hasVarargs1 && !hasVarargs2) return false
if (!hasVarargs1 && hasVarargs2) return true
assert(call1.argumentsCount == call2.argumentsCount) {
"$call1 and $call2 have different number of explicit arguments"
}

View File

@@ -109,6 +109,9 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
if (!function.hasBody() && !function.hasModifier(KtTokens.EXTERNAL_KEYWORD)) {
context.trace.report(NON_MEMBER_FUNCTION_NO_BODY.on(function, functionDescriptor))
}
if (functionDescriptor.valueParameters.count { it.varargElementType != null } > 1) {
context.trace.report(MULTIPLE_VARARG_PARAMETERS.on(function))
}
if (isStatement) {
return createTypeInfo(components.dataFlowAnalyzer.checkStatementType(function, context), context)
@@ -159,7 +162,7 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
}
private fun checkReservedAsync(context: ExpressionTypingContext, expression: PsiElement) {
checkReservedPrefixWord(context.trace, expression, "async", "async block/lambda. Use 'async() { ... }' or 'async(fun...)'")
checkReservedPrefixWord(context.trace, expression, "async", KtTokens.BINARY_OPERATIONS, "async block/lambda. Use 'async() { ... }' or 'async(fun...)'")
}
private fun createFunctionLiteralDescriptor(

View File

@@ -0,0 +1,13 @@
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("Test")
fun foo() {
}
/*ACC_PUBLIC ACC_FINAL ACC_SUPER */
// 1 access flags 0x31
/*ACC_SYNTHETIC ACC_FINAL ACC_SUPER */
// 1 access flags 0x1030

View File

@@ -4,4 +4,4 @@ error: supertypes of the following classes cannot be resolved. Please make sure
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/source.kt:5:22: error: unresolved reference: foo
fun bar() = SubSub().foo()
^
COMPILATION_ERROR
COMPILATION_ERROR

View File

@@ -4,4 +4,4 @@ error: supertypes of the following classes cannot be resolved. Please make sure
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInKotlin/source.kt:5:22: error: unresolved reference: foo
fun bar() = SubSub().foo()
^
COMPILATION_ERROR
COMPILATION_ERROR

View File

@@ -6,6 +6,7 @@ infix fun Any.async(f: () -> Unit) = f()
fun test(foo: Any) {
<!UNSUPPORTED!>async<!> { }
`async` { }
<!UNSUPPORTED!>async<!> /**/ { }
foo <!UNSUPPORTED!>async<!> { }
@@ -15,7 +16,30 @@ fun test(foo: Any) {
foo async ({ })
foo <!UNSUPPORTED!>async<!> fun () {}
foo `async` fun () {}
foo async (fun () {})
async (fun () {})
}
object async {
operator fun plus(f: () -> Unit) = f()
operator fun minus(f: () -> Unit) = f()
operator fun times(f: () -> Unit) = f()
operator fun div(f: () -> Unit) = f()
operator fun mod(f: () -> Unit) = f()
}
fun test() {
<!UNSUPPORTED!>async<!>+ {}
<!UNSUPPORTED!>async<!>- {}
<!UNSUPPORTED!>async<!>* {}
<!UNSUPPORTED!>async<!>/ {}
<!UNSUPPORTED!>async<!>% {}
async + {}
async - {}
async * {}
async / {}
async % {}
}

View File

@@ -1,5 +1,18 @@
package
public fun async(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public fun test(): kotlin.Unit
public fun test(/*0*/ foo: kotlin.Any): kotlin.Unit
public infix fun kotlin.Any.async(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public object async {
private constructor async()
public final operator fun div(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun minus(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public final operator fun mod(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public final operator fun plus(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public final operator fun times(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -33,11 +33,6 @@ annotation class Ann8(val p1: Array<String>,
val p3: Array<MyEnum>,
val p4: Array<Ann1>)
annotation class Ann9(vararg val p1: String,
vararg val p2: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>Class<*><!>,
vararg val p3: MyEnum,
vararg val p4: Ann1,
vararg val p5: Int)
// INCORRECT
annotation class InAnn1(val p1: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>Int?<!>,
@@ -64,6 +59,11 @@ annotation class InAnn10(val p1: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>String?<!
annotation class InAnn11(val p1: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>Ann1?<!>)
annotation class InAnn12(val p1: <!NULLABLE_TYPE_OF_ANNOTATION_MEMBER!>MyEnum?<!>)
annotation class InAnn13<!MULTIPLE_VARARG_PARAMETERS!>(vararg val p1: String,
vararg val p2: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>Class<*><!>,
vararg val p3: MyEnum,
vararg val p4: Ann1,
vararg val p5: Int)<!>
enum class MyEnum {
A

View File

@@ -83,18 +83,6 @@ package test {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final annotation class Ann9 : kotlin.Annotation {
public constructor Ann9(/*0*/ vararg p1: kotlin.String /*kotlin.Array<out kotlin.String>*/, /*1*/ vararg p2: java.lang.Class<*> /*kotlin.Array<out java.lang.Class<*>>*/, /*2*/ vararg p3: test.MyEnum /*kotlin.Array<out test.MyEnum>*/, /*3*/ vararg p4: test.Ann1 /*kotlin.Array<out test.Ann1>*/, /*4*/ vararg p5: kotlin.Int /*kotlin.IntArray*/)
public final val p1: kotlin.Array<out kotlin.String>
public final val p2: kotlin.Array<out java.lang.Class<*>>
public final val p3: kotlin.Array<out test.MyEnum>
public final val p4: kotlin.Array<out test.Ann1>
public final val p5: kotlin.IntArray
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final annotation class InAnn1 : kotlin.Annotation {
public constructor InAnn1(/*0*/ p1: kotlin.Int?, /*1*/ p3: kotlin.Short?, /*2*/ p4: kotlin.Long?, /*3*/ p5: kotlin.Double?, /*4*/ p6: kotlin.Float?, /*5*/ p7: kotlin.Char?, /*6*/ p8: kotlin.Boolean?)
public final val p1: kotlin.Int?
@@ -133,6 +121,18 @@ package test {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final annotation class InAnn13 : kotlin.Annotation {
public constructor InAnn13(/*0*/ vararg p1: kotlin.String /*kotlin.Array<out kotlin.String>*/, /*1*/ vararg p2: java.lang.Class<*> /*kotlin.Array<out java.lang.Class<*>>*/, /*2*/ vararg p3: test.MyEnum /*kotlin.Array<out test.MyEnum>*/, /*3*/ vararg p4: test.Ann1 /*kotlin.Array<out test.Ann1>*/, /*4*/ vararg p5: kotlin.Int /*kotlin.IntArray*/)
public final val p1: kotlin.Array<out kotlin.String>
public final val p2: kotlin.Array<out java.lang.Class<*>>
public final val p3: kotlin.Array<out test.MyEnum>
public final val p4: kotlin.Array<out test.Ann1>
public final val p5: kotlin.IntArray
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final annotation class InAnn4 : kotlin.Annotation {
public constructor InAnn4(/*0*/ p1: kotlin.Array<kotlin.Int>, /*1*/ p2: kotlin.Array<kotlin.Int>?)
public final val p1: kotlin.Array<kotlin.Int>

View File

@@ -0,0 +1,27 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED
<!MULTIPLE_VARARG_PARAMETERS!>fun test(vararg x1: Int, vararg x2: Int)<!> {
<!MULTIPLE_VARARG_PARAMETERS!>fun test2(vararg x1: Int, vararg x2: Int)<!> {
class LocalClass<!MULTIPLE_VARARG_PARAMETERS!>(vararg x1: Int, vararg x2: Int)<!> {
<!MULTIPLE_VARARG_PARAMETERS!>constructor(vararg x1: Int, vararg x2: Int, xx: Int)<!> {}
}
<!MULTIPLE_VARARG_PARAMETERS!>fun test3(vararg x1: Int, vararg x2: Int)<!> {}
}
}
<!MULTIPLE_VARARG_PARAMETERS!>fun Any.test(vararg x1: Int, vararg x2: Int, vararg x3: Int)<!> {}
interface I {
<!MULTIPLE_VARARG_PARAMETERS!>fun test(vararg x1: Int, vararg x2: Int)<!>
}
abstract class C<!MULTIPLE_VARARG_PARAMETERS!>(vararg x1: Int, vararg x2: Int, b: Boolean)<!> {
<!MULTIPLE_VARARG_PARAMETERS!>fun test(vararg x1: Int, vararg x2: Int)<!> {}
<!MULTIPLE_VARARG_PARAMETERS!>abstract fun test2(vararg x1: Int, vararg x2: Int)<!>
class CC<!MULTIPLE_VARARG_PARAMETERS!>(vararg x1: Int, vararg x2: Int, b: Boolean)<!> {
<!MULTIPLE_VARARG_PARAMETERS!>constructor(vararg x1: Int, vararg x2: Int)<!> {}
<!MULTIPLE_VARARG_PARAMETERS!>fun test(vararg x1: Int, vararg x2: Int)<!> {}
}
}

View File

@@ -0,0 +1,29 @@
package
public fun test(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public fun kotlin.Any.test(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/, /*2*/ vararg x3: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public abstract class C {
public constructor C(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/, /*2*/ b: kotlin.Boolean)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final fun test(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public abstract fun test2(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final class CC {
public constructor CC(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/)
public constructor CC(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/, /*2*/ b: kotlin.Boolean)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final fun test(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
public interface I {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract fun test(/*0*/ vararg x1: kotlin.Int /*kotlin.IntArray*/, /*1*/ vararg x2: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -1,11 +1,11 @@
fun f(
<!MULTIPLE_VARARG_PARAMETERS!>fun f(
<!VAL_OR_VAR_ON_FUN_PARAMETER!>val<!> a: Int,
<!VAL_OR_VAR_ON_FUN_PARAMETER!>var<!> b: Int,
c: Int,
vararg <!VAL_OR_VAR_ON_FUN_PARAMETER!>var<!> d: Int,
vararg <!VAL_OR_VAR_ON_FUN_PARAMETER!>val<!> e: Int,
vararg f: Int
) {
)<!> {
a + b + c + d[0] + e[0] + f[0] // to avoid 'unused parameter'

View File

@@ -1,4 +1,4 @@
// FILE: InOut.k
// FILE: InOut.kt
interface In<in T>
// FILE: J1.java

View File

@@ -0,0 +1,13 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Right
object Wrong
interface A<T>
interface B<T> : A<T>
fun <T> foo(vararg t: T) = Wrong
fun <T> foo(t: A<T>) = Wrong
fun <T> foo(t: B<T>) = Right
fun test(b: B<Int>): Right = foo(b)

View File

@@ -0,0 +1,32 @@
package
public fun </*0*/ T> foo(/*0*/ t: A<T>): Wrong
public fun </*0*/ T> foo(/*0*/ t: B<T>): Right
public fun </*0*/ T> foo(/*0*/ vararg t: T /*kotlin.Array<out T>*/): Wrong
public fun test(/*0*/ b: B<kotlin.Int>): Right
public interface A</*0*/ T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B</*0*/ T> : A<T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public object Right {
private constructor Right()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public object Wrong {
private constructor Wrong()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -12,4 +12,4 @@ fun foo() {
.bar()
}
// 2 3 1 7 8 9 8 9 11 12 11 12 17 13
// 2 3 1 7 8 9 11 12 16 13

View File

@@ -12,4 +12,4 @@ fun foo() {
.bar()
}
// 2 3 1 7 8 9 8 9 11 12 11 17 12 17 13
// 2 3 1 7 8 9 11 16 12 16 13

View File

@@ -3,4 +3,4 @@ fun foo() {
42
}
// 2 3 2 4
// 3 2 4

View File

@@ -9,4 +9,4 @@ fun foo(i: Int = 1) {
inline fun bar(i: Int = 1) {
}
// 2 3 9 10 4 7 6 10 9 10
// 2 3 9 4 7 6 10 9 10

View File

@@ -13,4 +13,4 @@ inline fun foo(f: () -> Unit) {
f()
}
// 2 12 13 3 4 14 6 12 13 7 8 14 9 12 13 14
// 2 12 3 4 6 12 7 8 9 12 13 14

View File

@@ -12,4 +12,4 @@ fun foo() {
}
}
// 2 3 5 6 8 9 11 8 13
// 2 3 5 8 9 11 8 13

View File

@@ -12,4 +12,4 @@ fun foo() {
}
}
// 2 3 5 6 8 9 11 8 13
// 2 3 5 8 9 11 8 13

View File

@@ -16,4 +16,4 @@ fun foo() {
}
}
// 2 3 7 5 7 8 10 11 15 13 15 10 17
// 2 3 7 5 7 10 11 15 13 15 10 17

View File

@@ -12,4 +12,4 @@ fun foo() {
}
}
// 2 3 5 6 8 9 11 8 13
// 2 3 5 8 9 11 8 13

View File

@@ -12,4 +12,4 @@ fun foo(x: Int) {
}
}
// 2 3 4 5 6 8 9 10 11 8 13
// 3 4 5 9 10 11 8 13

View File

@@ -12,4 +12,4 @@ fun foo(x: Int) {
}
}
// 2 3 4 5 6 8 9 10 11 8 13
// 2 3 4 5 8 9 10 11 8 13

View File

@@ -2,7 +2,7 @@ package test
public open class InnerClassTypeMultipleGeneric {
public constructor InnerClassTypeMultipleGeneric()
public open fun staticType(): test.InnerClassTypeMultipleGeneric.Outer<kotlin.Char!, kotlin.Boolean!>.Inner<kotlin.Byte!>!
public open fun staticType(): test.InnerClassTypeMultipleGeneric.Outer<[ERROR : Unresolved Java type parameter: E1]!, [ERROR : Unresolved Java type parameter: E2]!>.Inner<kotlin.Byte!>!
public open inner class BaseOuter</*0*/ H1 : kotlin.Any!, /*1*/ H2 : kotlin.Any!> {
public constructor BaseOuter</*0*/ H1 : kotlin.Any!, /*1*/ H2 : kotlin.Any!>()
@@ -16,7 +16,7 @@ public open class InnerClassTypeMultipleGeneric {
public constructor Outer</*0*/ E1 : kotlin.Any!, /*1*/ E2 : kotlin.Any!>()
public open fun bar(): test.InnerClassTypeMultipleGeneric.BaseOuter<kotlin.Int!, E1!>.BaseInner<java.lang.Class<*>!, kotlin.CharSequence!>!
public open inner class Inner</*0*/ E3 : kotlin.Any!> /*captured type parameters: /*1*/ E1 : kotlin.Any!, /*2*/ E2 : kotlin.Any!*/ : test.InnerClassTypeMultipleGeneric.BaseOuter<E2!, E3!>.BaseInner<kotlin.Double!, kotlin.String!> {
public open inner class Inner</*0*/ E3 : kotlin.Any!> /*captured type parameters: /*1*/ E1 : kotlin.Any!, /*2*/ E2 : kotlin.Any!*/ : test.InnerClassTypeMultipleGeneric.BaseOuter<kotlin.Int!, E1!>.BaseInner<kotlin.Double!, kotlin.String!> {
public constructor Inner</*0*/ E3 : kotlin.Any!>()
}
}

View File

@@ -0,0 +1,11 @@
interface Test {
fun a() {
}
}
// TESTED_OBJECT_KIND: class
// TESTED_OBJECTS: Test$DefaultImpls
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_SUPER

View File

@@ -0,0 +1,19 @@
enum class BigEnum {
ITEM1,
ITEM2
}
fun bar1(x : BigEnum) : String {
when (x) {
BigEnum.ITEM1 -> return "123"
BigEnum.ITEM2-> return "456"
}
return "-1";
}
// TESTED_OBJECT_KIND: class
// TESTED_OBJECTS: MappingWhenKt$WhenMappings
// FLAGS: ACC_PUBLIC, ACC_SYNTHETIC, ACC_FINAL, ACC_SUPER

View File

@@ -0,0 +1,7 @@
fun foo() {
}
// TESTED_OBJECT_KIND: class
// TESTED_OBJECTS: SimpleFilePackageFacadeKt
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_SUPER

View File

@@ -4224,6 +4224,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("mulitpleVarargParameters.kt")
public void testMulitpleVarargParameters() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/declarationChecks/mulitpleVarargParameters.kt");
doTest(fileName);
}
@TestMetadata("MultiDeclarationErrors.kt")
public void testMultiDeclarationErrors() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt");
@@ -13736,6 +13742,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("kt10472.kt")
public void testKt10472() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.kt");
doTest(fileName);
}
@TestMetadata("numberOfDefaults.kt")
public void testNumberOfDefaults() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt");

View File

@@ -305,6 +305,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("superFlagInMultiFileFacade.kt")
public void testSuperFlagInMultiFileFacade() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/superFlagInMultiFileFacade.kt");
doTest(fileName);
}
@TestMetadata("topLevelFunWithDefaultArgs.kt")
public void testTopLevelFunWithDefaultArgs() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt");

View File

@@ -93,6 +93,18 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/class/accessFlags"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("defaultImpls.kt")
public void testDefaultImpls() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/class/accessFlags/defaultImpls.kt");
doTest(fileName);
}
@TestMetadata("mappingWhen.kt")
public void testMappingWhen() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/class/accessFlags/mappingWhen.kt");
doTest(fileName);
}
@TestMetadata("objectLiteral.kt")
public void testObjectLiteral() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/class/accessFlags/objectLiteral.kt");
@@ -122,6 +134,12 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/class/accessFlags/publicInterface.kt");
doTest(fileName);
}
@TestMetadata("simpleFilePackageFacade.kt")
public void testSimpleFilePackageFacade() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/class/accessFlags/simpleFilePackageFacade.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/writeFlags/class/deprecatedFlag")

View File

@@ -33,7 +33,10 @@ public abstract class AbstractCompileKotlinAgainstInlineKotlinTest : AbstractCom
try {
val sourceFiles = factory1.getInputFiles() + factory2.getInputFiles()
InlineTestUtil.checkNoCallsToInline(allGeneratedFiles.filterClassFiles(), sourceFiles)
checkSMAP(sourceFiles, allGeneratedFiles.filterClassFiles())
if (getTestName(true) != "smap") {
checkSMAP(sourceFiles, allGeneratedFiles.filterClassFiles())
}
}
catch (e: Throwable) {
System.out.println(factory1.createText() + "\n" + factory2.createText())

View File

@@ -20,6 +20,7 @@ import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import java.io.File;
@@ -3206,7 +3207,8 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
}
@TestMetadata("InnerClassTypeMultipleGeneric.java")
public void testInnerClassTypeMultipleGeneric() throws Exception {
@Ignore
public void ignoreTestInnerClassTypeMultipleGeneric() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InnerClassTypeMultipleGeneric.java");
doTest(fileName);
}

View File

@@ -24,3 +24,4 @@ object BuiltInSerializerProtocol : SerializerExtensionProtocol(
BuiltInsProtoBuf.propertyAnnotation, BuiltInsProtoBuf.enumEntryAnnotation, BuiltInsProtoBuf.compileTimeValue,
BuiltInsProtoBuf.parameterAnnotation, BuiltInsProtoBuf.typeAnnotation, BuiltInsProtoBuf.typeParameterAnnotation
)

View File

@@ -10,6 +10,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="library" name="asm" level="project" />
<orderEntry type="library" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" scope="TEST" name="junit-4.11" level="project" />
</component>
</module>
</module>

View File

@@ -700,7 +700,6 @@ fun main(args: Array<String>) {
model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto")
model("debugger/tinyApp/src/stepping/stepInto", testMethod = "doStepIntoTest", testClassName = "StepIntoOnly")
model("debugger/tinyApp/src/stepping/stepOut", testMethod = "doStepOutTest")
model("debugger/tinyApp/src/stepping/stepOver", testMethod = "doStepOverTest")
model("debugger/tinyApp/src/stepping/filters", testMethod = "doStepIntoTest")
model("debugger/tinyApp/src/stepping/custom", testMethod = "doCustomTest")
}

View File

@@ -263,6 +263,7 @@ suppress.warning.for=Suppress ''{0}'' for {1} {2}
reflection.not.found=Reflection not found in the classpath
add.reflection.to.classpath=Add kotlin-reflect.jar to the classpath
add.test.to.classpath=Add kotlin-test.jar to the classpath
# Kotlin Compiler Settings Tab

View File

@@ -100,7 +100,6 @@ public object JarUserDataManager {
private fun storeUserData(counter: JarBooleanPropertyCounter, localJarFile: VirtualFile,
hasFileWithProperty: Boolean?, timestamp: Long? = null) {
assert(localJarFile.isInLocalFileSystem)
assert((timestamp == null) == (hasFileWithProperty == null)) { "Using empty timestamp is only allowed for storing not counted value" }
localJarFile.putUserData(counter.key,

View File

@@ -31,7 +31,9 @@ import java.io.IOException
public class ClsJavaStubByVirtualFileCache {
private class CachedJavaStub(val modificationStamp: Long, val javaFileStub: PsiJavaFileStubImpl)
private val cache = ContainerUtil.createConcurrentWeakKeySoftValueMap<VirtualFile, CachedJavaStub>()
private val cache = ContainerUtil.createConcurrentWeakKeySoftValueMap<VirtualFile, CachedJavaStub>(
100, 0.75f, Runtime.getRuntime().availableProcessors(), ContainerUtil.canonicalStrategy<VirtualFile>()
)
public fun get(classFile: VirtualFile): PsiJavaFileStubImpl? {
val cached = cache.get(classFile)

View File

@@ -0,0 +1,43 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.configuration
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.openapi.editor.markup.GutterIconRenderer
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.MainFunctionDetector
import org.jetbrains.kotlin.psi.KtNamedFunction
import org.jetbrains.kotlin.psi.KtVisitorVoid
import org.jetbrains.kotlin.resolve.BindingContext
import javax.swing.Icon
class MainFunctionGutterVisitor(val holder: AnnotationHolder, val bindingContext: BindingContext) : KtVisitorVoid() {
override fun visitNamedFunction(function: KtNamedFunction) {
if (MainFunctionDetector(bindingContext).isMain(function)) {
function.nameIdentifier?.let { nameIdentifier ->
holder.createInfoAnnotation(nameIdentifier, "Run configuration from here").gutterIconRenderer = MainGutterIconRenderer(nameIdentifier)
}
}
}
}
class MainGutterIconRenderer(val nameIdentifier: PsiElement) : GutterIconRenderer() {
override fun getIcon(): Icon = KotlinIcons.LAUNCH
override fun hashCode(): Int = nameIdentifier.hashCode()
override fun equals(other: Any?): Boolean = other is MainGutterIconRenderer && other.nameIdentifier == nameIdentifier
}

View File

@@ -36,17 +36,7 @@ class KotlinDecompiledFileViewProvider(
) : SingleRootFileViewProvider(manager, file, physical, KotlinLanguage.INSTANCE) {
val content : LockedClearableLazyValue<String> = LockedClearableLazyValue(Any()) {
val psiFile = createFile(manager.getProject(), file, KotlinFileType.INSTANCE)
val text = psiFile?.getText() ?: ""
DebugUtil.startPsiModification("Invalidating throw-away copy of file that was used for getting text")
try {
(psiFile as? PsiFileImpl)?.markInvalidated()
}
finally {
DebugUtil.finishPsiModification()
}
text
psiFile?.getText() ?: ""
}
override fun createFile(project: Project, file: VirtualFile, fileType: FileType): PsiFile? {

View File

@@ -41,6 +41,8 @@ import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
import org.jetbrains.kotlin.idea.actions.internal.KotlinInternalMode
import org.jetbrains.kotlin.idea.caches.resolve.analyzeFullyAndGetResult
import org.jetbrains.kotlin.idea.configuration.MainFunctionGutterVisitor
import org.jetbrains.kotlin.idea.kdoc.KDocHighlightingVisitor
import org.jetbrains.kotlin.idea.quickfix.QuickFixes
import org.jetbrains.kotlin.idea.references.mainReference
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil

View File

@@ -82,7 +82,9 @@ class OverridesCompletion(
AllIcons.Gutter.ImplementingMethod
else
AllIcons.Gutter.OverridingMethod
val icon = RowIcon(baseIcon, additionalIcon)
val icon = RowIcon(2)
icon.setIcon(baseIcon, 0)
icon.setIcon(additionalIcon, 1)
val baseClassDeclaration = DescriptorToSourceUtilsIde.getAnyDeclaration(position.project, baseClass)
val baseClassIcon = KotlinDescriptorIconProvider.getIcon(baseClass, baseClassDeclaration, 0)

View File

@@ -25,6 +25,7 @@ import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiDocumentManager
import com.intellij.psi.PsiElement
import com.intellij.psi.codeStyle.CodeStyleSettingsManager
import org.jetbrains.kotlin.idea.core.completion.DeclarationLookupObject
import org.jetbrains.kotlin.idea.core.formatter.KotlinCodeStyleSettings
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.KtTypeArgumentList
@@ -73,10 +74,10 @@ sealed class KotlinFunctionInsertHandler : KotlinCallableInsertHandler() {
val startOffset = context.startOffset
val element = context.file.findElementAt(startOffset) ?: return
addArguments(context, element)
addArguments(context, element, item)
}
private fun addArguments(context : InsertionContext, offsetElement : PsiElement) {
private fun addArguments(context: InsertionContext, offsetElement: PsiElement, item: LookupElement) {
val completionChar = context.getCompletionChar()
if (completionChar == '(') { //TODO: more correct behavior related to braces type
context.setAddCompletionChar(false)
@@ -122,6 +123,12 @@ sealed class KotlinFunctionInsertHandler : KotlinCallableInsertHandler() {
offset += 2
}
// insert additional brackets for reserved syntax: "async {}"
if (insertLambda && (item.`object` as? DeclarationLookupObject)?.name?.identifier == "async") {
document.insertString(offset, "()")
offset += 2
}
var openingBracketOffset = chars.indexOfSkippingSpace(openingBracket, offset)
var closeBracketOffset = openingBracketOffset?.let { chars.indexOfSkippingSpace(closingBracket, it + 1) }
var inBracketsShift = 0

View File

@@ -0,0 +1,7 @@
fun async(a: () -> Unit) {}
fun test() {
asy<caret>
}
// ELEMENT: async

View File

@@ -0,0 +1,7 @@
fun async(a: () -> Unit) {}
fun test() {
async() { <caret> }
}
// ELEMENT: async

View File

@@ -0,0 +1,7 @@
fun async (p: Int, a: () -> Unit) {}
fun test() {
asy<caret>
}
// ELEMENT: async

View File

@@ -0,0 +1,7 @@
fun async (p: Int, a: () -> Unit) {}
fun test() {
async(<caret>)
}
// ELEMENT: async

View File

@@ -0,0 +1,10 @@
fun asyFoo(a: () -> Unit) {}
fun async(a: () -> Unit) {}
fun test() {
asy<caret>Foo { }
}
// ELEMENT: async
// CHAR: '\t'

View File

@@ -0,0 +1,10 @@
fun asyFoo(a: () -> Unit) {}
fun async(a: () -> Unit) {}
fun test() {
async() { }
}
// ELEMENT: async
// CHAR: '\t'

View File

@@ -0,0 +1,10 @@
fun asyFoo(p: Int, a: () -> Unit) {}
fun async(q: Int, a: () -> Unit) {}
fun test() {
asy<caret>Foo(5) { }
}
// ELEMENT: async
// CHAR: '\t'

View File

@@ -0,0 +1,10 @@
fun asyFoo(p: Int, a: () -> Unit) {}
fun async(q: Int, a: () -> Unit) {}
fun test() {
async(<caret>5) { }
}
// ELEMENT: async
// CHAR: '\t'

View File

@@ -378,6 +378,39 @@ public class BasicCompletionHandlerTestGenerated extends AbstractBasicCompletion
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/highOrderFunctions/WithArgsNonEmptyLambdaAfter.kt");
doTest(fileName);
}
@TestMetadata("idea/idea-completion/testData/handlers/basic/highOrderFunctions/async")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Async extends AbstractBasicCompletionHandlerTest {
public void testAllFilesPresentInAsync() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/handlers/basic/highOrderFunctions/async"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("AsyncSimple.kt")
public void testAsyncSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/highOrderFunctions/async/AsyncSimple.kt");
doTest(fileName);
}
@TestMetadata("AsyncWithoutLambda.kt")
public void testAsyncWithoutLambda() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/highOrderFunctions/async/AsyncWithoutLambda.kt");
doTest(fileName);
}
@TestMetadata("FromFooToAsync.kt")
public void testFromFooToAsync() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/highOrderFunctions/async/FromFooToAsync.kt");
doTest(fileName);
}
@TestMetadata("FromFooToAsync2.kt")
public void testFromFooToAsync2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/highOrderFunctions/async/FromFooToAsync2.kt");
doTest(fileName);
}
}
}
@TestMetadata("idea/idea-completion/testData/handlers/basic/override")

View File

@@ -0,0 +1,70 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.js
import com.intellij.openapi.vfs.impl.ArchiveHandler
import com.intellij.openapi.vfs.impl.ArchiveHandler.EntryInfo
import com.intellij.util.ArrayUtil
import gnu.trove.THashMap
import org.jetbrains.kotlin.serialization.js.forEachFile
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils
public open class KotlinJavaScriptHandler(path: String) : ArchiveHandler(path) {
override fun createEntriesMap(): Map<String, EntryInfo> {
val map = THashMap<String, EntryInfo>()
map.put("", createRootEntry())
for(metadata in KotlinJavascriptMetadataUtils.loadMetadata(getFile())) {
val moduleName = metadata.moduleName
metadata.forEachFile {
filePath, fileContent -> getOrCreate(moduleName + "/" + filePath, false, map, fileContent)
}
}
return map
}
private fun getOrCreate(
entryPath: String,
isDirectory: Boolean,
map: MutableMap<String, EntryInfo>,
content: ByteArray = ArrayUtil.EMPTY_BYTE_ARRAY
): EntryInfo {
val info = map[entryPath]
if (info != null) return info
val path = splitPath(entryPath)
val parentInfo = getOrCreate(path.first, true, map)
val newInfo = JsMetaEntryInfo(parentInfo, path.second, isDirectory, content)
map[entryPath] = newInfo
return newInfo
}
override fun contentsToByteArray(relativePath: String): ByteArray {
val entryInfo = getEntryInfo(relativePath)
return if (entryInfo is JsMetaEntryInfo) entryInfo.content else ArrayUtil.EMPTY_BYTE_ARRAY
}
private class JsMetaEntryInfo(
parent: EntryInfo,
shortName: String,
isDirectory: Boolean,
val content: ByteArray
) : EntryInfo(shortName, isDirectory, ArchiveHandler.DEFAULT_LENGTH, ArchiveHandler.DEFAULT_TIMESTAMP, parent)
}

View File

@@ -167,7 +167,8 @@ public class KotlinConsoleRunner(
val placeholderAttrs = TextAttributes()
placeholderAttrs.foregroundColor = ReplColors.PLACEHOLDER_COLOR
placeholderAttrs.fontType = Font.ITALIC
editor.setPlaceholderAttributes(placeholderAttrs)
// editor.setPlaceholderAttributes(placeholderAttrs)
}
private fun disableCompletion(consoleView: LanguageConsoleView) {
@@ -180,7 +181,7 @@ public class KotlinConsoleRunner(
fun configureEditorGutter(editor: EditorEx, color: Color, iconWithTooltip: IconWithTooltip): RangeHighlighter {
editor.settings.isLineMarkerAreaShown = true // hack to show gutter
editor.settings.isFoldingOutlineShown = true
editor.gutterComponentEx.setPaintBackground(true)
// editor.gutterComponentEx.setPaintBackground(true)
val editorColorScheme = editor.colorsScheme
editorColorScheme.setColor(EditorColors.GUTTER_BACKGROUND, color)
editor.colorsScheme = editorColorScheme

View File

@@ -30,7 +30,6 @@ import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.testFramework.LoggedErrorProcessor
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
import org.apache.log4j.Logger
import org.jetbrains.kotlin.idea.actions.internal.KotlinInternalMode
import org.jetbrains.kotlin.test.InTextDirectivesUtils
import org.jetbrains.kotlin.test.KotlinTestUtils
@@ -58,7 +57,7 @@ public abstract class KotlinLightCodeInsightFixtureTestCase : LightCodeInsightFi
invalidateLibraryCache(project)
LoggedErrorProcessor.setNewInstance(object : LoggedErrorProcessor() {
override fun processError(message: String?, t: Throwable?, details: Array<out String>?, logger: Logger) {
override fun processError(message: String?, t: Throwable?, details: Array<out String>?, logger: org.apache.log4j.Logger) {
exceptions.addIfNotNull(t)
super.processError(message, t, details, logger)
}
@@ -71,14 +70,7 @@ public abstract class KotlinLightCodeInsightFixtureTestCase : LightCodeInsightFi
KotlinInternalMode.enabled = kotlinInternalModeOriginalValue
VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory())
unInvalidateBuiltinsAndStdLib(getProject()) {
super.tearDown()
}
if (exceptions.isNotEmpty()) {
exceptions.forEach { it.printStackTrace() }
throw AssertionError("Exceptions in other threads happened")
}
super.tearDown()
}
override fun getProjectDescriptor(): LightProjectDescriptor

View File

@@ -40,8 +40,6 @@ public abstract class KotlinLightPlatformCodeInsightFixtureTestCase: LightPlatfo
KotlinInternalMode.enabled = kotlinInternalModeOriginalValue
VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory())
unInvalidateBuiltinsAndStdLib(getProject()) {
super.tearDown()
}
super.tearDown()
}
}

View File

@@ -25,7 +25,7 @@ import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.testFramework.LightProjectDescriptor;
import org.jetbrains.annotations.NotNull;
public class KotlinLightProjectDescriptor extends LightProjectDescriptor {
public class KotlinLightProjectDescriptor implements LightProjectDescriptor {
protected KotlinLightProjectDescriptor() {
}

View File

@@ -73,17 +73,22 @@ public fun Module.configureAs(kind: ModuleKind) {
}
public fun KtFile.dumpTextWithErrors(): String {
return diagnosticsHeader() + getText()
}
public fun KtFile.diagnosticsHeader(): String {
val diagnostics = analyzeFullyAndGetResult().bindingContext.getDiagnostics()
val errors = diagnostics.filter { it.getSeverity() == Severity.ERROR }
if (errors.isEmpty()) return getText()
val header = errors.map { "// ERROR: " + DefaultErrorMessages.render(it).replace('\n', ' ') }.joinToString("\n", postfix = "\n")
return header + getText()
if (errors.isEmpty()) return ""
return errors.map { "// ERROR: " + DefaultErrorMessages.render(it).replace('\n', ' ') }.joinToString("\n", postfix = "\n")
}
public fun closeAndDeleteProject(): Unit =
ApplicationManager.getApplication().runWriteAction() { LightPlatformTestCase.closeAndDeleteProject() }
public fun unInvalidateBuiltinsAndStdLib(project: Project, runnable: RunnableWithException) {
val fileManager = (PsiManager.getInstance(project) as PsiManagerEx).getFileManager()
val stdLibViewProviders = HashSet<KotlinDecompiledFileViewProvider>()
val vFileToViewProviderMap = ((PsiManager.getInstance(project) as PsiManagerEx).fileManager as FileManagerImpl).vFileToViewProviderMap
for ((file, viewProvider) in vFileToViewProviderMap) {
@@ -94,11 +99,11 @@ public fun unInvalidateBuiltinsAndStdLib(project: Project, runnable: RunnableWit
runnable.run()
// Base tearDown() invalidates builtins and std-lib files. Restore them with brute force.
// Restore mapping between PsiFiles and VirtualFiles dropped in FileManager.cleanupForNextTest(),
// otherwise built-ins psi elements will become invalid in next test.
fun unInvalidateFile(file: PsiFileImpl) {
val field = javaClass<PsiFileImpl>().getDeclaredField("myInvalidated")!!
field.setAccessible(true)
field.set(file, false)
val provider = file.getViewProvider();
fileManager.setViewProvider(provider.getVirtualFile(), provider);
}
stdLibViewProviders.forEach {

View File

@@ -3,7 +3,9 @@
<projectConfigurator implementation="org.jetbrains.kotlin.idea.configuration.KotlinAndroidGradleModuleConfigurator"/>
<projectConfigurator implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleModuleConfigurator"/>
</extensions>
<!--
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
</extensions>
-->
</idea-plugin>

View File

@@ -6,7 +6,7 @@
<version>@snapshot@</version>
<vendor url="http://www.jetbrains.com">JetBrains s.r.o.</vendor>
<idea-version since-build="143.379.11" until-build="144.9999"/>
<idea-version since-build="141.1009.5" until-build="141.9999999"/>
<depends optional="true" config-file="junit.xml">JUnit</depends>
<depends optional="true" config-file="gradle.xml">org.jetbrains.plugins.gradle</depends>
@@ -501,17 +501,12 @@
<debuggerClassFilterProvider implementation="org.jetbrains.kotlin.idea.debugger.filter.KotlinDebuggerInternalClassesFilterProvider"/>
<debugger.nodeRenderer implementation="org.jetbrains.kotlin.idea.debugger.render.KotlinClassWithDelegatedPropertyRenderer"/>
<debugger.sourcePositionProvider implementation="org.jetbrains.kotlin.idea.debugger.KotlinSourcePositionProvider"/>
<debugger.sourcePositionHighlighter implementation="org.jetbrains.kotlin.idea.debugger.KotlinSourcePositionHighlighter"/>
<debugger.frameExtraVarsProvider implementation="org.jetbrains.kotlin.idea.debugger.KotlinFrameExtraVariablesProvider"/>
<debugger.extraSteppingFilter implementation="org.jetbrains.kotlin.idea.ExtraSteppingFilter"/>
<xdebugger.settings implementation="org.jetbrains.kotlin.idea.debugger.KotlinDebuggerSettings"/>
<xdebugger.breakpointType implementation="org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinFieldBreakpointType"/>
<xdebugger.breakpointType implementation="org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinLineBreakpointType" order="first"/>
<debugger.syntheticProvider implementation="org.jetbrains.kotlin.idea.debugger.filter.KotlinSyntheticTypeComponentProvider"/>
<debugger.javaBreakpointHandlerFactory implementation="org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinFieldBreakpointHandlerFactory"/>
<debugger.javaBreakpointHandlerFactory implementation="org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinLineBreakpointHandlerFactory"/>
<debugger.jvmSteppingCommandProvider implementation="org.jetbrains.kotlin.idea.debugger.stepping.KotlinSteppingCommandProvider"/>
<debugger.simplePropertyGetterProvider implementation="org.jetbrains.kotlin.idea.debugger.stepping.KotlinSimpleGetterProvider"/>
<debugger.javaBreakpointHandlerFactory implementation="org.jetbrains.kotlin.idea.debugger.breakpoints.KotlinBreakpointHandlerFactory"/>
<codeInsight.implementMethod language="kotlin" implementationClass="org.jetbrains.kotlin.idea.core.overrideImplement.ImplementMembersHandler"/>
<codeInsight.overrideMethod language="kotlin" implementationClass="org.jetbrains.kotlin.idea.core.overrideImplement.OverrideMembersHandler"/>

View File

@@ -95,7 +95,7 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
for (host in RepositoryHelper.getPluginHosts().filterNotNull()) {
val plugins = try {
RepositoryHelper.loadPlugins(host, null)
RepositoryHelper.loadPlugins(host, null, null)
}
catch(e: Exception) {
LOG.info("Checking custom plugin reposityory $host failed", e)

View File

@@ -62,7 +62,7 @@ public class ShowExpressionTypeAction : AnAction() {
}
if (type != null) {
HintManager.getInstance().showInformationHint(editor, renderTypeHint(type))
HintManager.getInstance().showInformationHint(editor, "<html>" + DescriptorRenderer.HTML.renderType(type) + "</html>")
}
}

View File

@@ -18,9 +18,6 @@ package org.jetbrains.kotlin.idea.actions.generate
import com.intellij.codeInsight.CodeInsightActionHandler
import com.intellij.codeInsight.actions.CodeInsightAction
import com.intellij.lang.ContextAwareActionHandler
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.actionSystem.Presentation
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
@@ -30,21 +27,6 @@ import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
abstract class KotlinGenerateActionBase() : CodeInsightAction(), CodeInsightActionHandler {
override fun update(
presentation: Presentation,
project: Project,
editor: Editor,
file: PsiFile,
dataContext: DataContext,
actionPlace: String?
) {
super.update(presentation, project, editor, file, dataContext, actionPlace)
val actionHandler = handler
if (actionHandler is ContextAwareActionHandler && presentation.isEnabled) {
presentation.isEnabled = actionHandler.isAvailableForQuickList(editor, file, dataContext)
}
}
override fun isValidForFile(project: Project, editor: Editor, file: PsiFile): Boolean {
if (file !is KtFile || file.isCompiled) return false

View File

@@ -1,41 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.codeInsight
import com.intellij.lang.ExpressionTypeProvider
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.idea.actions.ShowExpressionTypeAction
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtFunction
import org.jetbrains.kotlin.psi.KtStatementExpression
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
class KotlinExpressionTypeProvider : ExpressionTypeProvider<KtExpression>() {
override fun getExpressionsAt(elementAt: PsiElement): List<KtExpression> =
elementAt.parentsWithSelf.filterIsInstance<KtExpression>().filterNot { it.shouldSkip() }.toArrayList()
private fun KtExpression.shouldSkip(): Boolean {
return this is KtStatementExpression && this !is KtFunction
}
override fun getInformationHint(element: KtExpression): String {
val type = ShowExpressionTypeAction.typeByExpression(element) ?: return "Type is unknown"
return ShowExpressionTypeAction.renderTypeHint(type)
}
override fun getErrorHint(): String = "No expression found"
}

View File

@@ -40,18 +40,25 @@ public class KotlinParenthesesSurrounder extends KotlinExpressionSurrounder {
@Nullable
@Override
public TextRange surroundExpression( @NotNull Project project, @NotNull Editor editor, @NotNull KtExpression expression) {
KtParenthesizedExpression parenthesizedExpression = (KtParenthesizedExpression) KtPsiFactoryKt
.KtPsiFactory(expression).createExpression("(a)");
KtExpression expressionWithoutParentheses = parenthesizedExpression.getExpression();
assert expressionWithoutParentheses != null : "JetExpression should exists for " + parenthesizedExpression.getText() + " expression";
expressionWithoutParentheses.replace(expression);
expression = (KtExpression) expression.replace(parenthesizedExpression);
public TextRange surroundExpression(@NotNull Project project, @NotNull Editor editor, @NotNull KtExpression expression) {
expression = surroundWithParentheses(expression);
CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(expression);
int offset = expression.getTextRange().getEndOffset();
return new TextRange(offset, offset);
}
@NotNull
public static KtExpression surroundWithParentheses(@NotNull KtExpression expression) {
KtParenthesizedExpression parenthesizedExpression =
(KtParenthesizedExpression) KtPsiFactoryKt.KtPsiFactory(expression).createExpression("(a)");
KtExpression expressionWithoutParentheses = parenthesizedExpression.getExpression();
assert expressionWithoutParentheses != null : "JetExpression should exists for " + parenthesizedExpression.getText() + " expression";
expressionWithoutParentheses.replace(expression);
expression = (KtExpression) expression.replace(parenthesizedExpression);
return expression;
}
}

View File

@@ -27,6 +27,7 @@ import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
import org.jetbrains.plugins.gradle.frameworkSupport.GradleFrameworkSupportProvider
import javax.swing.Icon
/*
public class GradleKotlinJavaFrameworkSupportProvider() : GradleFrameworkSupportProvider() {
override fun getFrameworkType(): FrameworkTypeEx = object : FrameworkTypeEx("KOTLIN") {
override fun getIcon(): Icon = KotlinIcons.FILE
@@ -60,3 +61,4 @@ public class GradleKotlinJavaFrameworkSupportProvider() : GradleFrameworkSupport
.addBuildscriptDependencyNotation(KotlinWithGradleConfigurator.CLASSPATH.replace("\$kotlin_version", kotlinVersion))
}
}
*/

View File

@@ -16,11 +16,14 @@
package org.jetbrains.kotlin.idea.configuration
import com.intellij.openapi.components.*
import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider
import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.components.StoragePathMacros
import com.intellij.openapi.module.Module
import org.jdom.Element
import org.jetbrains.idea.maven.importing.MavenImporter
import org.jetbrains.idea.maven.importing.MavenModifiableModelsProvider
import org.jetbrains.idea.maven.importing.MavenRootModelAdapter
import org.jetbrains.idea.maven.model.MavenPlugin
import org.jetbrains.idea.maven.project.MavenProject
@@ -37,10 +40,10 @@ private val KotlinPluginArtifactId = "kotlin-maven-plugin"
private val KotlinPluginSourceDirsConfig = "sourceDirs"
class KotlinMavenImporter : MavenImporter(KotlinPluginGroupId, KotlinPluginArtifactId) {
override fun preProcess(module: Module, mavenProject: MavenProject, changes: MavenProjectChanges, modifiableModelsProvider: IdeModifiableModelsProvider) {
override fun preProcess(module: Module, mavenProject: MavenProject, changes: MavenProjectChanges, modifiableModelsProvider: MavenModifiableModelsProvider) {
}
override fun process(modifiableModelsProvider: IdeModifiableModelsProvider,
override fun process(modifiableModelsProvider: MavenModifiableModelsProvider,
module: Module,
rootModel: MavenRootModelAdapter,
mavenModel: MavenProjectsTree,

View File

@@ -22,6 +22,7 @@ import com.intellij.openapi.application.Result;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.DependencyScope;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -33,6 +34,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.idea.KotlinPluginUtil;
import org.jetbrains.kotlin.idea.framework.ui.ConfigureDialogWithModulesAndVersion;
import org.jetbrains.kotlin.idea.project.ProjectStructureUtil;
import org.jetbrains.plugins.gradle.util.GradleConstants;
@@ -104,6 +106,83 @@ public abstract class KotlinWithGradleConfigurator implements KotlinProjectConfi
}
}
public static void addKotlinLibraryToModule(final Module module, final DependencyScope scope, final String groupId, final String artifactId, final String version) {
String gradleFilePath = getDefaultPathToBuildGradleFile(module);
final GroovyFile gradleFile = getBuildGradleFile(module.getProject(), gradleFilePath);
if (gradleFile != null && canConfigureFile(gradleFile)) {
new WriteCommandAction(gradleFile.getProject()) {
@Override
protected void run(@NotNull Result result) {
String groovyScope;
switch (scope) {
case COMPILE:
groovyScope = "compile";
break;
case TEST:
if (KotlinPluginUtil.isAndroidGradleModule(module)) {
// TODO we should add testCompile or androidTestCompile
groovyScope = "compile";
}
else {
groovyScope = "testCompile";
}
break;
case RUNTIME:
groovyScope = "runtime";
break;
case PROVIDED:
groovyScope = "compile";
break;
default:
groovyScope = "compile";
}
String dependencyString = String.format(
"%s \"%s:%s:%s\"",
groovyScope, groupId, artifactId, version);
GrClosableBlock dependenciesBlock = getDependenciesBlock(gradleFile);
addLastExpressionInBlockIfNeeded(dependencyString, dependenciesBlock);
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(gradleFile);
}
}.execute();
VirtualFile virtualFile = gradleFile.getVirtualFile();
if (virtualFile != null) {
showInfoNotification(gradleFile.getProject(), virtualFile.getPath() + " was modified");
}
}
}
@Nullable
public static String getKotlinStdlibVersion(@NotNull Module module) {
String gradleFilePath = getDefaultPathToBuildGradleFile(module);
GroovyFile gradleFile = getBuildGradleFile(module.getProject(), gradleFilePath);
if (gradleFile == null) return null;
String versionProperty = "$kotlin_version";
GrClosableBlock block = getBuildScriptBlock(gradleFile);
if (block.getText().contains("ext.kotlin_version = ")) {
return versionProperty;
}
GrStatement[] dependencies = getDependenciesBlock(gradleFile).getStatements();
String stdlibArtifactPrefix = "org.jetbrains.kotlin:kotlin-stdlib:";
for (GrStatement dependency : dependencies) {
String dependencyText = dependency.getText();
int startIndex = dependencyText.indexOf(stdlibArtifactPrefix) + stdlibArtifactPrefix.length();
int endIndex = dependencyText.length() - 1;
if (startIndex != -1 && endIndex != -1) {
return dependencyText.substring(startIndex, endIndex);
}
}
return null;
}
private void addElements(@NotNull GroovyFile file, @NotNull String version) {
GrClosableBlock buildScriptBlock = getBuildScriptBlock(file);
addFirstExpressionInBlockIfNeeded(VERSION.replace(VERSION_TEMPLATE, version), buildScriptBlock);
@@ -180,7 +259,7 @@ public abstract class KotlinWithGradleConfigurator implements KotlinProjectConfi
protected void changeGradleFile(@NotNull final GroovyFile groovyFile, @NotNull final String version) {
new WriteCommandAction(groovyFile.getProject()) {
@Override
protected void run(Result result) {
protected void run(@NotNull Result result) {
addElements(groovyFile, version);
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(groovyFile);
@@ -258,7 +337,6 @@ public abstract class KotlinWithGradleConfigurator implements KotlinProjectConfi
if (allExpressions != null) {
for (GrMethodCallExpression expression : allExpressions) {
GrExpression invokedExpression = expression.getInvokedExpression();
if (invokedExpression == null) continue;
if (expression.getClosureArguments().length == 0) continue;
String expressionText = invokedExpression.getText();
@@ -293,7 +371,7 @@ public abstract class KotlinWithGradleConfigurator implements KotlinProjectConfi
if (applyStatement == null) return null;
for (GrApplicationStatement callExpression : applyStatement) {
GrExpression invokedExpression = callExpression.getInvokedExpression();
if (invokedExpression != null && invokedExpression.getText().equals("apply")) {
if (invokedExpression.getText().equals("apply")) {
return callExpression;
}
}

Some files were not shown because too many files have changed in this diff Show More