Compare commits

...

176 Commits

Author SHA1 Message Date
Mikhail Glukhikh
b41c0190fb Fix ConfigureProjectTestGenerated / GradleConfigureProject ... for branch 163 (jre7->jre8) 2017-10-25 22:45:50 +03:00
Alexey Sedunov
d69a835892 Revert: Kotlin Ultimate: Support Protractor run configurations for module directory
This reverts commit e68f8d6d45
2017-10-25 22:39:30 +03:00
Nikolay Krasko
c2f8c51649 Revert "Kotlin Ultimate: Support Mocha run configurations for Kotlin sources"
This reverts commit dcd966f7c2.

(cherry picked from commit 07083b3)
2017-10-25 22:39:29 +03:00
Nikolay Krasko
61e049cb4e Revert "Kotlin Ultimate: Support Mocha run configurations for module directory"
This reverts commit 8ebc766b5b.

(cherry picked from commit 4b64ddd)
2017-10-25 22:39:28 +03:00
Nikolay Krasko
f9a0c15469 Revert "Kotlin Ultimate: Add JS debugger plugin dependency"
This reverts commit f2b6644db5.

(cherry picked from commit 99d9108)
2017-10-25 22:39:27 +03:00
Simon Ogorodnik
211cdc1a8e Fix KotlinMoveDirectoryWithClassesHelper after rebase 2017-10-25 22:39:26 +03:00
Simon Ogorodnik
980e6da438 Fix Nullable imported from jsr305 2017-10-25 22:39:25 +03:00
Vyacheslav Gerasimov
8b6f3c6aee Fix compilation GradleModuleBuilder GradleModuleWizardStep
(cherry picked from commit 9118b44)
2017-10-25 22:39:24 +03:00
Simon Ogorodnik
0701269622 Minor: Fix wrong conflict resolution result 2017-10-25 22:39:23 +03:00
Simon Ogorodnik
6b8461cc8f Minor: Comment missing jars 2017-10-25 22:39:22 +03:00
Alexey Sedunov
7b82798b3a Minor: Fix compilation of KotlinTestRunLineMarkerContributor 2017-10-25 22:39:21 +03:00
Alexey Sedunov
bc1bbaed11 Minor: Add isQualifiedModuleNamesEnabled() which is missing in IDEA 163 2017-10-25 22:39:20 +03:00
Vyacheslav Gerasimov
e18e5d2e12 Fix compilation 2017-10-25 22:39:19 +03:00
Alexey Sedunov
c730cd2c21 Minor: Fix compilation in 163 branch 2017-10-25 22:39:18 +03:00
Dmitry Jemerov
a107c2a386 Fix compilation for 163 2017-10-25 22:39:17 +03:00
Vyacheslav Gerasimov
cc8f18976c Fix compilation ResourceReferenceAnnotatorUtil 2017-10-25 22:39:16 +03:00
Vyacheslav Gerasimov
1bd827bf57 Revert "Move: Add conflict checking for "Move packages" case"
This reverts commit cd6177534a.
2017-10-25 22:39:15 +03:00
Vyacheslav Gerasimov
8dd86b52b0 Fix tests compilation 2017-10-25 22:39:14 +03:00
Vyacheslav Gerasimov
4b79232099 Fix compilation KotlinInlineFunctionDialog 2017-10-25 22:39:13 +03:00
Mikhail Glukhikh
32ace4b9f6 Fix imports vs 2016.3 (ResourceFoldingBuilder) 2017-10-25 22:39:12 +03:00
Dmitry Jemerov
4f4b4ac7ce Workaround for hanging test 2017-10-25 22:38:10 +03:00
Dmitry Jemerov
a1a2182170 Fix compilation
(cherry picked from commit 46b9041)
2017-10-25 22:38:09 +03:00
Yan Zhulanow
9fb85fd597 CreateFileResourceQuickFix now accepts ResourceFolderType instead of ResourceType
(cherry picked from commit 55f350f)
2017-10-25 22:38:08 +03:00
Ilya Chernikov
579671abc0 Fix test code after UsefulTestCase api changes 2017-10-25 22:38:07 +03:00
Vyacheslav Gerasimov
9f1f4e06aa Fixed KotlinAndroidResourceQuickFixProvider for AS 2.2 2017-10-25 22:38:06 +03:00
Dmitry Jemerov
d2f7ced7ec fix compilation 2017-10-25 22:38:05 +03:00
Dmitry Jemerov
e90ff5ade6 remove write action around closeAndDeleteProject() 2017-10-25 22:38:04 +03:00
Dmitry Jemerov
d38bf30954 restore mistakenly deleted IntelliJViewTypeDetector 2017-10-25 22:38:03 +03:00
Dmitry Jemerov
ccf1b38f2d fix compilation of new lint checks against IDEA 163 2017-10-25 22:38:02 +03:00
Alexey Tsvetkov
da9721f37e JPS: implement tracking of null annotations
#KT-12933 fixed
    #KT-14266 fixed
2017-10-25 22:38:01 +03:00
Dmitry Jemerov
379f01e8d0 register PsiElementFinder extensions before JavaPsiFacade is registered 2017-10-25 22:38:00 +03:00
Dmitry Jemerov
e2de107b66 add resources_en.jar to classpath of properties plugin in ultimate project 2017-10-25 22:37:59 +03:00
Konstantin Bulenkov
3d186f96d6 update Kotlin icons according to new IntelliJ style 2017-10-25 22:37:58 +03:00
Dmitry Jemerov
9953b769db fix compilation against branch 163 2017-10-25 22:37:57 +03:00
Yan Zhulanow
6c10936d63 Migrate IDEA plugin code to Android Studio 2.2 (br 145)
(cherry picked from commit 162357e)

(cherry picked from commit ab2696d)
2017-10-25 22:37:56 +03:00
Dmitry Jemerov
bb19b5a2d5 Set idea.plugins.compatible.build for 163 branch 2017-10-25 22:37:55 +03:00
Dmitry Jemerov
4ddf6b3449 Branch 163: update compatible build number range
no more applicable for IDEA 2017.* and later
2017-10-25 22:37:54 +03:00
Dmitry Jemerov
b048efced3 download IDEA 2016.3.5; update dependencies accordingly 2017-10-25 22:37:53 +03:00
Nikolay Krasko
2f4a83fe7f Move android modules to Java 8 SDK 2017-10-25 22:37:52 +03:00
Ilya Gorbunov
922e1d7a0a Compilation fixes related to "Support compilation against modular JDK (9+)"
These fixes makes it unsupported again
2017-10-25 22:37:51 +03:00
Mikhail Zarechenskiy
fc2280ef65 Revert "JPS: implement tracking of null annotations"
This reverts commit 05f278ce20.
2017-10-25 22:37:50 +03:00
Mikhail Zarechenskiy
b1fe077d9e Revert "! (TODO) Update build test data in 171"
This reverts commit 1d29c81346.
2017-10-25 22:37:49 +03:00
Nikolay Krasko
799836e244 == base_16x -> 163 ^^^ == 2017-10-25 22:37:48 +03:00
Nikolay Krasko
aceaf4c1f1 Comment "Java 9" functionality for 16x branches 2017-10-25 22:19:47 +03:00
Nikolay Krasko
a8ca73c4b3 Comment changes for "Reenable workaround for JVMTI_ERROR_WRONG_PHASE in debugger tests" 2017-10-25 22:19:46 +03:00
Mikhael Bogdanov
a59d91b282 Copy readSeq/writeSeq from IDEA 171 2017-10-25 22:19:45 +03:00
Mikhael Bogdanov
570b3474b7 Use ConfigLibraryUtil.INSTANCE after convertion to Kotlin 2017-10-25 22:19:44 +03:00
Mikhael Bogdanov
1cf902c387 Revert "Use ASM 6 API to read class files in IDE" 2017-10-25 22:19:43 +03:00
Mikhael Bogdanov
32db8497f5 Revert "Fix codegen tests on JDK 9 with jdkKind = FULL_JDK" 2017-10-25 22:19:42 +03:00
Ilya Gorbunov
df3f7632e9 Comment out some new code in ClasspathRootsResolver
Relates to disabled modular JDK9 support.
2017-10-25 22:19:41 +03:00
Mikhael Bogdanov
794d860b28 Continue. Disable modular JDK9 support 2017-10-25 22:19:40 +03:00
Nikolay Krasko
abcb36288d Revert Re-enable optimize on the fly activation when unused imports found
This reverts commit 9122f58d5d
2017-10-25 22:19:39 +03:00
Alexey Sedunov
1cb64b5530 Revert New File Action: Do not start under write action
This reverts commit 58addf72ff
2017-10-25 22:19:38 +03:00
Nikolay Krasko
791b7ea87b Comment step over for suspended calls in 162
Need to copy private API for creating step over command in
DebugProcessImplHelper.java

Support "Force Step Over" action over suspended calls (KT-18453)
850568b8e9

Step over for suspended calls (KT-18453)
0e8e8ef546
2017-10-25 22:19:37 +03:00
Vyacheslav Gerasimov
b43471eb03 Revert "Update to ASM 6-alpha from intellij 171"
This reverts commit 15502b4153.

# Conflicts:
#	.idea/libraries/idea_full.xml
#	.idea/libraries/intellij_core.xml
#	ultimate/.idea/libraries/idea_full.xml
#	ultimate/.idea/libraries/intellij_core.xml
2017-10-25 22:19:36 +03:00
Ilya Gorbunov
aea6135f50 Disable modular JDK9 support
PsiJavaModule is not supported in 162
2017-10-25 22:19:35 +03:00
Ilya Gorbunov
9ce025a6cc Compilation fixes related to "Support compilation against modular JDK (9+)"
These fixes makes it unsupported again
2017-10-25 22:19:34 +03:00
Alexey Andreev
fb89ffb240 Fix for "Copy: Support class copying" 2017-10-25 22:19:33 +03:00
Alexey Andreev
832a50cfd6 Fix for "Introduce isFromSourceCodeInScope function" 2017-10-25 22:19:32 +03:00
Vyacheslav Gerasimov
6d7be4415c Revert "Inlay param/type support for kotlin" 2017-10-25 22:19:31 +03:00
Vyacheslav Gerasimov
3b25bb75b1 Fix compilation KotlinInlineValDialog 2017-10-25 22:19:30 +03:00
Vyacheslav Gerasimov
91a524b46d Revert "fix compilation against branch 163"
This reverts commit a2b0b3d6eb.
2017-10-25 22:19:29 +03:00
Vyacheslav Gerasimov
d2c093a2e7 Revert "LightQuickFixTestCase.parseActionHint() method was removed"
This reverts commit 4f079d2768.
2017-10-25 22:19:28 +03:00
Vyacheslav Gerasimov
3e4de2220c Revert "AbstractQuickFixTest: rename to .kt"
This reverts commit ad59a122ac.
2017-10-25 22:19:27 +03:00
Vyacheslav Gerasimov
bb99dcb8ac Revert "AbstractQuickFixTest: J2K"
This reverts commit 34ad19a912.
2017-10-25 22:19:26 +03:00
Vyacheslav Gerasimov
d013f54a8a Revert "Rewrite AbstractQuickFixTest based on light fixture test case"
This reverts commit e2f75463d7.
2017-10-25 22:19:25 +03:00
Vyacheslav Gerasimov
69e64a9a23 Revert "AbstractQuickFixMultiFileTest: rename to .kt"
This reverts commit d11ea64f00.
2017-10-25 22:19:24 +03:00
Vyacheslav Gerasimov
9b604c01bf Revert "AbstractQuickFixMultiFileTest: J2K"
This reverts commit 387dbdf3bb.
2017-10-25 22:19:22 +03:00
Vyacheslav Gerasimov
a65668b7f5 Revert "Convert AbstractQuickFixMultiFileTest to light fixture test case"
This reverts commit 4f229c3fdc.
2017-10-25 22:19:21 +03:00
Vyacheslav Gerasimov
a155804b94 Revert "Convert AddOpenToClassDeclarationTest to regular multifile quickfix test"
This reverts commit 79c814636e.
2017-10-25 22:19:20 +03:00
Mikhail Zarechenskiy
d31ca07cdf Revert "Update IDEA to 171.2613.7"
This reverts commit 99af2a809b.
2017-10-25 22:19:19 +03:00
Mikhail Zarechenskiy
cf38b1a9db Revert "Migrate IDEA plugin code to Android Studio 2.2 (br 145)"
This reverts commit 24c9b6e171.
2017-10-25 22:19:18 +03:00
Mikhail Zarechenskiy
ad6efba8f1 Revert "fix compilation against branch 163"
This reverts commit a2b0b3d6eb.
2017-10-25 22:19:17 +03:00
Mikhail Zarechenskiy
b074e09267 Revert "Update compatible build number range"
This reverts commit aced2e7eb4.
2017-10-25 22:19:16 +03:00
Mikhail Zarechenskiy
400b13bd95 Revert "update Kotlin icons according to new IntelliJ style"
This reverts commit fcdd5e0a19.
2017-10-25 22:19:15 +03:00
Mikhail Zarechenskiy
a63c0409d5 Revert "Add resources_en.jar to properties plugin classpath"
This reverts commit 036bfed984.
2017-10-25 22:19:14 +03:00
Mikhail Zarechenskiy
4414534969 Revert "register PsiElementFinder extensions before JavaPsiFacade is registered"
This reverts commit e51018406f.
2017-10-25 22:19:13 +03:00
Mikhail Zarechenskiy
f8d7770829 Revert "JPS: implement tracking of null annotations"
This reverts commit 05f278ce20.
2017-10-25 22:19:12 +03:00
Mikhail Zarechenskiy
6f351e2a18 Revert "fix compilation of new lint checks against IDEA 163"
This reverts commit b10073465c.
2017-10-25 22:19:11 +03:00
Mikhail Zarechenskiy
d2e5e72e37 Revert "remove write action around closeAndDeleteProject()"
This reverts commit ab5067a0d3.
2017-10-25 22:19:10 +03:00
Mikhail Zarechenskiy
05d51fa508 Revert "fix compilation"
This reverts commit 594e2b6a77.
2017-10-25 22:19:09 +03:00
Mikhail Zarechenskiy
d8942c7c7e Revert "Fixed KotlinAndroidResourceQuickFixProvider for AS 2.2"
This reverts commit 180ae070ee.
2017-10-25 22:19:08 +03:00
Mikhail Zarechenskiy
9e499a4a53 Revert "Fix test code after UsefulTestCase api changes"
This reverts commit 4be5fcc14a.
2017-10-25 22:19:07 +03:00
Mikhail Zarechenskiy
75268694ac Revert "CreateFileResourceQuickFix now accepts ResourceFolderType instead of ResourceType"
This reverts commit 59055e28ee.
2017-10-25 22:19:06 +03:00
Mikhail Zarechenskiy
3a3f53769c Revert "Fix compilation"
This reverts commit 60a2151a33.
2017-10-25 22:19:05 +03:00
Mikhail Zarechenskiy
0aae060109 Revert "Workaround for hanging test"
This reverts commit 715410a9bc.
2017-10-25 22:19:04 +03:00
Mikhail Zarechenskiy
813bbd4d24 Revert "Fix imports vs 2016.3 (ResourceFoldingBuilder)"
This reverts commit e6cefba98b.
2017-10-25 22:18:12 +03:00
Mikhail Zarechenskiy
079ff12076 Revert "Remove unused import"
This reverts commit ed9e083008.
2017-10-25 22:18:11 +03:00
Mikhail Zarechenskiy
4134cf80b5 Revert "Update guava 19.0 sources jar"
This reverts commit 9f51b12193.
2017-10-25 22:18:10 +03:00
Mikhail Zarechenskiy
efbead2a7c Revert "LightQuickFixTestCase.parseActionHint() method was removed"
This reverts commit 4f079d2768.
2017-10-25 22:18:09 +03:00
Mikhail Zarechenskiy
566c50fb15 Revert "Updated nullability in RunLineMarkerContributor"
This reverts commit 3e6f57b684.
2017-10-25 22:18:08 +03:00
Mikhail Zarechenskiy
fd348fa639 Revert "Update after separating JPS builders into two modules"
This reverts commit 95061885b0.
2017-10-25 22:18:07 +03:00
Mikhail Zarechenskiy
4fe5f031e8 Revert "Do not wrap analyze into write action priority in tests"
This reverts commit 82a2a705fb.
2017-10-25 22:18:06 +03:00
Mikhail Zarechenskiy
6d0438ec08 Revert "Run tests in read action and not in EDT thread"
This reverts commit bcf29e6fbf.
2017-10-25 22:18:05 +03:00
Mikhail Zarechenskiy
290cb5358e Revert "Use new api from idea 171 in KotlinStepOverInlinedLinesHint"
This reverts commit eb8415a1f3.
2017-10-25 22:18:04 +03:00
Mikhail Zarechenskiy
72edc7574c Revert "Try to avoid exception in getOffset() call"
This reverts commit 615f9d3a1f.
2017-10-25 22:18:03 +03:00
Mikhail Zarechenskiy
a589499b31 Revert "Replace removed method in LibraryPresentationProviders"
This reverts commit e57b3651c2.
2017-10-25 22:18:01 +03:00
Mikhail Zarechenskiy
921a911a52 Revert "Port setInPerformanceTest -> setInStressTest"
This reverts commit 7da424d53f.
2017-10-25 22:18:00 +03:00
Mikhail Zarechenskiy
b09e5af570 Revert "! (TODO) Update build test data in 171"
This reverts commit 1d29c81346.
2017-10-25 22:17:59 +03:00
Mikhail Zarechenskiy
2191c3c10e Revert "Update to 171.SNAPSHOT to pick up fix for IDEA-169570; fix compilation"
This reverts commit 12fc89f35d.
2017-10-25 22:17:58 +03:00
Mikhail Zarechenskiy
99bb693708 Revert "Fix GradleFacetImportTest: run write action only in EDT"
This reverts commit 3d98237304.
2017-10-25 21:35:47 +03:00
Mikhail Zarechenskiy
8d9e08857c Revert "Don't try to create "add modifier" fix for read-only elements"
This reverts commit 374cf517e1.
2017-10-25 21:35:45 +03:00
Mikhail Zarechenskiy
4882e36c9e Revert "Fix testdata according to changes in automatic renaming rules in 17.1"
This reverts commit d6709b726e.
2017-10-25 21:35:44 +03:00
Mikhail Zarechenskiy
51a503fbb3 Revert "Fix testdata according to comment selection changes in 2017.1"
This reverts commit ad821e83bd.
2017-10-25 21:35:43 +03:00
Mikhail Zarechenskiy
05ff2f7ba6 Revert "Fix testdata according to contract inference changes in 2017.1"
This reverts commit a539939388.
2017-10-25 21:35:42 +03:00
Mikhail Zarechenskiy
2deb8cfd0b Revert "Fix service and EP registration according to changes in 2017.1"
This reverts commit 097ba45783.
2017-10-25 21:35:41 +03:00
Mikhail Zarechenskiy
cbcfabe473 Revert "Register MetaLanguage extension point in ParsingTestCase"
This reverts commit b9f326bfa1.
2017-10-25 21:35:40 +03:00
Mikhail Zarechenskiy
f58c2b9100 Revert "Remove write action around finishLookup(), according to IJ 2017.1 req"
This reverts commit 61f157e89d.
2017-10-25 21:35:39 +03:00
Mikhail Zarechenskiy
ee8f823bc1 Revert "Register MetaLanguage.EP_NAME in J2K test"
This reverts commit a8bd529871.
2017-10-25 21:35:38 +03:00
Mikhail Zarechenskiy
939467688e Revert "Remove Java 6/7 warning from expected output of the compiler"
This reverts commit 0d86bdd216.
2017-10-25 21:35:36 +03:00
Mikhail Zarechenskiy
7942a57c4e Revert "Fix NPE in tests when ProjectFileIndex is not available"
This reverts commit 0638106bf3.
2017-10-25 21:35:35 +03:00
Mikhail Zarechenskiy
545ece1076 Revert "Keep class file version during shrinking; generate Java 8 bytecode"
This reverts commit 3a8cf68541.
2017-10-25 21:35:34 +03:00
Mikhail Zarechenskiy
56173ed4c9 Revert "JPS tests: avoid using deprecated API"
This reverts commit 40574d31ac.
2017-10-25 21:35:33 +03:00
Mikhail Zarechenskiy
3e0b16b4d3 Revert "Black box update"
This reverts commit 496a21254b.
2017-10-25 21:35:32 +03:00
Mikhail Zarechenskiy
32e99dab3c Revert "Move: Fix tests in IDEA 2017.1"
This reverts commit b65460c12f.
2017-10-25 21:35:31 +03:00
Mikhail Zarechenskiy
4080d33685 Revert "Safe Delete: Fix tests in IDEA 2017.1"
This reverts commit ecd56c6a40.
2017-10-25 21:35:29 +03:00
Mikhail Zarechenskiy
945e819e94 Revert "Move getting source position to manager thread in tests"
This reverts commit 4edfd0d960.
2017-10-25 21:35:28 +03:00
Mikhail Zarechenskiy
342092df65 Revert "Fix compileJavaAgainstKotlin tests"
This reverts commit 3c96099f7c.
2017-10-25 21:35:26 +03:00
Mikhail Zarechenskiy
f7eb0c7101 Revert "Fix JvmRuntimeDescriptorLoaderTestGenerated"
This reverts commit 33e9e660c4.
2017-10-25 21:35:25 +03:00
Mikhail Zarechenskiy
cd274e9324 Revert "Fix KotlinVersionsTest, use SAX parser instead of DOM"
This reverts commit 449d1f6ad2.
2017-10-25 21:35:23 +03:00
Mikhail Zarechenskiy
86a06d41db Revert "Update test data for ant task tests"
This reverts commit 999e1061b8.
2017-10-25 21:35:22 +03:00
Mikhail Zarechenskiy
72376412df Revert "Adjust test data for IDEA 2017.1"
This reverts commit 10aedaf0f4.
2017-10-25 21:35:20 +03:00
Mikhail Zarechenskiy
f86e5f51e1 Revert "kt1770.kt test rewrote during migration to 171 platform"
This reverts commit 211b58ac6e.
2017-10-25 21:35:19 +03:00
Mikhail Zarechenskiy
fb7246473a Revert "Fix regression of completion inside string templates"
This reverts commit 2804264289.
2017-10-25 21:35:18 +03:00
Mikhail Zarechenskiy
c65062673f Revert "Spring Support: Fix tests in IDEA 2017.1"
This reverts commit 2e3617adbb.
2017-10-25 21:35:17 +03:00
Dmitry Jemerov
953b6ed26f Revert Show more correct type hints
This reverts commit 8077a71aec
2017-10-25 21:35:16 +03:00
Nikolay Krasko
78bf08bbe3 == 171 -> base_16x ^^^ == 2017-10-25 21:35:15 +03:00
Dmitry Jemerov
242a8716eb Fix merge of AndroidGradleModelFacade 2017-10-25 21:28:47 +03:00
Yan Zhulanow
b867ee1656 Android Extensions: Update model class name 2017-10-25 21:28:47 +03:00
Vyacheslav Gerasimov
f395ca0bd6 Add uast-common and uast-java jars to plugin dependencies 2017-10-25 21:28:47 +03:00
Simon Ogorodnik
2a320b4ff0 Fix dependency of android-extensions-ide
Add dependency on common.jar from android plugin to bring
SdkConstants
2017-10-25 21:28:47 +03:00
Vyacheslav Gerasimov
705927b91e Fix compilation GradleModuleBuilder
(cherry picked from commit 2c2f9eb)
2017-10-25 21:28:46 +03:00
Simon Ogorodnik
07ed592973 Fix dependencies of idea-android 2017-10-25 21:28:46 +03:00
Simon Ogorodnik
ee482995be Fix compilation with gradle 2017-10-25 21:28:46 +03:00
Vyacheslav Gerasimov
b6787a58f2 Fix compilation KaptProjectResolverExtension 2017-10-25 21:28:46 +03:00
Dmitry Jemerov
2a43cf385d Fix compilation of MultiplatformGradleProjectTaskRunner in 171
(cherry picked from commit f8c72a8)
2017-10-25 21:28:45 +03:00
Nikolay Krasko
74913fcc31 Revert "Remove UAST services registration from Kotlin plugin"
This reverts commit 7fffb7b553.
2017-10-25 21:28:45 +03:00
Nikolay Krasko
b1320777f0 Revert "Fix compilation KotlinModuleBuilder"
This reverts commit 768305adc8.
2017-10-25 21:28:45 +03:00
Nikolay Krasko
d79cf7e2ef Revert "Fix compilation AbstractParameterInfoTest"
This reverts commit c07096c9d7.
2017-10-25 21:28:45 +03:00
Nikolay Krasko
9403f0d5ef Revert "Fix compilation IntelliJLintClient, IntelliJLintProject, IDEAndroidLayoutXmlFileManager"
This reverts commit a142c2f8fa.
2017-10-25 21:28:44 +03:00
Nikolay Krasko
394f6306d2 Revert "Fix compilation NewKotlinActivityAction, gradle sync classes moved"
This reverts commit be1022db2b.
2017-10-25 21:28:44 +03:00
Nikolay Krasko
eabb20382f Revert "Fix compilation androidUtil, MyReferredResourceFieldInfo requires module"
This reverts commit 6336c4ee98.
2017-10-25 21:28:44 +03:00
Nikolay Krasko
1b478516e2 Revert "Fix compilation PlatformAndroidGradleDetector"
This reverts commit c675824c0a.
2017-10-25 21:28:44 +03:00
Nikolay Krasko
726c7b6dcd Revert "Fix compilation gotoResourceHelper, KotlinAndroidTestCase"
This reverts commit 62e583903e.
2017-10-25 21:28:43 +03:00
Nikolay Krasko
8b2d2ac91e Revert "Android Extensions: Allow to disable IDE support (KT-12741)"
This reverts commit 298d29a962.
2017-10-25 21:28:43 +03:00
Nikolay Krasko
cf1815a7f7 Revert "Move Kotlin UAST registration to main plugin.xml"
This reverts commit 282da4cab5.
2017-10-25 21:28:43 +03:00
Nikolay Krasko
1e54339d04 Revert "Fix compilation AbstractKotlinEvaluateExpressionTest"
This reverts commit 83a8395287.
2017-10-25 21:28:43 +03:00
Nikolay Krasko
bae29b395c Revert "Fix compilation MockUpdateParameterInfoContext"
This reverts commit 23e606d179.
2017-10-25 21:28:42 +03:00
Nikolay Krasko
f453a7ee0a Revert "Fix compilation AndroidResourceReferenceAnnotator"
This reverts commit b825a8db43.
2017-10-25 21:28:42 +03:00
Nikolay Krasko
04dcb193c8 Revert "Fix tests compilation"
This reverts commit c1cfd70ae7.
2017-10-25 21:28:42 +03:00
Nikolay Krasko
6388f8af67 Revert "Compilation fixes for 172 branch"
This reverts commit 48d4f5f5c2.
2017-10-25 21:28:42 +03:00
Nikolay Krasko
fa4c0a5a81 Revert "JvmCommonIntentionActionsFactory in Kotlin"
This reverts commit 0694f2d0c5.
2017-10-25 21:28:41 +03:00
Nikolay Krasko
079301bd57 Revert "Fixup for "JvmCommonIntentionActionsFactory in Kotlin""
This reverts commit 08673bfb0c.
2017-10-25 21:28:40 +03:00
Nikolay Krasko
d559d69cca Revert "Fix test compilation errors"
This reverts commit 11086192bc.
2017-10-25 21:28:40 +03:00
Nikolay Krasko
4a840747ce Revert "Add missing implementation of abstract method to MockPsiManager"
This reverts commit 4d72f0ef66.
2017-10-25 21:28:40 +03:00
Nikolay Krasko
c34afd3053 Revert "Fix compilation for IDEA 172"
This reverts commit e56f9f6040.
2017-10-25 21:28:40 +03:00
Nikolay Krasko
63bf66de4c Revert "KotlinCommonIntentionActionsFactory extensions for IDEA-85507 and KT-11906 (#1093)"
This reverts commit a36cbad7cd.
2017-10-25 21:28:39 +03:00
Nikolay Krasko
93a711f3fd Revert "Pass required Project parameter to constructor of NullableNotNullManager"
This reverts commit 13349086ac.
2017-10-25 21:28:38 +03:00
Nikolay Krasko
612215166e Revert ""Final Kotlin class or function with Spring annotation" inspection deprecation and disabling by default (KT-18506)"
This reverts commit 6ae247ba61.
2017-10-25 21:28:38 +03:00
Nikolay Krasko
f1418579e8 Revert "Spring Constructor Injection falling test"
This reverts commit ce77751349.
2017-10-25 21:28:38 +03:00
Nikolay Krasko
4e6f1225ed Revert "KotlinSpringClassAnnotator ignores duplicate gutter handlers (IDEA-173995, KT-18298)"
This reverts commit ca19ea8205.
2017-10-25 21:28:37 +03:00
Nikolay Krasko
8056ffc810 Revert "Spring dependency-generations actions: runWriteAction moved to the proper place (KT-18385)"
This reverts commit 532560ef43.
2017-10-25 21:28:37 +03:00
Nikolay Krasko
3462ec533e Revert "Ultimate tests repair (KT-18847)"
This reverts commit 384ae8d8b5.
2017-10-25 21:28:37 +03:00
Nikolay Krasko
629a3355af Revert "A check for AbstractSpringClassAnnotatorTest that ultimate plugin is properly set up"
This reverts commit 62dc3c8da4.
2017-10-25 21:28:37 +03:00
Nikolay Krasko
4bdde71896 Revert "Update AndroidProjectKey package"
This reverts commit 4e868c5232.
2017-10-25 21:28:36 +03:00
Nikolay Krasko
e47fac158b Revert "KotlinCommonIntentionActionsFactory is able to remove constructors parameters (EA-104621) (#1187)"
This reverts commit f94569c995.
2017-10-25 21:28:36 +03:00
Nikolay Krasko
abcfb897f1 Revert "Fix 'isProjectOrWorkspaceFile' import"
This reverts commit 2954c41848.
2017-10-25 21:28:36 +03:00
Nikolay Krasko
49550daee8 Revert "JPS: completely skip chunk containing only dummy targets"
This reverts commit 99439620d4.
2017-10-25 21:28:36 +03:00
Nikolay Krasko
46fab08a93 Revert "Don't pack jps services into compiler"
This reverts commit 0d6cf19896.
2017-10-25 21:28:35 +03:00
Nikolay Krasko
7e5cc45cd8 Revert "Fix debugger test in 172 (KT-18848)"
This reverts commit d8c20ed9c0.
2017-10-25 21:28:35 +03:00
Nikolay Krasko
73522159e4 Revert "Fix test behaviour in branch 172"
This reverts commit 2cf4da8564.
2017-10-25 21:28:35 +03:00
Nikolay Krasko
a0ae2bfd22 Revert "Drop usage of deprecated ProjectDataManager in branch 172"
This reverts commit eeede71d9d.
2017-10-25 21:28:35 +03:00
Nikolay Krasko
d0efbd0199 Revert "Update spring test data for 172 idea"
This reverts commit 10bf49118a.
2017-10-25 21:28:34 +03:00
Nikolay Krasko
44aacbc038 Revert "Fix AbstractGenerateSpringDependencyActionTest.kt in branch 172"
This reverts commit 6d66fb35d6.
2017-10-25 21:28:34 +03:00
Nikolay Krasko
83150603b4 Revert update-dependencies and proguard changes for idea 172
Revert "Build against UAST bundled in IDEA"
This reverts commit bb7521a142.

Revert "Fix 'ant dist' build against 172 branch"
This reverts commit 548e86285c.

Revert "Bump guava to 21.0 in update_dependencies.xml"
This reverts commit e8d2782089.

Revert "Download IDEA from 172 branch"
This reverts commit b50d5fb998.

Revert "Download asm-all sources for idea 172"
This reverts commit 4b2b5dec75.

Revert "Advance Guava version"
This reverts commit 20d0d49cc3.

Revert "Make 172 plugin applicable for IDEA 173"
This reverts commit 4a15870e59.

Revert "Ignore absent net.jpountz.lz4.LZ4Factory in proguard"
This reverts commit c2b54c3e8a.

Revert "Correct 172 plugin 'since' field (no more compatible with 171)"
This reverts commit 85ecde6ec9.

Revert "Fix guava version"
This reverts commit cf4d0fb977.
2017-10-25 21:28:34 +03:00
Nikolay Krasko
059c847569 == 172 -> 171 ^^^ == 2017-10-25 21:28:34 +03:00
453 changed files with 2739 additions and 3791 deletions

1
.idea/misc.xml generated
View File

@@ -6,6 +6,7 @@
</properties>
</component>
<component name="EntryPointsManager">
<entry_points version="2.0" />
<list size="1">
<item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
</list>

View File

@@ -117,7 +117,7 @@ extra["versions.ant"] = "1.8.2"
extra["versions.android"] = "2.3.1"
extra["ideaCoreSdkJars"] = arrayOf("annotations", "asm-all", "guava", "intellij-core", "jdom", "jna", "log4j", "picocontainer",
"snappy-in-java", "streamex", "trove4j", "xpp3-1.1.4-min", "xstream")
"snappy-in-java", "trove4j", "xpp3-1.1.4-min", "xstream")
extra["compilerModules"] = arrayOf(":compiler:util",
":compiler:container",

View File

@@ -25,7 +25,7 @@
<property environment="env"/>
<property name="tools.jar" value="${env.JDK_18}/lib/tools.jar"/>
<property name="java.target" value="1.8"/>
<property name="java.target" value="1.6"/>
<condition property="bootstrap.or.local.build" value="true" else="false">
<or>
@@ -387,20 +387,19 @@
<zipgroupfileset dir="${basedir}/lib" includes="*.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/annotations.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/asm-all.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/guava-21.0.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/guava-19.0.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/intellij-core.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/jdom.jar" excludes="META-INF/jb/** META-INF/LICENSE"/>
<zipfileset src="${basedir}/ideaSDK/core/jna.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/log4j.jar" excludes="META-INF/jb/** META-INF/LICENSE"/>
<zipfileset src="${basedir}/ideaSDK/core/picocontainer.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/snappy-in-java-0.5.1.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/streamex-0.6.2.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/trove4j.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/xpp3-1.1.4-min.jar"/>
<zipfileset src="${basedir}/ideaSDK/core/xstream-1.4.8.jar"/>
<zipfileset src="${idea.sdk}/lib/jna-platform.jar"/>
<zipfileset src="${idea.sdk}/lib/oromatcher.jar" excludes="META-INF/jb/** META-INF/LICENSE"/>
<zipfileset src="${idea.sdk}/jps/jps-model.jar" excludes="META-INF/services/**"/>
<zipfileset src="${idea.sdk}/jps/jps-model.jar"/>
<zipfileset src="${dependencies}/jline3.jar"/>
<zipfileset src="${dependencies}/jansi.jar"/>
<zipfileset src="${dependencies}/javaslang-2.0.6.jar"/>

View File

@@ -31,8 +31,8 @@ public class AndroidJpsBuildTestCase extends BaseKotlinJpsBuildTestCase {
public void doTest() {
initProject();
rebuildAllModules();
buildAllModules().assertSuccessful();
rebuildAll();
makeAll().assertSuccessful();
}
@Override

View File

@@ -19,9 +19,10 @@ package org.jetbrains.kotlin.cli.jvm.compiler
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.openapi.vfs.VfsUtilCore
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiJavaModule
import com.intellij.openapi.vfs.VirtualFileManager
//import com.intellij.psi.PsiJavaModule
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.light.LightJavaModule
//import com.intellij.psi.impl.light.LightJavaModule
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.*
@@ -91,22 +92,22 @@ class ClasspathRootsResolver(
for ((root, packagePrefix) in javaSourceRoots) {
val modularRoot = modularSourceRoot(root, hasOutputDirectoryInClasspath)
if (modularRoot != null) {
modules += modularRoot
}
else {
result += JavaRoot(root, JavaRoot.RootType.SOURCE, packagePrefix?.let { prefix ->
if (isValidJavaFqName(prefix)) FqName(prefix)
else null.also {
report(STRONG_WARNING, "Invalid package prefix name is ignored: $prefix")
if (modularRoot != null) {
modules += modularRoot
}
})
}
}
else {
result += JavaRoot(root, JavaRoot.RootType.SOURCE, packagePrefix?.let { prefix ->
if (isValidJavaFqName(prefix)) FqName(prefix)
else null.also {
report(STRONG_WARNING, "Invalid package prefix name is ignored: $prefix")
}
})
}
}
for (root in jvmClasspathRoots) {
result += JavaRoot(root, JavaRoot.RootType.BINARY)
}
result += JavaRoot(root, JavaRoot.RootType.BINARY)
}
val outputDirectoryAddedAsPartOfModule = modules.any { module -> module.moduleRoots.any { it.file == outputDirectory } }
@@ -116,17 +117,19 @@ class ClasspathRootsResolver(
if (outputDirectoryAddedAsPartOfModule && root == outputDirectory) continue
val module = modularBinaryRoot(root)
if (module != null) {
modules += module
}
}
if (module != null) {
modules += module
}
}
addModularRoots(modules, result)
return RootsAndModules(result, modules)
}
private fun findSourceModuleInfo(root: VirtualFile): Pair<VirtualFile, PsiJavaModule>? {
private fun findSourceModuleInfo(root: VirtualFile): Pair<VirtualFile, *>? {
return null
/*
val moduleInfoFile =
when {
root.isDirectory -> root.findChild(PsiJavaModule.MODULE_INFO_FILE)
@@ -138,9 +141,12 @@ class ClasspathRootsResolver(
val psiJavaModule = psiFile.children.singleOrNull { it is PsiJavaModule } as? PsiJavaModule ?: return null
return moduleInfoFile to psiJavaModule
*/
}
private fun modularSourceRoot(root: VirtualFile, hasOutputDirectoryInClasspath: Boolean): JavaModule.Explicit? {
return null
/*
val (moduleInfoFile, psiJavaModule) = findSourceModuleInfo(root) ?: return null
val sourceRoot = JavaModule.Root(root, isBinary = false)
val roots =
@@ -148,19 +154,14 @@ class ClasspathRootsResolver(
listOf(sourceRoot, JavaModule.Root(outputDirectory!!, isBinary = true))
else listOf(sourceRoot)
return JavaModule.Explicit(JavaModuleInfo.create(psiJavaModule), roots, moduleInfoFile)
*/
}
private fun modularBinaryRoot(root: VirtualFile): JavaModule? {
val isJar = root.fileSystem.protocol == StandardFileSystems.JAR_PROTOCOL
val manifest: Attributes? by lazy(NONE) { readManifestAttributes(root) }
val moduleInfoFile =
root.findChild(PsiJavaModule.MODULE_INFO_CLS_FILE)
?: root.takeIf { isJar }?.findFileByRelativePath(MULTI_RELEASE_MODULE_INFO_CLS_FILE)?.takeIf {
manifest?.getValue(IS_MULTI_RELEASE)?.equals("true", ignoreCase = true) == true
}
if (moduleInfoFile != null) {
return null
/*
val moduleInfoFile = root.findChild(PsiJavaModule.MODULE_INFO_CLS_FILE)
return if (moduleInfoFile != null) {
val moduleInfo = JavaModuleInfo.read(moduleInfoFile) ?: return null
return JavaModule.Explicit(moduleInfo, listOf(JavaModule.Root(root, isBinary = true)), moduleInfoFile)
}
@@ -182,8 +183,6 @@ class ClasspathRootsResolver(
}
return JavaModule.Automatic(moduleName, moduleRoot)
}
return null
}
private fun readManifestAttributes(jarRoot: VirtualFile): Attributes? {
@@ -194,6 +193,7 @@ class ClasspathRootsResolver(
catch (e: IOException) {
null
}
*/
}
private fun addModularRoots(modules: List<JavaModule>, result: MutableList<JavaRoot>) {
@@ -261,9 +261,9 @@ class ClasspathRootsResolver(
else {
for ((root, isBinary) in module.moduleRoots) {
result.add(JavaRoot(root, if (isBinary) JavaRoot.RootType.BINARY else JavaRoot.RootType.SOURCE))
}
}
}
}
if (requireStdlibModule && sourceModule != null && KOTLIN_STDLIB_MODULE_NAME !in allDependencies) {
report(
@@ -320,7 +320,6 @@ class ClasspathRootsResolver(
}
private companion object {
const val MULTI_RELEASE_MODULE_INFO_CLS_FILE = "META-INF/versions/9/${PsiJavaModule.MODULE_INFO_CLS_FILE}"
const val AUTOMATIC_MODULE_NAME = "Automatic-Module-Name"
const val IS_MULTI_RELEASE = "Multi-Release"
}

View File

@@ -26,7 +26,6 @@ import com.intellij.core.JavaCoreApplicationEnvironment
import com.intellij.core.JavaCoreProjectEnvironment
import com.intellij.ide.highlighter.JavaFileType
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.lang.MetaLanguage
import com.intellij.lang.java.JavaParserDefinition
import com.intellij.openapi.Disposable
import com.intellij.openapi.application.ApplicationManager
@@ -144,7 +143,6 @@ class KotlinCoreEnvironment private constructor(
super.registerJavaPsiFacade()
}
}
private val sourceFiles = mutableListOf<KtFile>()
private val rootsIndex: JvmDependenciesDynamicCompoundIndex
private val packagePartProviders = mutableListOf<JvmPackagePartProvider>()
@@ -224,12 +222,12 @@ class KotlinCoreEnvironment private constructor(
this.initialRoots = initialRoots
if (!configuration.getBoolean(JVMConfigurationKeys.SKIP_RUNTIME_VERSION_CHECK) && messageCollector != null) {
JvmRuntimeVersionsConsistencyChecker.checkCompilerClasspathConsistency(
messageCollector,
configuration,
initialRoots.mapNotNull { (file, type) -> if (type == JavaRoot.RootType.BINARY) file else null }
)
}
JvmRuntimeVersionsConsistencyChecker.checkCompilerClasspathConsistency(
messageCollector,
configuration,
initialRoots.mapNotNull { (file, type) -> if (type == JavaRoot.RootType.BINARY) file else null }
)
}
val (roots, singleJavaFileRoots) =
initialRoots.partition { (file) -> file.isDirectory || file.extension != JavaFileType.DEFAULT_EXTENSION }
@@ -318,7 +316,7 @@ class KotlinCoreEnvironment private constructor(
for (packagePartProvider in packagePartProviders) {
packagePartProvider.addRoots(newRoots)
}
}
return rootsIndex.addNewIndexForRoots(newRoots)?.let { newIndex ->
updateClasspathFromRootsIndex(newIndex)
@@ -344,9 +342,9 @@ class KotlinCoreEnvironment private constructor(
return findLocalFile(root.file.absolutePath).also {
if (it == null) {
report(STRONG_WARNING, "Classpath entry points to a non-existent location: ${root.file}")
}
}
}
}
private fun findJarRoot(file: File): VirtualFile? =
applicationEnvironment.jarFileSystem.findFileByPath("$file${URLUtil.JAR_SEPARATOR}")
@@ -370,7 +368,7 @@ class KotlinCoreEnvironment private constructor(
}
companion object {
private val ideaCompatibleBuildNumber = "172.9999"
private val ideaCompatibleBuildNumber = "163.9999"
init {
setCompatibleBuild()
@@ -460,6 +458,7 @@ class KotlinCoreEnvironment private constructor(
Extensions.cleanRootArea(parentDisposable)
registerAppExtensionPoints()
val applicationEnvironment = object : JavaCoreApplicationEnvironment(parentDisposable) {
@Suppress("NOTHING_TO_OVERRIDE")
override fun createJrtFileSystem(): VirtualFileSystem? = CoreJrtFileSystem()
}
@@ -486,7 +485,6 @@ class KotlinCoreEnvironment private constructor(
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler::class.java)
//
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), TypeAnnotationModifier.EP_NAME, TypeAnnotationModifier::class.java)
CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), MetaLanguage.EP_NAME, MetaLanguage::class.java)
}
private fun registerApplicationExtensionPointsAndExtensionsFrom(configuration: CompilerConfiguration, configFilePath: String) {

View File

@@ -26,5 +26,11 @@ open class KotlinCoreProjectEnvironment(
disposable: Disposable,
applicationEnvironment: JavaCoreApplicationEnvironment
) : JavaCoreProjectEnvironment(disposable, applicationEnvironment) {
init {
myProject.registerService<ControlFlowFactory>(ControlFlowFactory::class.java,
ControlFlowFactory(myPsiManager))
}
override fun createCoreFileManager() = KotlinCliJavaFileManagerImpl(PsiManager.getInstance(project))
}

View File

@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.cli.jvm.compiler
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiJavaModule
//import com.intellij.psi.PsiJavaModule
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.PsiModificationTrackerImpl
import com.intellij.psi.search.DelegatingGlobalSearchScope
@@ -191,14 +191,15 @@ object KotlinToJVMBytecodeCompiler {
}
}
val isJava9Module = chunk.any { module ->
val isJava9Module = false
/*chunk.any { module ->
module.getJavaSourceRoots().any { (path, packagePrefix) ->
val file = File(path)
packagePrefix == null &&
(file.name == PsiJavaModule.MODULE_INFO_FILE ||
(file.isDirectory && file.listFiles().any { it.name == PsiJavaModule.MODULE_INFO_FILE }))
}
}
}*/
for (module in chunk) {
for (classpathRoot in module.getClasspathRoots()) {

View File

@@ -17,7 +17,6 @@
package org.jetbrains.kotlin.cli.jvm.compiler
import com.intellij.codeInsight.ExternalAnnotationsManager
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.*
class MockExternalAnnotationsManager : ExternalAnnotationsManager() {
@@ -41,8 +40,4 @@ class MockExternalAnnotationsManager : ExternalAnnotationsManager() {
override fun editExternalAnnotation(listOwner: PsiModifierListOwner, annotationFQN: String, value: Array<out PsiNameValuePair>?): Boolean {
throw UnsupportedOperationException("not implemented")
}
override fun hasAnnotationRootsForFile(file: VirtualFile): Boolean {
throw UnsupportedOperationException("not implemented")
}
}

View File

@@ -17,7 +17,8 @@
package org.jetbrains.kotlin.cli.jvm.modules
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiJavaModule
import com.intellij.openapi.vfs.VirtualFileSystem
//import com.intellij.psi.PsiJavaModule
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModule
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleFinder
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo
@@ -40,8 +41,11 @@ class CliJavaModuleFinder(jrtFileSystemRoot: VirtualFile?) : JavaModuleFinder {
modulesRoot?.findChild(name)?.let(this::findSystemModule) ?: userModules[name]
private fun findSystemModule(moduleRoot: VirtualFile): JavaModule.Explicit? {
return null
/*
val file = moduleRoot.findChild(PsiJavaModule.MODULE_INFO_CLS_FILE) ?: return null
val moduleInfo = JavaModuleInfo.read(file) ?: return null
return JavaModule.Explicit(moduleInfo, listOf(JavaModule.Root(moduleRoot, isBinary = true)), file)
*/
}
}

View File

@@ -69,6 +69,7 @@ messages/**)
#-libraryjars '<bootstrap.script.runtime>'
#-libraryjars '<tools.jar>'
-target 1.6
-dontoptimize
-dontobfuscate

View File

@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.load.java.structure.*
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtPsiUtil
import org.jetbrains.kotlin.psi.psiUtil.contains
class JavaClassImpl(psiClass: PsiClass) : JavaClassifierImpl<PsiClass>(psiClass), VirtualFileBoundJavaClass, JavaAnnotationOwnerImpl, JavaModifierListOwnerImpl {
init {
@@ -114,7 +115,7 @@ class JavaClassImpl(psiClass: PsiClass) : JavaClassifierImpl<PsiClass>(psiClass)
override val virtualFile: VirtualFile?
get() = psi.containingFile?.virtualFile
override fun isFromSourceCodeInScope(scope: SearchScope): Boolean = psi.containingFile.virtualFile in scope
override fun isFromSourceCodeInScope(scope: SearchScope): Boolean = psi.containingFile in scope
override fun getAnnotationOwnerPsi() = psi.modifierList

View File

@@ -22,7 +22,6 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.util.Computable
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiJavaModule
class KotlinBinaryClassCache : Disposable {
private class RequestCache {
@@ -56,8 +55,6 @@ class KotlinBinaryClassCache : Disposable {
fun getKotlinBinaryClass(file: VirtualFile, fileContent: ByteArray? = null): KotlinJvmBinaryClass? {
if (file.fileType !== JavaClassFileType.INSTANCE) return null
if (file.name == PsiJavaModule.MODULE_INFO_CLS_FILE) return null
val service = ServiceManager.getService(KotlinBinaryClassCache::class.java)
val requestCache = service.cache.get()

View File

@@ -17,15 +17,17 @@
package org.jetbrains.kotlin.resolve.jvm.modules
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiJavaModule
//import com.intellij.psi.PsiJavaModule
import com.intellij.psi.PsiModifier
import org.jetbrains.kotlin.name.FqName
/*
import org.jetbrains.kotlin.utils.compact
import org.jetbrains.org.objectweb.asm.ClassReader
import org.jetbrains.org.objectweb.asm.ClassVisitor
import org.jetbrains.org.objectweb.asm.ModuleVisitor
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Opcodes.ACC_TRANSITIVE
import org.jetbrains.org.objectweb.asm.Opcodes.*
*/
import java.io.IOException
class JavaModuleInfo(
@@ -41,6 +43,7 @@ class JavaModuleInfo(
"Module $moduleName (${requires.size} requires, ${exports.size} exports)"
companion object {
/*
fun create(psiJavaModule: PsiJavaModule): JavaModuleInfo {
return JavaModuleInfo(
psiJavaModule.name,
@@ -56,7 +59,10 @@ class JavaModuleInfo(
}
)
}
*/
fun read(file: VirtualFile): JavaModuleInfo? = null // unsupported with this version of ASM
/*
fun read(file: VirtualFile): JavaModuleInfo? {
val contents = try { file.contentsToByteArray() } catch (e: IOException) { return null }
@@ -85,5 +91,6 @@ class JavaModuleInfo(
JavaModuleInfo(moduleName!!, requires.compact(), exports.compact())
else null
}
*/
}
}

View File

@@ -1,4 +1,5 @@
warning: flag is not supported by this version of the compiler: -Xabcdefghijklm
warning: flag is not supported by this version of the compiler: -Xnopqrstuvwxyz
warning: flag is not supported by this version of the compiler: -XXxxxxxxxxxxxx
warning: running the Kotlin compiler under Java 6 or 7 is unsupported and will no longer be possible in a future update.
OK

View File

@@ -2,16 +2,21 @@
// IGNORE_BACKEND: JS, NATIVE
// FULL_JDK
// WITH_RUNTIME
//This front-end problem test added to box ones only cause of FULL_JDK support
import org.w3c.dom.Element
import org.xml.sax.InputSource
import javax.xml.parsers.DocumentBuilderFactory
import java.io.StringReader
class MyElement(e: Element): Element by e {
fun bar() = "OK"
}
fun box() : String {
val touch = MyElement::class.java
return "OK"
val factory = DocumentBuilderFactory.newInstance()!!;
val builder = factory.newDocumentBuilder()!!;
val source = InputSource(StringReader("<OK></OK>"));
val doc = builder.parse(source)!!;
val myElement = MyElement(doc.getDocumentElement()!!)
return myElement.getTagName()!!
}

View File

@@ -25,10 +25,8 @@ fun box(): String {
// Java class without nested classes
assertEquals(emptyList<String>(), nestedNames(Error::class))
// Java interface with nested classes
assertEquals(listOf("Entry"), nestedNames(java.util.Map::class))
// Java class with nested classes
assertEquals(listOf("SimpleEntry", "SimpleImmutableEntry"), nestedNames(java.util.AbstractMap::class))
assertEquals(listOf("State", "UncaughtExceptionHandler"), nestedNames(Thread::class))
// Built-ins
assertEquals(emptyList<String>(), nestedNames(Array<Any>::class))

View File

@@ -1,5 +1,5 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// IGNORE_BACKEND: JS, NATIVE, JVM
// WITH_REFLECT
// FULL_JDK

View File

@@ -1,26 +0,0 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// WITH_REFLECT
// FULL_JDK
// See KT-11258 Incorrect resolution sequence for Java field
//SHOULD BE deleted after KT-16616 fix
import java.util.*
fun box(): String {
listOf(
ArrayList::class,
LinkedList::class,
AbstractList::class,
HashSet::class,
TreeSet::class,
HashMap::class,
TreeMap::class,
AbstractMap::class,
AbstractMap.SimpleEntry::class
).map {
it.members.map(Any::toString)
}
return "OK"
}

View File

@@ -1,53 +0,0 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// FULL_JDK
// WITH_RUNTIME
interface ImmutableCollection<out E> : Collection<E> {
fun add(element: @UnsafeVariance E): ImmutableCollection<E>
fun addAll(elements: Collection<@UnsafeVariance E>): ImmutableCollection<E>
fun remove(element: @UnsafeVariance E): ImmutableCollection<E>
}
class ImmutableCollectionmpl<E> : ImmutableCollection<E> {
override val size: Int
get() = throw UnsupportedOperationException()
override fun contains(element: E): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun containsAll(elements: Collection<E>): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun isEmpty(): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun iterator(): Iterator<E> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun add(element: E): ImmutableCollection<E> = this
override fun addAll(elements: Collection<E>): ImmutableCollection<E> = this
override fun remove(element: E): ImmutableCollection<E> = this
}
fun box(): String {
val c = ImmutableCollectionmpl<String>()
if (c.remove("") !== c) return "fail 1"
if (c.add("") !== c) return "fail 2"
if (c.addAll(java.util.ArrayList()) !== c) return "fail 3"
val method = c.javaClass.methods.single { it.name == "remove" && it.returnType == Boolean::class.javaPrimitiveType }
try {
method.invoke(c, "")
return "fail 4"
} catch (e: java.lang.reflect.InvocationTargetException) {
if (e.cause!!.message != "Operation is not supported for read-only collection") return "fail 5: ${e.cause!!.message}"
}
return "OK"
}

View File

@@ -1,22 +0,0 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// WITH_REFLECT
// FILE: J.java
public class J {
void foo(String s, int i) {}
static void bar(J j) {}
}
// FILE: K.kt
import kotlin.test.assertEquals
fun box(): String {
assertEquals(listOf(null, "arg0", "arg1"), J::foo.parameters.map { it.name })
assertEquals(listOf("arg0"), J::bar.parameters.map { it.name })
return "OK"
}

View File

@@ -0,0 +1,33 @@
@kotlin.Metadata
public interface ImmutableCollection {
public abstract @org.jetbrains.annotations.NotNull method add(p0: java.lang.Object): ImmutableCollection
public abstract @org.jetbrains.annotations.NotNull method addAll(@org.jetbrains.annotations.NotNull p0: java.util.Collection): ImmutableCollection
public abstract @org.jetbrains.annotations.NotNull method remove(p0: java.lang.Object): ImmutableCollection
}
@kotlin.Metadata
public final class ImmutableCollectionmpl {
public method <init>(): void
public @org.jetbrains.annotations.NotNull method add(p0: java.lang.Object): ImmutableCollection
public method add(p0: java.lang.Object): boolean
public @org.jetbrains.annotations.NotNull method addAll(@org.jetbrains.annotations.NotNull p0: java.util.Collection): ImmutableCollection
public method addAll(p0: java.util.Collection): boolean
public method clear(): void
public method contains(p0: java.lang.Object): boolean
public method containsAll(@org.jetbrains.annotations.NotNull p0: java.util.Collection): boolean
public method getSize(): int
public method isEmpty(): boolean
public @org.jetbrains.annotations.NotNull method iterator(): java.util.Iterator
public @org.jetbrains.annotations.NotNull method remove(p0: java.lang.Object): ImmutableCollection
public method remove(p0: java.lang.Object): boolean
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
public final method size(): int
public method toArray(): java.lang.Object[]
public method toArray(p0: java.lang.Object[]): java.lang.Object[]
}
@kotlin.Metadata
public final class ImmutableRemoveKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}

View File

@@ -0,0 +1,4 @@
@kotlin.Metadata
public final class KKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}

View File

@@ -0,0 +1,13 @@
package test
public sealed class Season {
private constructor Season()
public final class Cold : test.Season {
public constructor Cold()
}
public final class Warm : test.Season {
public constructor Warm()
}
}

View File

@@ -0,0 +1,13 @@
package test
public sealed class Season {
private constructor Season()
public final class Cold : test.Season {
public constructor Cold()
}
public final class Warm : test.Season {
public constructor Warm()
}
}

View File

@@ -0,0 +1,9 @@
package test
@test.meta public/*package*/ final annotation class MyAnn : kotlin.Annotation {
public/*package*/ constructor MyAnn()
}
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.ANNOTATION_CLASS}) public final annotation class meta : kotlin.Annotation {
public constructor meta()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS}) public final annotation class classifier : kotlin.Annotation {
public constructor classifier()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CONSTRUCTOR}) public final annotation class constructor : kotlin.Annotation {
public constructor constructor()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {}) public final annotation class empty : kotlin.Annotation {
public constructor empty()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FIELD}) public final annotation class field : kotlin.Annotation {
public constructor field()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION}) public final annotation class function : kotlin.Annotation {
public constructor function()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY_GETTER}) public final annotation class getter : kotlin.Annotation {
public constructor getter()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.LOCAL_VARIABLE}) public final annotation class local : kotlin.Annotation {
public constructor local()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class multiple : kotlin.Annotation {
public constructor multiple()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) public final annotation class parameter : kotlin.Annotation {
public constructor parameter()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY}) public final annotation class property : kotlin.Annotation {
public constructor property()
}

View File

@@ -0,0 +1,5 @@
package test
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY_SETTER}) public final annotation class setter : kotlin.Annotation {
public constructor setter()
}

View File

@@ -5,11 +5,11 @@ build:
[mkdir] Created dir: [Temp]/classes
[javac] Compiling 1 source file to [Temp]/classes
[javac] Running javac...
[javac] [TestData]/J.java:3: error: cannot find symbol
[javac] [TestData]/J.java:3: cannot find symbol
[javac] symbol : class KClassesKt
[javac] location: package kotlin.reflect
[javac] import kotlin.reflect.KClassesKt;
[javac] ^
[javac] symbol: class KClassesKt
[javac] location: package kotlin.reflect
[javac] 1 error
ERR:

View File

@@ -5,7 +5,7 @@ build:
[mkdir] Created dir: [Temp]/classes
[javac] Compiling 1 source file to [Temp]/classes
[javac] Running javac...
[javac] [TestData]/J.java:3: error: package kotlin does not exist
[javac] [TestData]/J.java:3: package kotlin does not exist
[javac] import kotlin.Unit;
[javac] ^
[javac] 1 error

View File

@@ -1,6 +1,3 @@
// FULL_JDK
// JAVAC_EXPECTED_FILE
package test;
public abstract class ClassDoesNotOverrideMethod extends java.util.Date {

View File

@@ -1,6 +1,3 @@
// FULL_JDK
// JAVAC_EXPECTED_FILE
package test;
public abstract class ClassWithTypePExtendsIterableP<P> implements java.lang.Iterable<P> {

View File

@@ -0,0 +1,14 @@
package test
public open class InnerClassesInGeneric</*0*/ P : kotlin.Any!, /*1*/ Q : kotlin.Any!> {
public constructor InnerClassesInGeneric</*0*/ P : kotlin.Any!, /*1*/ Q : kotlin.Any!>()
public open inner class Inner /*captured type parameters: /*0*/ P : kotlin.Any!, /*1*/ Q : kotlin.Any!*/ {
public constructor Inner()
}
public open inner class Inner2 /*captured type parameters: /*0*/ P : kotlin.Any!, /*1*/ Q : kotlin.Any!*/ : test.InnerClassesInGeneric<kotlin.Any!, kotlin.Any!>.Inner {
public constructor Inner2()
public open operator fun iterator(): kotlin.collections.(Mutable)Iterator<P!>!
}
}

View File

@@ -0,0 +1,28 @@
package test
public open class InnerOfGeneric {
public constructor InnerOfGeneric()
public abstract inner class A</*0*/ K : kotlin.Any!> {
public constructor A</*0*/ K : kotlin.Any!>()
public abstract inner class Inner /*captured type parameters: /*0*/ K : kotlin.Any!*/ : test.InnerOfGeneric.S<K!> {
public constructor Inner()
public open override /*1*/ /*fake_override*/ fun iterator(): kotlin.collections.(Mutable)Iterator<K!>!
}
}
public open inner class B</*0*/ L : kotlin.Any!> : test.InnerOfGeneric.A<L!> {
public constructor B</*0*/ L : kotlin.Any!>()
public open inner class SubInner /*captured type parameters: /*0*/ L : kotlin.Any!*/ : test.InnerOfGeneric.A<kotlin.Any!>.Inner {
public constructor SubInner()
public open override /*1*/ fun iterator(): kotlin.collections.(Mutable)Iterator<L!>!
}
}
public open inner class S</*0*/ E : kotlin.Any!> {
public constructor S</*0*/ E : kotlin.Any!>()
public open operator fun iterator(): kotlin.collections.(Mutable)Iterator<E!>!
}
}

View File

@@ -0,0 +1,22 @@
package test
public interface ReturnInnerSubclassOfSupersInner {
public open class Sub</*0*/ B : kotlin.Any!> : test.ReturnInnerSubclassOfSupersInner.Super<B!> {
public constructor Sub</*0*/ B : kotlin.Any!>()
public/*package*/ open inner class Inner /*captured type parameters: /*0*/ B : kotlin.Any!*/ : test.ReturnInnerSubclassOfSupersInner.Super<kotlin.Any!>.Inner {
public/*package*/ constructor Inner()
public/*package*/ open override /*1*/ fun get(): test.ReturnInnerSubclassOfSupersInner.Sub<B!>!
}
}
public open class Super</*0*/ A : kotlin.Any!> {
public constructor Super</*0*/ A : kotlin.Any!>()
public/*package*/ open inner class Inner /*captured type parameters: /*0*/ A : kotlin.Any!*/ {
public/*package*/ constructor Inner()
public/*package*/ open fun get(): test.ReturnInnerSubclassOfSupersInner.Super<A!>!
}
}
}

View File

@@ -2,10 +2,8 @@
package test
import java.io.Serializable
annotation class A
interface Foo<T : @A Number> : @A Serializable {
interface Foo<T : @A Number> : @A CharSequence {
fun <E, F : @A E> bar()
}

View File

@@ -4,6 +4,10 @@ public final annotation class A : kotlin.Annotation {
/*primary*/ public constructor A()
}
public interface Foo</*0*/ T : @test.A kotlin.Number> : @test.A java.io.Serializable {
public interface Foo</*0*/ T : @test.A kotlin.Number> : @test.A kotlin.CharSequence {
public abstract override /*1*/ /*fake_override*/ val length: kotlin.Int
public abstract override /*1*/ /*fake_override*/ fun <get-length>(): kotlin.Int
public abstract fun </*0*/ E, /*1*/ F : @test.A E> bar(): kotlin.Unit
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ index: kotlin.Int): kotlin.Char
public abstract override /*1*/ /*fake_override*/ fun subSequence(/*0*/ startIndex: kotlin.Int, /*1*/ endIndex: kotlin.Int): kotlin.CharSequence
}

View File

@@ -1,6 +1,3 @@
// FULL_JDK
// JAVAC_EXPECTED_FILE
package test
public abstract class ClassDoesNotOverrideMethod() : java.util.Date() {

View File

@@ -1,6 +1,3 @@
// FULL_JDK
// JAVAC_EXPECTED_FILE
package test
public abstract class ClassWithTypePExtendsIterableP<P>() : kotlin.collections.MutableIterable<P> {

View File

@@ -1,6 +1,3 @@
// FULL_JDK
// JAVAC_EXPECTED_FILE
package test
public interface HalfSubstitutedTypeParameters {

View File

@@ -1,6 +1,3 @@
// FULL_JDK
// JAVAC_EXPECTED_FILE
package test
public interface SubclassOfCollection<E>: MutableCollection<E> {

View File

@@ -86,6 +86,7 @@ import org.jetbrains.kotlin.util.slicedMap.ReadOnlySlice;
import org.jetbrains.kotlin.util.slicedMap.SlicedMap;
import org.jetbrains.kotlin.util.slicedMap.WritableSlice;
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
import org.jetbrains.kotlin.utils.PathUtil;
import org.junit.Assert;
import javax.tools.*;
@@ -539,8 +540,8 @@ public class KotlinTestUtils {
configuration.put(JVMConfigurationKeys.JDK_HOME, home);
}
}
else if (SystemInfo.IS_AT_LEAST_JAVA9) {
configuration.put(JVMConfigurationKeys.JDK_HOME, new File(System.getProperty("java.home")));
else {
JvmContentRootsKt.addJvmClasspathRoots(configuration, PathUtil.getJdkClassesRootsFromCurrentJre());
}
if (configurationKind.getWithRuntime()) {

View File

@@ -122,7 +122,6 @@ public abstract class KtParsingTestCase extends KtPlatformLiteFixture {
myProject.registerService(PsiManager.class, myPsiManager);
this.registerExtensionPoint(FileTypeFactory.FILE_TYPE_FACTORY_EP, FileTypeFactory.class);
registerExtensionPoint(MetaLanguage.EP_NAME, MetaLanguage.class);
for (ParserDefinition definition : myDefinitions) {
addExplicitExtension(LanguageParserDefinitions.INSTANCE, definition.getFileNodeType().getLanguage(), definition);

View File

@@ -39,7 +39,6 @@ import junit.framework.TestCase;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.types.FlexibleTypeImpl;
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
import org.junit.Assert;
@@ -95,10 +94,10 @@ public abstract class KtUsefulTestCase extends TestCase {
testName = new File(testName).getName(); // in case the test name contains file separators
myTempDir = new File(ORIGINAL_TEMP_DIR, TEMP_DIR_MARKER + testName).getPath();
FileUtil.resetCanonicalTempPathCache(myTempDir);
boolean isStressTest = isStressTest();
ApplicationInfoImpl.setInStressTest(isStressTest);
boolean isPerformanceTest = isPerformanceTest();
ApplicationInfoImpl.setInPerformanceTest(isPerformanceTest);
// turn off Disposer debugging for performance tests
oldDisposerDebug = Disposer.setDebugMode(Disposer.isDebugMode() && !isStressTest);
oldDisposerDebug = Disposer.setDebugMode(Disposer.isDebugMode() && !isPerformanceTest);
}
@Override
@@ -455,30 +454,9 @@ public abstract class KtUsefulTestCase extends TestCase {
}
}
private static boolean isPerformanceTest(@Nullable String testName, @Nullable String className) {
return testName != null && testName.contains("Performance") ||
className != null && className.contains("Performance");
}
/**
* @return true for a test which performs A LOT of computations.
* Such test should typically avoid performing expensive checks, e.g. data structure consistency complex validations.
* If you want your test to be treated as "Stress", please mention one of these words in its name: "Stress", "Slow".
* For example: {@code public void testStressPSIFromDifferentThreads()}
*/
private boolean isStressTest() {
return isStressTest(getName(), getClass().getName());
}
private static boolean isStressTest(String testName, String className) {
return isPerformanceTest(testName, className) ||
containsStressWords(testName) ||
containsStressWords(className);
}
private static boolean containsStressWords(@Nullable String name) {
return name != null && (name.contains("Stress") || name.contains("Slow"));
private boolean isPerformanceTest() {
String name = getName();
return name != null && name.contains("Performance") || getClass().getName().contains("Performance");
}

View File

@@ -19,7 +19,6 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.EditorKind;
import com.intellij.openapi.editor.event.EditorEventMulticaster;
import com.intellij.openapi.editor.event.EditorFactoryListener;
import com.intellij.openapi.editor.impl.DocumentImpl;
@@ -28,7 +27,6 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.text.CharArrayCharSequence;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class MockEditorFactory extends EditorFactory {
@Override
@@ -61,27 +59,6 @@ public class MockEditorFactory extends EditorFactory {
return null;
}
@Override
public Editor createEditor(
@NotNull Document document, @Nullable Project project, @NotNull EditorKind kind
) {
return null;
}
@Override
public Editor createEditor(
@NotNull Document document, Project project, @NotNull VirtualFile file, boolean isViewer, @NotNull EditorKind kind
) {
return null;
}
@Override
public Editor createViewer(
@NotNull Document document, @Nullable Project project, @NotNull EditorKind kind
) {
return null;
}
@Override
public void releaseEditor(@NotNull Editor editor) {
}

View File

@@ -190,8 +190,4 @@ public class MockPsiManager extends PsiManagerEx {
@Override
public void beforeChildAddition(@NotNull PsiTreeChangeEventImpl event) {
}
@Override
public void dropPsiCaches() {
}
}

View File

@@ -1481,6 +1481,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("immutableRemove.kt")
public void testImmutableRemove() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/immutableRemove.kt");
doTest(fileName);
}
@TestMetadata("implementationInTrait.kt")
public void testImplementationInTrait() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt");
@@ -16702,6 +16708,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("javaParametersHaveNoNames.kt")
public void testJavaParametersHaveNoNames() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/parameters/javaParametersHaveNoNames.kt");
doTest(fileName);
}
@TestMetadata("kinds.kt")
public void testKinds() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/parameters/kinds.kt");

View File

@@ -138,21 +138,6 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
doTest(fileName);
}
@TestMetadata("compiler/testData/codegen/java8/box/builtinStubMethods")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class BuiltinStubMethods extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInBuiltinStubMethods() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/java8/box/builtinStubMethods"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("immutableRemove.kt")
public void testImmutableRemove() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/builtinStubMethods/immutableRemove.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/java8/box/delegationBy")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -622,20 +607,5 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/reflection/synthesizedParameterNames.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/codegen/java8/box/reflection/parameters")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Parameters extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInParameters() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/java8/box/reflection/parameters"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("javaParametersHaveDefaultNames.kt")
public void testJavaParametersHaveDefaultNames() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/reflection/parameters/javaParametersHaveDefaultNames.kt");
doTest(fileName);
}
}
}
}

View File

@@ -1481,6 +1481,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("immutableRemove.kt")
public void testImmutableRemove() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/immutableRemove.kt");
doTest(fileName);
}
@TestMetadata("implementationInTrait.kt")
public void testImplementationInTrait() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/builtinStubMethods/implementationInTrait.kt");
@@ -16702,6 +16708,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("javaParametersHaveNoNames.kt")
public void testJavaParametersHaveNoNames() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/parameters/javaParametersHaveNoNames.kt");
doTest(fileName);
}
@TestMetadata("kinds.kt")
public void testKinds() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/parameters/kinds.kt");

View File

@@ -24,11 +24,10 @@ import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
import org.jetbrains.kotlin.utils.addIfNotNull
import org.junit.Assert
import org.xml.sax.Attributes
import org.xml.sax.helpers.DefaultHandler
import org.w3c.dom.Element
import java.io.File
import java.util.*
import javax.xml.parsers.SAXParserFactory
import javax.xml.parsers.DocumentBuilderFactory
class KotlinVersionsTest : KtUsefulTestCase() {
fun testVersionsAreConsistent() {
@@ -67,7 +66,7 @@ class KotlinVersionsTest : KtUsefulTestCase() {
)
versions.add(
loadValueFromPomXml("libraries/pom.xml", listOf("project", "version"))
loadValueFromPomXml("libraries/pom.xml", listOf("version"))
?.toVersion("version in pom.xml")
?: error("No version in libraries/pom.xml")
)
@@ -91,8 +90,8 @@ class KotlinVersionsTest : KtUsefulTestCase() {
FileUtil.processFilesRecursively(File("libraries"), Processor { file ->
if (file.name == "pom.xml") {
if (loadValueFromPomXml(file.path, listOf("project", "parent", "artifactId")) == "kotlin-project") {
val version = loadValueFromPomXml(file.path, listOf("project", "parent", "version"))
if (loadValueFromPomXml(file.path, listOf("parent", "artifactId")) == "kotlin-project") {
val version = loadValueFromPomXml(file.path, listOf("version"))
?: error("No version found in pom.xml at $file")
poms.add(Pom(file.path, version))
}
@@ -116,29 +115,12 @@ class KotlinVersionsTest : KtUsefulTestCase() {
private fun loadValueFromPomXml(filePath: String, query: List<String>): String? {
assert(filePath.endsWith("pom.xml")) { filePath }
var result: String? = null
val docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder()
val input = docBuilder.parse(File(filePath).inputStream())
SAXParserFactory.newInstance().newSAXParser().parse(File(filePath), object : DefaultHandler() {
val currentPath = mutableListOf<String>()
override fun startElement(uri: String, localName: String, qName: String, attributes: Attributes) {
currentPath.add(qName)
}
override fun endElement(uri: String, localName: String, qName: String) {
assert(currentPath.lastOrNull() == qName) { "Invalid XML at $filePath: mismatched tag '$qName'" }
currentPath.removeAt(currentPath.lastIndex)
}
override fun characters(ch: CharArray, start: Int, length: Int) {
if (currentPath == query) {
assert(result == null) { "More than one value found for $query in $filePath" }
result = String(ch, start, length).trim()
}
}
})
return result
return query.fold(input.documentElement) { element, tagName ->
element?.getElementsByTagName(tagName)?.item(0) as? Element
}?.textContent
}
private fun Collection<Any>.areEqual(): Boolean = all(first()::equals)

View File

@@ -31,7 +31,7 @@ dependencies {
compile(ideaSdkCoreDeps("intellij-core", "util"))
compileOnly(ideaSdkDeps("openapi", "idea", "velocity", "boot", "gson", "swingx-core", "jsr305", "forms_rt"))
compileOnly(ideaSdkDeps("openapi", "idea", "velocity", "boot", "gson", "swingx-core", /*"jsr305",*/ "forms_rt"))
compile(ideaPluginDeps("IntelliLang", plugin = "IntelliLang"))
compile(ideaPluginDeps("copyright", plugin = "copyright"))
@@ -52,7 +52,7 @@ dependencies {
testCompileOnly(ideaPluginDeps("Groovy", plugin = "Groovy"))
testCompileOnly(ideaPluginDeps("maven", "maven-server-api", plugin = "maven"))
testCompileOnly(ideaSdkDeps("groovy-all", "velocity", "gson", "jsr305"))
testCompileOnly(ideaSdkDeps("groovy-all", "velocity", "gson"/*, "jsr305"*/))
testRuntime(ideaSdkDeps("*.jar"))

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="backend" />
<orderEntry type="module" module-name="frontend" />
<orderEntry type="module" module-name="frontend.java" />
<orderEntry type="module" module-name="light-classes" />
<orderEntry type="module" module-name="eval4j" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../ideaSDK/core/annotations.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="guava" level="project" />
<orderEntry type="module" module-name="js.frontend" />
<orderEntry type="module" module-name="js.serializer" />
<orderEntry type="library" name="trove4j" level="project" />
<orderEntry type="module" module-name="ide-common" exported="" />
<orderEntry type="module" module-name="util" />
<orderEntry type="module" module-name="idea-core" />
<orderEntry type="module" module-name="idea-jps-common" />
<orderEntry type="module" module-name="cli-common" />
<orderEntry type="module" module-name="descriptors" />
<orderEntry type="library" exported="" name="idea-full" level="project" />
<orderEntry type="library" name="uast-java" level="project" />
<orderEntry type="module" module-name="frontend.script" />
</component>
</module>

View File

@@ -64,7 +64,7 @@ abstract class BaseKotlinCompilerSettings<T : Freezable> protected constructor()
override fun getState() = XmlSerializer.serialize(_settings, SKIP_DEFAULT_VALUES)
override fun loadState(state: Element) {
_settings = XmlSerializer.deserialize(state, _settings.javaClass)
_settings = XmlSerializer.deserialize(state, _settings.javaClass)!!
}
public override fun clone(): Any = super.clone()

View File

@@ -16,12 +16,12 @@
package org.jetbrains.kotlin.idea.modules
import com.intellij.codeInsight.daemon.impl.analysis.JavaModuleGraphUtil
//import com.intellij.codeInsight.daemon.impl.analysis.JavaModuleGraphUtil
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiJavaModule
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.light.LightJavaModule
//import com.intellij.psi.impl.light.LightJavaModule
import org.jetbrains.annotations.NotNull
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleResolver
@@ -29,12 +29,17 @@ import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleResolver
class IdeJavaModuleResolver(private val project: Project) : JavaModuleResolver {
private fun findJavaModule(file: VirtualFile): PsiJavaModule? =
ModuleHighlightUtil2.getModuleDescriptor(file, project)
/*private val psiManager = PsiManager.getInstance(project)
private fun findJavaModule(file: VirtualFile): PsiJavaModule? {
return psiManager.findFile(file)?.let(JavaModuleGraphUtil::findDescriptorByElement)
}*/
override fun checkAccessibility(
fileFromOurModule: VirtualFile?, referencedFile: VirtualFile, referencedPackage: FqName?
): JavaModuleResolver.AccessError? {
val ourModule = fileFromOurModule?.let(this::findJavaModule)
val theirModule = findJavaModule(referencedFile)
/*val ourModule = fileFromOurModule?.let(this::findJavaModule)
val theirModule = this.findJavaModule(referencedFile)
if (ourModule?.name == theirModule?.name) return null
@@ -46,23 +51,26 @@ class IdeJavaModuleResolver(private val project: Project) : JavaModuleResolver {
return JavaModuleResolver.AccessError.ModuleDoesNotReadModule(theirModule.name)
}
// In the IDE, we allow unnamed module to access unexported package of the named module. The reason is that the compiler
// will use classpath, not the module path, when compilation of this module is launched from the IDE (because the module has
// no module-info). All of its dependencies will also land on the classpath, and everything is visible in the classpath,
// even non-exported packages of artifacts which would otherwise be loaded as named modules, if they were on the module path.
// So, no error will be reported from the compiler. Moreover, a run configuration of something from this unnamed module will also
// use classpath, not the module path, and in the same way everything will work at runtime as well.
if (ourModule != null) {
val fqName = referencedPackage?.asString() ?: return null
if (!exports(theirModule, fqName, ourModule)) {
return JavaModuleResolver.AccessError.ModuleDoesNotExportPackage(theirModule.name)
}
}
val fqName = referencedPackage?.asString() ?: return null
if (!exports(theirModule, fqName, ourModule)) {
return JavaModuleResolver.AccessError.ModuleDoesNotExportPackage(theirModule.name)
}*/
return null
}
// Returns whether or not [source] exports [packageName] to [target]
private fun exports(source: PsiJavaModule, packageName: String, target: PsiJavaModule): Boolean =
source is LightJavaModule || JavaModuleGraphUtil.exports(source, packageName, target)
/*private fun exports(source: PsiJavaModule, packageName: String, target: PsiJavaModule?): Boolean {
if (source is LightJavaModule) {
return true
}
// TODO: simply call JavaModuleGraphUtil.exports as soon as its 'target' parameter is nullable
if (target != null) {
return JavaModuleGraphUtil.exports(source, packageName, target)
}
return source.exports.any { statement ->
statement.moduleNames.isEmpty() && statement.packageName == packageName
}
}*/
}

View File

@@ -159,9 +159,4 @@ val KtElement.languageVersionSettings: LanguageVersionSettings
}
val KtElement.jvmTarget: JvmTarget
get() {
if (ServiceManager.getService(project, ProjectFileIndex::class.java) == null) {
return JvmTarget.DEFAULT
}
return ModuleUtilCore.findModuleForPsiElement(this)?.targetPlatform?.version as? JvmTarget ?: JvmTarget.DEFAULT
}
get() = ModuleUtilCore.findModuleForPsiElement(this)?.targetPlatform?.version as? JvmTarget ?: JvmTarget.DEFAULT

View File

@@ -11,10 +11,11 @@ dependencies {
compile(project(":idea:idea-core"))
compile(project(":idea:ide-common"))
compile(project(":idea:idea-gradle"))
compile(project(":plugins:uast-kotlin"))
compile(ideaSdkDeps("openapi", "idea"))
compile(ideaPluginDeps("gradle-tooling-api", plugin = "gradle"))
compile(ideaPluginDeps("android", "android-common", "sdklib", "sdk-common", "sdk-tools", "layoutlib-api", plugin = "android"))
compile(ideaPluginDeps("android", "android-common", "sdklib", "sdk-common", "sdk-tools", "layoutlib-api", "common", plugin = "android"))
compile(preloadedDeps("dx", subdir = "android-5.0/lib"))
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))

View File

@@ -5,7 +5,7 @@ dependencies {
compile(project(":compiler:util"))
compile(ideaSdkCoreDeps("intellij-core"))
compile(ideaPluginDeps("gradle-tooling-api", plugin = "gradle"))
compile(ideaPluginDeps("android", "android-common", "sdk-common", plugin = "android"))
compile(ideaPluginDeps("android", "android-common", "sdk-common", "common", plugin = "android"))
}
sourceSets {

View File

@@ -71,7 +71,7 @@ class AndroidResourceReferenceAnnotator : Annotator {
val iconFile = AndroidColorAnnotator.pickBestBitmap(file)
if (iconFile != null) {
val annotation = holder.createInfoAnnotation(element, null)
annotation.gutterIconRenderer = GutterIconRenderer(resourceResolver, element, iconFile)
annotation.gutterIconRenderer = GutterIconRenderer(element, iconFile)
}
}
}

View File

@@ -123,7 +123,7 @@ internal fun getReferredResourceOrManifestField(facet: AndroidFacet, expression:
val qName = rClassDescriptor.fqNameSafe.asString()
if (SdkConstants.CLASS_R == qName || AndroidPsiElementFinder.INTERNAL_R_CLASS_QNAME == qName) {
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, facet.module, true, false)
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, true, false)
}
}
@@ -132,7 +132,7 @@ internal fun getReferredResourceOrManifestField(facet: AndroidFacet, expression:
return null
}
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, facet.module, false, false)
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, false, false)
}
private fun KtExpression.getPreviousInQualifiedChain(): KtExpression? {

View File

@@ -196,7 +196,7 @@ public class ResourceReferenceAnnotatorUtil {
@Override
public Icon getIcon() {
Color color = getCurrentColor();
return JBUI.scale(color == null ? EmptyIcon.create(ICON_SIZE) : new ColorIcon(ICON_SIZE, color));
return color == null ? EmptyIcon.create(ICON_SIZE) : new ColorIcon(ICON_SIZE, color);
}
@Nullable

View File

@@ -16,8 +16,8 @@
package org.jetbrains.kotlin.android.actions
import com.android.tools.idea.gradle.project.sync.GradleSyncListener
import com.android.tools.idea.gradle.project.sync.GradleSyncState
import com.android.tools.idea.gradle.GradleSyncState
import com.android.tools.idea.gradle.project.GradleSyncListener
import com.intellij.history.core.RevisionsCollector
import com.intellij.history.core.revisions.Revision
import com.intellij.history.integration.LocalHistoryImpl

View File

@@ -32,7 +32,7 @@
package org.jetbrains.kotlin.android.configure
import com.android.tools.idea.gradle.project.sync.idea.data.service.AndroidProjectKeys
import com.android.tools.idea.gradle.AndroidProjectKeys
import com.intellij.openapi.externalSystem.model.DataNode
import com.intellij.openapi.externalSystem.model.project.ModuleData
import com.intellij.openapi.externalSystem.model.project.ProjectData
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.idea.inspections.gradle.findModulesByNames
class AndroidGradleModelFacade : KotlinGradleModelFacade {
override fun getResolvedKotlinStdlibVersionByModuleData(moduleData: DataNode<*>, libraryIds: List<String>): String? {
ExternalSystemApiUtil
.findAllRecursively(moduleData, AndroidProjectKeys.JAVA_MODULE_MODEL).asSequence()
.findAllRecursively(moduleData, AndroidProjectKeys.JAVA_PROJECT).asSequence()
.flatMap { it.data.jarLibraryDependencies.asSequence() }
.forEach {
val libraryName = it.name
@@ -58,7 +58,7 @@ class AndroidGradleModelFacade : KotlinGradleModelFacade {
override fun getDependencyModules(ideModule: DataNode<ModuleData>, gradleIdeaProject: IdeaProject): Collection<DataNode<ModuleData>> {
val ideProject = ideModule.parent as DataNode<ProjectData>
ExternalSystemApiUtil.find(ideModule, AndroidProjectKeys.JAVA_MODULE_MODEL)?.let { javaModuleModel ->
ExternalSystemApiUtil.find(ideModule, AndroidProjectKeys.JAVA_PROJECT)?.let { javaModuleModel ->
val moduleNames = javaModuleModel.data.javaModuleDependencies.map { it.moduleName }
return findModulesByNames(moduleNames, gradleIdeaProject, ideProject)
}

View File

@@ -16,8 +16,8 @@
package org.jetbrains.kotlin.android.configure
import com.android.tools.idea.gradle.project.model.JavaModuleModel
import com.android.tools.idea.gradle.project.sync.idea.data.service.AndroidProjectKeys
import com.android.tools.idea.gradle.AndroidProjectKeys
import com.android.tools.idea.gradle.JavaProject
import com.android.tools.idea.gradle.util.FilePaths
import com.intellij.openapi.externalSystem.model.DataNode
import com.intellij.openapi.externalSystem.model.project.ModuleData
@@ -33,11 +33,11 @@ import org.jetbrains.kotlin.idea.framework.detectLibraryKind
import org.jetbrains.kotlin.idea.framework.libraryKind
import java.io.File
class KotlinAndroidGradleLibraryDataService : AbstractProjectDataService<JavaModuleModel, Void>() {
override fun getTargetDataKey() = AndroidProjectKeys.JAVA_MODULE_MODEL
class KotlinAndroidGradleLibraryDataService : AbstractProjectDataService<JavaProject, Void>() {
override fun getTargetDataKey() = AndroidProjectKeys.JAVA_PROJECT
override fun postProcess(
toImport: MutableCollection<DataNode<JavaModuleModel>>,
toImport: MutableCollection<DataNode<JavaProject>>,
projectData: ProjectData?,
project: Project,
modelsProvider: IdeModifiableModelsProvider

View File

@@ -243,4 +243,4 @@ class KotlinAndroidAddStringResource : SelfTargetingIntention<KtLiteralStringTem
private fun ClassifierDescriptor.isStrictSubclassOf(className: String) = defaultType.constructor.supertypes.any {
it.constructor.declarationDescriptor?.isSubclassOf(className) ?: false
}
}
}

View File

@@ -24,7 +24,6 @@ import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.PsiClass
import org.jetbrains.android.util.AndroidUtils
import com.android.SdkConstants
import com.intellij.openapi.module.ModuleUtil
import org.jetbrains.android.augment.AndroidPsiElementFinder
import org.jetbrains.kotlin.idea.references.mainReference
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
@@ -68,7 +67,6 @@ private fun getReferredInfo(
val firstPart = getReceiverAsSimpleNameExpression(middlePart) ?: return null
val resolvedClass = firstPart.mainReference.resolve() as? PsiClass ?: return null
val resolvedModule = ModuleUtil.findModuleForPsiElement(resolvedClass)
//the following code is copied from
// org.jetbrains.android.util.AndroidResourceUtil.getReferredResourceOrManifestField
@@ -83,7 +81,7 @@ private fun getReferredInfo(
val qName = resolvedClass.qualifiedName
if (SdkConstants.CLASS_R == qName || AndroidPsiElementFinder.INTERNAL_R_CLASS_QNAME == qName) {
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, resolvedModule, true, false)
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, true, false)
}
val containingFile = resolvedClass.containingFile ?: return null
@@ -95,7 +93,7 @@ private fun getReferredInfo(
return null
}
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, resolvedModule, false, fromManifest)
return AndroidResourceUtil.MyReferredResourceFieldInfo(resClassName, resFieldName, false, fromManifest)
}
private fun getReceiverAsSimpleNameExpression(exp: KtSimpleNameExpression): KtSimpleNameExpression? {

View File

@@ -119,7 +119,7 @@ public abstract class AndroidTestCase extends AndroidTestBase {
Module additionalModule = data.myModuleFixtureBuilder.getFixture().getModule();
myAdditionalModules.add(additionalModule);
AndroidFacet facet = addAndroidFacet(additionalModule);
facet.setProjectType(data.myProjectType);
facet.setLibraryProject(data.myProjectType == 1);
String rootPath = getAdditionalModulePath(data.myDirName);
myFixture.copyDirectoryToProject(getResDir(), rootPath + "/res");
myFixture.copyFileToProject(SdkConstants.FN_ANDROID_MANIFEST_XML, rootPath + '/' + SdkConstants.FN_ANDROID_MANIFEST_XML);

View File

@@ -30,14 +30,14 @@ import org.jetbrains.kotlin.idea.test.KotlinTestImportFilter;
public abstract class AbstractAndroidQuickFixMultiFileTest extends AbstractQuickFixMultiFileTest {
@Override
protected void setUp() {
protected void setUp() throws Exception {
super.setUp();
addAndroidFacet();
Extensions.getRootArea().getExtensionPoint(ImportFilter.EP_NAME).registerExtension(KotlinTestImportFilter.INSTANCE);
}
@Override
protected void tearDown() {
protected void tearDown() throws Exception {
Extensions.getRootArea().getExtensionPoint(ImportFilter.EP_NAME).unregisterExtension(KotlinTestImportFilter.INSTANCE);
AndroidFacet facet = FacetManager.getInstance(myModule).getFacetByType(AndroidFacet.getFacetType().getId());
FacetUtil.deleteFacet(facet);
@@ -45,11 +45,17 @@ public abstract class AbstractAndroidQuickFixMultiFileTest extends AbstractQuick
}
@Override
protected void doTestWithExtraFile(@NotNull String beforeFileName) {
protected void doTestWithExtraFile(@NotNull String beforeFileName) throws Exception {
addManifest();
super.doTestWithExtraFile(beforeFileName);
}
@Override
protected void doTestWithoutExtraFile(String beforeFileName) throws Exception {
addManifest();
super.doTestWithoutExtraFile(beforeFileName);
}
private void addAndroidFacet() {
FacetManager facetManager = FacetManager.getInstance(myModule);
AndroidFacet facet = facetManager.createFacet(AndroidFacet.getFacetType(), "Android", null);
@@ -59,7 +65,7 @@ public abstract class AbstractAndroidQuickFixMultiFileTest extends AbstractQuick
ApplicationManager.getApplication().runWriteAction(facetModel::commit);
}
private void addManifest() {
myFixture.configureByFile("idea/testData/android/AndroidManifest.xml");
private void addManifest() throws Exception {
configureByFile("idea/testData/android/AndroidManifest.xml");
}
}

View File

@@ -413,7 +413,6 @@ fun ImportableFqNameClassifier.isImportableDescriptorImported(descriptor: Declar
fun OffsetMap.tryGetOffset(key: OffsetKey): Int? {
try {
if (!containsOffset(key)) return null
return getOffset(key).takeIf { it != -1 } // prior to IDEA 2016.3 getOffset() returned -1 if not found, now it throws exception
}
catch(e: Exception) {

View File

@@ -50,6 +50,8 @@ class KotlinCompletionContributor : CompletionContributor() {
companion object {
val DEFAULT_DUMMY_IDENTIFIER: String = CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED + "$" // add '$' to ignore context after the caret
private val STRING_TEMPLATE_AFTER_DOT_REAL_START_OFFSET = OffsetKey.create("STRING_TEMPLATE_AFTER_DOT_REAL_START_OFFSET")
}
init {
@@ -80,6 +82,7 @@ class KotlinCompletionContributor : CompletionContributor() {
val prefix = tokenBefore.text.substring(0, offset - tokenBefore.startOffset)
context.dummyIdentifier = "{" + expression.text + prefix + CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED + "}"
context.offsetMap.addOffset(CompletionInitializationContext.START_OFFSET, expression.startOffset)
context.offsetMap.addOffset(STRING_TEMPLATE_AFTER_DOT_REAL_START_OFFSET, offset + 1)
return
}
}
@@ -240,13 +243,8 @@ class KotlinCompletionContributor : CompletionContributor() {
val expression = (position.parent as KtBlockStringTemplateEntry).expression
if (expression is KtDotQualifiedExpression) {
val correctedPosition = (expression.selectorExpression as KtNameReferenceExpression).firstChild
// Workaround for KT-16848
// ex:
// expression: some.IntellijIdeaRulezzz
// correctedOffset: ^
// expression: some.funcIntellijIdeaRulezzz
// correctedOffset ^
val correctedOffset = correctedPosition.endOffset - CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED.length
val context = position.getUserData(CompletionContext.COMPLETION_CONTEXT_KEY)!!
val correctedOffset = context.offsetMap.getOffset(STRING_TEMPLATE_AFTER_DOT_REAL_START_OFFSET)
val correctedParameters = parameters.withPosition(correctedPosition, correctedOffset)
doComplete(correctedParameters, toFromOriginalFileMapper, result,
lookupElementPostProcessor = { wrapLookupElementForStringTemplateAfterDotCompletion(it) })

View File

@@ -41,7 +41,7 @@ abstract class AbstractCompletionHandlerTest(private val defaultCompletionType:
val settingManager = CodeStyleSettingsManager.getInstance()
val tempSettings = settingManager.currentSettings.clone()
settingManager.setTemporarySettings(tempSettings)
settingManager.temporarySettings = tempSettings
try {
val fileText = FileUtil.loadFile(File(testPath))
assertTrue("\"<caret>\" is missing in file \"$testPath\"", fileText.contains("<caret>"));

View File

@@ -22,6 +22,8 @@ import com.intellij.codeInsight.lookup.LookupElementPresentation
import com.intellij.codeInsight.lookup.LookupEvent
import com.intellij.codeInsight.lookup.LookupManager
import com.intellij.codeInsight.lookup.impl.LookupImpl
import com.intellij.openapi.application.Result
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
import org.jetbrains.kotlin.idea.completion.test.ExpectedCompletionUtils
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
@@ -112,7 +114,14 @@ abstract class CompletionHandlerTestBase() : KotlinLightCodeInsightFixtureTestCa
}
lookup.focusDegree = LookupImpl.FocusDegree.FOCUSED
if (LookupEvent.isSpecialCompletionChar(completionChar)) {
lookup.finishLookup(completionChar)
(object : WriteCommandAction.Simple<Any>(project) {
override fun run(result: Result<Any>) {
run()
}
override fun run() {
lookup.finishLookup(completionChar)
}
}).execute().throwException()
}
else {
fixture.type(completionChar)

View File

@@ -15,6 +15,7 @@ dependencies {
compile(ideaSdkCoreDeps("intellij-core", "util"))
compile(ideaSdkDeps("openapi", "idea"))
compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle"))
compileOnly(preloadedDeps("uast-common"))
compile(preloadedDeps("kotlinx-coroutines-core", "kotlinx-coroutines-jdk8"))
}

View File

@@ -19,14 +19,14 @@ package org.jetbrains.kotlin.idea.core.script
import com.intellij.openapi.components.service
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileWithId
import com.intellij.util.io.DataInputOutputUtil.readSeq
import com.intellij.util.io.DataInputOutputUtil.writeSeq
import com.intellij.util.io.DataInputOutputUtil.*
import com.intellij.util.io.IOUtil.readUTF
import com.intellij.util.io.IOUtil.writeUTF
import org.jetbrains.kotlin.idea.caches.FileAttributeService
import java.io.DataInput
import java.io.DataOutput
import java.io.File
import java.io.IOException
import kotlin.script.experimental.dependencies.ScriptDependencies
object ScriptDependenciesFileAttribute {
@@ -104,4 +104,22 @@ private fun <T : Any> DataOutput.writeNullable(nullable: T?, writeT: DataOutput.
private fun <T : Any> DataInput.readNullable(readT: DataInput.() -> T): T? {
val hasValue = readBoolean()
return if (hasValue) readT() else null
}
@Throws(IOException::class)
private fun <T> readSeq(`in`: DataInput, readElement: () -> T): List<T> {
val size = readINT(`in`)
val result = ArrayList<T>(size)
for (i in 0 until size) {
result.add(readElement())
}
return result
}
@Throws(IOException::class)
private fun <T> writeSeq(out: DataOutput, collection: Collection<T>, writeElement: (T) -> Unit) {
writeINT(out, collection.size)
for (t in collection) {
writeElement(t)
}
}

View File

@@ -20,7 +20,7 @@ import com.intellij.openapi.application.Application
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.isProjectOrWorkspaceFile
import com.intellij.openapi.project.ProjectUtil
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.roots.ex.ProjectRootManagerEx
import com.intellij.openapi.util.EmptyRunnable
@@ -268,7 +268,7 @@ internal class ScriptDependenciesUpdater(
it.file?.takeIf {
// the isUnitTestMode check fixes ScriptConfigurationHighlighting & Navigation tests, since they are not trigger proper update mechanims
// TODO: find out the reason, then consider to fix tests and remove this check
(application.isUnitTestMode || projectFileIndex.isInContent(it)) && !isProjectOrWorkspaceFile(it)
(application.isUnitTestMode || projectFileIndex.isInContent(it)) && !ProjectUtil.isProjectOrWorkspaceFile(it)
}
})) {
notifyRootsChanged()

View File

@@ -28,13 +28,10 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.components.StorageScheme;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.externalSystem.importing.ImportSpec;
import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder;
import com.intellij.openapi.externalSystem.model.ExternalSystemDataKeys;
import com.intellij.openapi.externalSystem.model.project.ProjectData;
import com.intellij.openapi.externalSystem.model.project.ProjectId;
import com.intellij.openapi.externalSystem.service.execution.ProgressExecutionMode;
import com.intellij.openapi.externalSystem.service.project.manage.ExternalProjectsManagerImpl;
import com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalModuleBuilder;
import com.intellij.openapi.externalSystem.service.project.wizard.ExternalModuleSettingsStep;
import com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings;
@@ -123,38 +120,13 @@ public class GradleModuleBuilder extends AbstractExternalModuleBuilder<GradlePro
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel)
throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
LOG.assertTrue(getName() != null);
final String originModuleFilePath = getModuleFilePath();
LOG.assertTrue(originModuleFilePath != null);
String moduleName;
if (myProjectId == null) {
moduleName = getName();
}
else {
moduleName = ModuleGrouperKt.isQualifiedModuleNamesEnabled() && StringUtil.isNotEmpty(myProjectId.getGroupId())
? (myProjectId.getGroupId() + '.' + myProjectId.getArtifactId())
: myProjectId.getArtifactId();
}
Project contextProject = myWizardContext.getProject();
String projectFileDirectory = null;
if (myWizardContext.isCreatingNewProject() || contextProject == null || contextProject.getBasePath() == null) {
projectFileDirectory = myWizardContext.getProjectFileDirectory();
}
else if (myWizardContext.getProjectStorageFormat() == StorageScheme.DEFAULT) {
String moduleFileDirectory = getModuleFileDirectory();
if (moduleFileDirectory != null) {
projectFileDirectory = moduleFileDirectory;
}
}
if (projectFileDirectory == null) {
projectFileDirectory = contextProject.getBasePath();
}
if (myWizardContext.getProjectStorageFormat() == StorageScheme.DIRECTORY_BASED) {
projectFileDirectory += "/.idea/modules";
}
String moduleFilePath = projectFileDirectory + "/" + moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION;
String moduleName = myProjectId == null ? getName() : myProjectId.getArtifactId();
String moduleFilePath = myWizardContext.getProjectFileDirectory() + "/.idea/modules/" + moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION;
deleteModuleFile(moduleFilePath);
final ModuleType moduleType = getModuleType();
final Module module = moduleModel.newModule(moduleFilePath, moduleType.getId());
@@ -252,12 +224,9 @@ public class GradleModuleBuilder extends AbstractExternalModuleBuilder<GradlePro
settings.linkProject(gradleProjectSettings);
}
ImportSpec importSpec = new ImportSpecBuilder(project, GradleConstants.SYSTEM_ID)
.use(ProgressExecutionMode.IN_BACKGROUND_ASYNC)
.createDirectoriesForEmptyContentRoots()
.useDefaultCallback()
.build();
ExternalSystemUtil.refreshProject(rootProjectPath, importSpec);
ExternalSystemUtil.refreshProject(
project, GradleConstants.SYSTEM_ID, rootProjectPath, false,
ProgressExecutionMode.IN_BACKGROUND_ASYNC);
final PsiFile psiFile;
if (finalBuildScriptFile != null) {
@@ -477,15 +446,4 @@ public class GradleModuleBuilder extends AbstractExternalModuleBuilder<GradlePro
public static BuildScriptDataBuilder getBuildScriptData(@Nullable Module module) {
return module == null ? null : module.getUserData(BUILD_SCRIPT_DATA);
}
@Nullable
@Override
public Project createProject(String name, String path) {
Project project = super.createProject(name, path);
if (project != null) {
GradleProjectSettings settings = getExternalProjectSettings();
ExternalProjectsManagerImpl.getInstance(project).setStoreExternally(settings.isStoreProjectFilesExternally());
}
return project;
}
}

View File

@@ -248,10 +248,5 @@ public class GradleModuleWizardStep extends ModuleWizardStep {
public String getHelpId() {
return "Gradle_Archetype_Dialog";
}
@Override
public void disposeUIResources() {
Disposer.dispose(myParentProjectForm);
}
}

View File

@@ -26,12 +26,12 @@ import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsPr
import com.intellij.openapi.externalSystem.service.project.manage.AbstractProjectDataService
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.isQualifiedModuleNamesEnabled
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.OrderRootType
import com.intellij.openapi.roots.impl.libraries.LibraryEx
import com.intellij.openapi.roots.impl.libraries.LibraryImpl
import com.intellij.openapi.roots.libraries.PersistentLibraryKind
import com.intellij.openapi.util.registry.Registry
import com.intellij.util.PathUtil
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.config.CoroutineSupport
@@ -210,6 +210,8 @@ private fun configureFacetByGradleModule(
return kotlinFacet
}
private fun isQualifiedModuleNamesEnabled() = Registry.`is`("project.qualified.module.names")
private fun getImplementedModuleName(moduleNode: DataNode<ModuleData>, sourceSetName: String?): String? {
val baseModuleName = moduleNode.implementedModule?.data?.internalName
if (baseModuleName == null || sourceSetName == null) return baseModuleName

View File

@@ -18,9 +18,9 @@ package org.jetbrains.kotlin.idea.run
import com.intellij.execution.configurations.JavaRunConfigurationModule
import com.intellij.execution.configurations.ModuleBasedConfiguration
import com.intellij.openapi.externalSystem.ExternalSystemModulePropertyManager
import com.intellij.openapi.externalSystem.model.project.ExternalSystemSourceType
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.externalSystem.util.ExternalSystemConstants
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ModuleOrderEntry
@@ -94,10 +94,10 @@ class MultiplatformGradleProjectTaskRunner : GradleProjectTaskRunner() {
is ModuleFilesBuildTask -> this
is ModuleBuildTask ->
if (module == origin)
ModuleBuildTaskImpl(replacement, isIncrementalBuild, isIncludeDependentModules, isIncludeRuntimeDependencies)
else
this
if (module == origin)
ModuleBuildTaskImpl(replacement, isIncrementalBuild, isIncludeDependentModules, isIncludeRuntimeDependencies)
else
this
else -> this
}
@@ -109,7 +109,7 @@ class MultiplatformGradleOrderEnumeratorHandler : OrderEnumerationHandler() {
if (!ExternalSystemApiUtil.isExternalSystemAwareModule(GradleConstants.SYSTEM_ID, rootModel.module)) return false
if (!GradleSystemRunningSettings.getInstance().isUseGradleAwareMake) {
val gradleProjectPath = ExternalSystemModulePropertyManager.getInstance(rootModel.module).getRootProjectPath() ?: return false
val gradleProjectPath = rootModel.module.getOptionValue(ExternalSystemConstants.ROOT_PROJECT_PATH_KEY);
val externalProjectDataCache = ExternalProjectDataCache.getInstance(rootModel.module.project)!!
val externalRootProject = externalProjectDataCache.getRootExternalProject(GradleConstants.SYSTEM_ID,
File(gradleProjectPath)) ?: return false
@@ -139,7 +139,11 @@ class MultiplatformGradleOrderEnumeratorHandler : OrderEnumerationHandler() {
}
private fun addOutputModuleRoots(directorySet: ExternalSourceDirectorySet?, result: MutableCollection<String>) {
directorySet?.gradleOutputDirs?.mapTo(result) { VfsUtilCore.pathToUrl(it.absolutePath) }
if (directorySet == null) return;
if (directorySet.isCompilerOutputPathInherited) return
val path = directorySet.outputDir.absolutePath
result.add(VfsUtilCore.pathToUrl(path))
}
class FactoryImpl : Factory() {
@@ -149,7 +153,7 @@ class MultiplatformGradleOrderEnumeratorHandler : OrderEnumerationHandler() {
}
override fun createHandler(module: Module): OrderEnumerationHandler =
MultiplatformGradleOrderEnumeratorHandler()
MultiplatformGradleOrderEnumeratorHandler()
}
}

View File

@@ -24,7 +24,7 @@ import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.externalSystem.model.project.ProjectData;
import com.intellij.openapi.externalSystem.service.execution.ProgressExecutionMode;
import com.intellij.openapi.externalSystem.service.project.ExternalProjectRefreshCallback;
import com.intellij.openapi.externalSystem.service.project.ProjectDataManager;
import com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager;
import com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings;
import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings;
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;

View File

@@ -51,8 +51,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.jetbrains.kotlin.test.testFramework.EdtTestUtil.runInEdtAndWait;
// part of com.intellij.openapi.externalSystem.test.ExternalSystemTestCase
public abstract class ExternalSystemTestCase extends UsefulTestCase {
private File ourTempDir;
@@ -226,7 +224,7 @@ public abstract class ExternalSystemTestCase extends UsefulTestCase {
@Override
protected void invokeTestRunnable(@NotNull Runnable runnable) throws Exception {
runInEdtAndWait(runnable);
runnable.run();
}
protected static String getRoot() {

View File

@@ -120,7 +120,7 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes
}
}.execute();
Messages.setTestDialog(TestDialog.DEFAULT);
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory().toFile());
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
}
finally {
super.tearDown();

View File

@@ -23,6 +23,7 @@ import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.kotlin.idea.inspections.gradle.DifferentKotlinGradleVersionInspection
import org.jetbrains.kotlin.idea.inspections.gradle.DifferentStdlibGradleVersionInspection
import org.jetbrains.kotlin.idea.inspections.runInspection
import org.jetbrains.kotlin.test.testFramework.runInEdtAndWait
import org.junit.Assert
import org.junit.Test
@@ -206,4 +207,11 @@ class GradleInspectionTest : GradleImportingTestCase() {
return resultRef.get()
}
override fun invokeTestRunnable(runnable: Runnable) {
runInEdtAndWait {
runnable.run()
}
}
}

View File

@@ -89,7 +89,7 @@ public abstract class MavenImportingTestCase extends MavenTestCase {
VfsRootAccess.disallowRootAccess(PathManager.getConfigPath());
Messages.setTestDialog(TestDialog.DEFAULT);
removeFromLocalRepository("test");
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory().toFile());
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
}
finally {
super.tearDown();

View File

@@ -51,11 +51,13 @@ object ConfigLibraryUtil {
return editor
}
@JvmStatic
fun configureKotlinRuntimeAndSdk(module: Module, sdk: Sdk) {
configureSdk(module, sdk)
configureKotlinRuntime(module)
}
@JvmStatic
fun configureKotlinJsRuntimeAndSdk(module: Module, sdk: Sdk) {
configureSdk(module, sdk)
addLibrary(getKotlinRuntimeLibEditor(DEFAULT_KOTLIN_JS_STDLIB_NAME,
@@ -63,21 +65,25 @@ object ConfigLibraryUtil {
JSLibraryKind)
}
@JvmStatic
fun configureKotlinRuntime(module: Module) {
addLibrary(getKotlinRuntimeLibEditor(DEFAULT_JAVA_RUNTIME_LIB_NAME, PathUtil.kotlinPathsForDistDirectory.stdlibPath), module)
addLibrary(getKotlinRuntimeLibEditor(DEFAULT_KOTLIN_TEST_LIB_NAME, PathUtil.kotlinPathsForDistDirectory.kotlinTestPath), module)
}
@JvmStatic
fun unConfigureKotlinRuntime(module: Module) {
removeLibrary(module, DEFAULT_JAVA_RUNTIME_LIB_NAME)
removeLibrary(module, DEFAULT_KOTLIN_TEST_LIB_NAME)
}
@JvmStatic
fun unConfigureKotlinRuntimeAndSdk(module: Module, sdk: Sdk) {
configureSdk(module, sdk)
unConfigureKotlinRuntime(module)
}
@JvmStatic
fun unConfigureKotlinJsRuntimeAndSdk(module: Module, sdk: Sdk) {
configureSdk(module, sdk)
removeLibrary(module, DEFAULT_KOTLIN_JS_STDLIB_NAME)
@@ -194,6 +200,7 @@ object ConfigLibraryUtil {
configureLibraries(module, rootPath, InTextDirectivesUtils.findListWithPrefixes(fileText, "// CONFIGURE_LIBRARY: "))
}
@JvmStatic
fun unconfigureLibrariesByDirective(module: Module, fileText: String) {
val libraryNames = ArrayList<String>()
for (libInfo in InTextDirectivesUtils.findListWithPrefixes(fileText, "// CONFIGURE_LIBRARY: ")) {

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.idea.test
import com.intellij.codeInsight.CodeInsightTestCase
import com.intellij.codeInsight.daemon.impl.EditorTracker
import com.intellij.ide.startup.impl.StartupManagerImpl
import com.intellij.openapi.actionSystem.ActionPlaces
@@ -56,8 +55,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix
protected val module: Module get() = myFixture.module
protected open val captureExceptions = true
override fun setUp() {
super.setUp()
(StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivities()
@@ -70,15 +67,12 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix
invalidateLibraryCache(project)
if (captureExceptions) {
LoggedErrorProcessor.setNewInstance(object : LoggedErrorProcessor() {
override fun processError(message: String?, t: Throwable?, details: Array<out String>?, logger: Logger) {
exceptions.addIfNotNull(t)
super.processError(message, t, details, logger)
}
})
}
CodeInsightTestCase.fixTemplates()
LoggedErrorProcessor.setNewInstance(object : LoggedErrorProcessor() {
override fun processError(message: String?, t: Throwable?, details: Array<out String>?, logger: Logger) {
exceptions.addIfNotNull(t)
super.processError(message, t, details, logger)
}
})
}
override fun tearDown() {
@@ -128,9 +122,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_KOTLIN_TEST")) {
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_WITH_KOTLIN_TEST
}
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_FULL_JDK")) {
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_FULL_JDK
}
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME") ||
InTextDirectivesUtils.isDirectiveDefined(fileText, "WITH_RUNTIME")) {
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE

View File

@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.idea.test
/*
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.testFramework.EditorTestUtil
import com.intellij.testFramework.LightProjectDescriptor
@@ -23,6 +24,7 @@ import com.intellij.testFramework.VfsTestUtil
import org.intellij.lang.annotations.Language
import org.jetbrains.kotlin.idea.test.KotlinMultiModuleJava9ProjectDescriptor.ModuleDescriptor
abstract class KotlinLightJava9ModulesCodeInsightFixtureTestCase : KotlinLightCodeInsightFixtureTestCase() {
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinMultiModuleJava9ProjectDescriptor
@@ -47,10 +49,12 @@ abstract class KotlinLightJava9ModulesCodeInsightFixtureTestCase : KotlinLightCo
myFixture.checkResult("module-info.java", text.toTestData(), false)
}
private const val IDENTIFIER_CARET = "CARET"
private const val COMMENT_CARET_CHAR = "/*|*/"
private const val COMMENT_CARET = "/*CARET*/"
private val ADDITIONAL_CARET_MARKERS = arrayOf(IDENTIFIER_CARET, COMMENT_CARET_CHAR, COMMENT_CARET)
private fun String.toTestData(): String =
ADDITIONAL_CARET_MARKERS.fold(trimIndent()) { result, marker -> result.replace(marker, EditorTestUtil.CARET_TAG, ignoreCase = true) }
ADDITIONAL_CARET_MARKERS.fold(trimIndent()) { result, marker -> result.replace(marker, EditorTestUtil.CARET_TAG, ignoreCase = true) }
*/

View File

@@ -15,6 +15,7 @@
*/
package org.jetbrains.kotlin.idea.test
/*
import com.intellij.openapi.application.runWriteAction
import com.intellij.openapi.module.Module
@@ -31,10 +32,12 @@ import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor
import org.jetbrains.jps.model.java.JavaSourceRootType
import org.jetbrains.kotlin.test.TestJdkKind
*/
/**
* Dependencies: 'main' -> 'm2', 'main' -> 'm4', 'main' -> 'm5', 'main' -> 'm6' => 'm7'
*/
object KotlinMultiModuleJava9ProjectDescriptor : DefaultLightProjectDescriptor() {
/*
object KotlinMultiModuleJava9ProjectDescriptor : DefaultLightProjectDescriptor() {
enum class ModuleDescriptor(internal val moduleName: String, internal val rootName: String) {
// Dependent for: none, Depends on: M2, M4, M5, M6
MAIN(TEST_MODULE_NAME, "/not_used/"),
@@ -115,4 +118,5 @@ object KotlinMultiModuleJava9ProjectDescriptor : DefaultLightProjectDescriptor()
.plus(ModuleDescriptor.MAIN.testRoot()!!.children.asSequence())
.forEach { it.delete(this) }
}
}
}
*/

View File

@@ -2,6 +2,9 @@
<extensions defaultExtensionNs="com.intellij">
<externalAnnotator language="kotlin" implementationClass="org.jetbrains.android.inspections.klint.AndroidLintExternalAnnotator"/>
<projectService serviceInterface="org.jetbrains.uast.UastContext"
serviceImplementation="org.jetbrains.uast.UastContext"/>
<globalInspection language="kotlin" hasStaticDescription="true" shortName="AndroidKLintAddJavascriptInterface" displayName="addJavascriptInterface Called" groupKey="android.klint.inspections.group.name" bundle="org.jetbrains.kotlin.idea.KotlinBundle" enabledByDefault="true" level="WARNING" implementationClass="org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintAddJavascriptInterfaceInspection"/>
<globalInspection language="kotlin" hasStaticDescription="true" shortName="AndroidKLintAllowAllHostnameVerifier" displayName="Insecure HostnameVerifier" groupKey="android.klint.inspections.group.name" bundle="org.jetbrains.kotlin.idea.KotlinBundle" enabledByDefault="true" level="WARNING" implementationClass="org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintAllowAllHostnameVerifierInspection"/>
<globalInspection language="kotlin" hasStaticDescription="true" shortName="AndroidKLintAlwaysShowAction" displayName="Usage of showAsAction=always" groupKey="android.klint.inspections.group.name" bundle="org.jetbrains.kotlin.idea.KotlinBundle" enabledByDefault="true" level="WARNING" implementationClass="org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintAlwaysShowActionInspection"/>
@@ -115,4 +118,14 @@
<codeInspection.InspectionExtension implementation="org.jetbrains.android.inspections.klint.AndroidInspectionExtensionsFactory"/>
</extensions>
<extensionPoints>
<extensionPoint qualifiedName="org.jetbrains.uast.uastLanguagePlugin"
interface="org.jetbrains.uast.UastLanguagePlugin"/>
</extensionPoints>
<extensions defaultExtensionNs="org.jetbrains.uast">
<uastLanguagePlugin implementation="org.jetbrains.uast.kotlin.KotlinUastLanguagePlugin"/>
<uastLanguagePlugin implementation="org.jetbrains.uast.java.JavaUastLanguagePlugin"/>
</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="172.1" until-build="173.*"/>
<idea-version since-build="163.1" until-build="170.*"/>
<depends>com.intellij.modules.java</depends>
@@ -424,10 +424,6 @@
id="kotlin.moveTopLevelDeclarations"
implementation="org.jetbrains.kotlin.idea.refactoring.move.moveDeclarations.MoveKotlinDeclarationsHandler"
order="first,before kotlin.moveFilesOrDirectories"/>
<refactoring.moveHandler
id="kotlinAwareJavaMoveClassesOrPackagesHandler"
implementation="org.jetbrains.kotlin.idea.refactoring.move.moveClassesOrPackages.KotlinAwareJavaMoveClassesOrPackagesHandler"
order="first" />
<moveFileHandler implementation="org.jetbrains.kotlin.idea.refactoring.move.moveFilesOrDirectories.MoveKotlinFileHandler" />
<moveFileHandler
implementation="org.jetbrains.kotlin.idea.refactoring.move.moveFilesOrDirectories.FqNameFixingMoveJavaFileHandler"
@@ -474,7 +470,6 @@
<codeInsight.parameterInfo language="kotlin" implementationClass="org.jetbrains.kotlin.idea.parameterInfo.KotlinArrayAccessParameterInfoHandler"/>
<codeInsight.parameterInfo language="kotlin" implementationClass="org.jetbrains.kotlin.idea.parameterInfo.KotlinClassTypeArgumentInfoHandler"/>
<codeInsight.parameterInfo language="kotlin" implementationClass="org.jetbrains.kotlin.idea.parameterInfo.KotlinFunctionTypeArgumentInfoHandler"/>
<codeInsight.parameterNameHints language="kotlin" implementationClass="org.jetbrains.kotlin.idea.parameterInfo.KotlinInlayParameterHintsProvider"/>
<codeInsight.gotoSuper language="kotlin" implementationClass="org.jetbrains.kotlin.idea.codeInsight.GotoSuperActionHandler"/>
@@ -2647,18 +2642,12 @@
<resolveScopeProvider implementation="org.jetbrains.kotlin.idea.core.script.dependencies.KotlinScriptResolveScopeProvider"/>
<resolveScopeProvider implementation="org.jetbrains.kotlin.idea.core.script.dependencies.ScriptDependenciesResolveScopeProvider"/>
<codeInsight.intention.jvmCommonIntentionActionsFactory language="kotlin" implementationClass="org.jetbrains.kotlin.idea.intentions.KotlinCommonIntentionActionsFactory"/>
<moduleBuilder builderClass="org.jetbrains.kotlin.gradle.kdsl.GradleModuleBuilder" />
<projectService serviceInterface="org.jetbrains.uast.kotlin.KotlinUastBindingContextProviderService"
serviceImplementation="org.jetbrains.uast.kotlin.internal.IdeaKotlinUastBindingContextProviderService"/>
</extensions>
<extensions defaultExtensionNs="org.jetbrains.uast">
<uastLanguagePlugin implementation="org.jetbrains.uast.kotlin.KotlinUastLanguagePlugin"/>
</extensions>
<xi:include href="tipsAndTricks.xml" xpointer="xpointer(/idea-plugin/*)"/>
<xi:include href="extensions/ide.xml" xpointer="xpointer(/idea-plugin/*)"/>

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