Commit Graph

7725 Commits

Author SHA1 Message Date
Andrey Uskov c0bf5a6566 Import of middle HMPP target platforms is supported 2019-06-13 18:30:01 +03:00
Yan Zhulanow 12861595f5 MPP: Attach all classes/resources directories to the runtime classpath (KT-30710) 2019-06-13 17:33:24 +09:00
Yan Zhulanow bc0f10449a Kapt: Fix source root importing in MPP projects 2019-06-13 17:33:24 +09:00
Dmitry Savvinov 8df759b05c [Expect/Actual] Adjust IdeaModuleStructureOracle to old IDE Resolve
The main issue is that we have CombinedModuleInfo in old IDE Resolve,
which essentially merges platfor-modules together with its
dependsOn-parents. It conceals real module structure, which is fine for
practically all clients except for ExpectedActualDeclarationChecker.

In particular, it is nearly impossible to check expect/actual via
ModuleDescriptors, because you'll always get one and the same
'merged'-module descriptor.

So, this commit rewrites IdeaModuleStructureOracle in the following way:
- use ModuleInfos instead of ModuleDescriptor, as they allow more
fine-grained way to work with modules
- use 'unwrapModuleSourceInfo' in seemingly random places in order to
get real, non-merged moduleInfos
- carefully convert them back to ModuleDescriptors, because EADC work
with descriptors

This is still not an ideal solution. In particular, last step is flawed:
conversion back to ModuleDescriptors will always return merged
moduleDescriptor for platform-modules. There's no easy way to fix that
except for removing CombinedModuleInfo altogether, so we leave it as
known issue.

Also, there are some weird changes in testdata (again, because sometimes
we see several modules merged together), but they are mostly confusing
rather than plain incorrect.
2019-06-10 13:34:28 +03:00
Dmitry Savvinov 54b8f9da28 [Expect/Actual] Add testdata on hierarchical expect/actual matching 2019-06-10 13:34:27 +03:00
Dmitry Savvinov cac326bf4a [Expect/Actual] Adjust old testdata after changes in expect/actual
matching

This commit makes several changes in testdata:

- compiler multiplatform tests now contain newly introduced diagnostics
about AMBIGIOUTS_ACTUALS
- MultiModuleHighlighitng tests now contain proper reports about
ACTUAL_MISSING:
  - ACTUAL_MISSING should be indeed reported in them, because those
  tests don't contain dependsOn edges, only usual intermodule
  dependencies
  - This error wasn't reported here because expect/actual diagnostics in
  common module used to be reported by PlatformExpectedAnnotator, which
  had a bit flawed logic for deremining common-modules: it checked for
  presence of implementing modules. In those tests, common module has no
  implementing modules, so Annotator was returning silently
  Note that such configurations (common module without implementing
  modules) are almost impossible in real-life projects
  - After removal of PlatformExpectedAnnotator, we use
  ExpectedActualDeclarationChecker in common modules, which launches all
  checks properly
- some QuickFixMultuModuleTests now contain proper reports about
ACTUAL_MISSING. This change is also connected with
PlatformExpectedAnnotator, but now for different reason:
  - QuickFixMultiModuleTest used to check for errors in file by running
  'analyzeWithAllCompilerChecks' and inspecting returned BindingTrace.
  For common modules, there were no diagnostics about expect/actuals in
  that trace, because there were no ExpectedActualDeclarationChecker
  (and PlatformExpectedAnnotator was reporting diagnostics in ad hoc
  trace).
  - Again, now we inject EADC in common modules properly, so we see
  those errors in trace and report them in test
2019-06-10 13:34:27 +03:00
Dmitry Savvinov de2944ff43 [Misc] Fix errors checking in QuickFixMultiModuleTest
This test was checking errors *before* applying action, rather than
*after*, like all other QuickFix-tests do. This commit moves
errors-check after performing quick-fix action, and changes testdata:

- for most tests errors are simply gone (as quickfix usually fixes that
error)
- also, for implementMembersInActualClassNoExpectMember we add
'DISABLE-ERROR', similarly to
implementMembersInImplClassNonImplInheritor. This is needed because
'Implement Members'-fix created 'TODO'-calls, which are not resolved in
those tests due to the lack of stdlib. Previously, there were no errors
in this test exactly because file was checked *before* applying quickfix
(i.e. when there were no 'TODO()' in file)
2019-06-10 13:34:27 +03:00
Alexander Podkhalyuzin ea86ebf995 Do not expect that KDoc reference contains importable fqName
#KT-31768 Fixed
2019-06-07 15:25:15 +03:00
Dmitry Gridin f48640f91c Fix test for UnsafeCastFromDynamicInspection 2019-06-07 12:23:55 +07:00
Dmitry Gridin 8eb11d9d3d Fix some tests 2019-06-07 12:23:54 +07:00
Dmitry Gridin 1ad7a50087 IfThenToElvis & FoldInitializerAndIfToElvis should add new line for long expression
Relates to #KT-19643 #KT-16067
2019-06-07 12:23:54 +07:00
Dmitry Gridin 984c781588 FoldInitializerAndIfToElvisInspection: decrease severity level to INFORMATION for is
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin b3fe830b6e Fix false positive "Foldable if-then" with Result type
#KT-27074 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin f2accb7b9e Convert IfThenToElvisIntention to inspection & decrease severity to INFO
#KT-16067 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin 74c177fd26 Convert FoldInitializerAndIfToElvisIntention to inspection and decrease severity to INFO
#KT-19643 Fixed
2019-06-07 12:23:54 +07:00
Dmitry Gridin 8b0b135112 Add new line after modifier list if last child is comment
#KT-30804 Fixed
2019-06-07 12:23:06 +07:00
Ilya Chernikov e542c9ea84 Refactor script definitions and resolving/refining infrastructure:
- implement wrappers to wrap old and new API providers and resolvers
- make old API deprecated (with error where possible)
- drop old internal classes related to the old API
- refactor usages accordingly
- fix and add missing features to the scripting API where necessary
2019-06-06 17:21:00 +02:00
Toshiaki Kameyama 1c32941949 Use property access syntax: don't report when setter argument is lambda
#KT-30627 Fixed
2019-06-06 18:53:15 +07:00
Dmitry Gridin afa9a80b3a Fix multi module tests for AddOperatorModifierInspection 2019-06-06 12:09:28 +07:00
Toshiaki Kameyama 4c62788c3e Make "Add operator modifier" an inspection instead of intention
#KT-31533 Fixed
2019-06-05 19:27:52 +07:00
Yan Zhulanow bc6f01805e Fix JVM test running in MPP projects (KT-30814) 2019-06-04 17:56:05 +09:00
Mikhail Zarechenskiy 6d3a7102d5 Fix evaluation of local functions for new-inference
Plus, additionally fix evaluation of generic local functions everywhere

 The problem was that in new-inference we create more substituted
 descriptors while old inference tries to preserve original ones.
 Later, backend fails to retrieve those descriptors as it uses originals.
 But, again, this worked only for simple functions, for generic functions
 debugger with new and old inference worked incorrectly

 #KT-31785 Fixed
2019-06-04 11:07:50 +03:00
Dmitry Gridin 7bc2fcd657 Convert RemoveCurlyBracesFromTemplateIntention to inspection
Relates to #KT-31717
2019-06-03 16:37:37 +07:00
Dmitry Savvinov 8caafa874e Advance Kotlin versions in some Gradle Tests
Those versions have been resolved from -dev repository, which got
cleared and those tests started to fail.

In long term, it would be nice to not use fixed Kotlin versions in
tests, but for now we just advance it to prevent tests from failing.
2019-06-03 08:17:25 +03:00
Dmitry Gridin 21c10af1a7 Fix tests in quickfix 2019-05-31 18:00:56 +07:00
Dmitry Gridin 605ee041a9 Remove CreateTypeAliasFromUsageFix
Relates to #KT-31519
2019-05-31 18:00:56 +07:00
Ilya Kirillov 8fa9b9923f Allow removing trivial property accessor body when the accessor can not be fully deleted in redundant getter/setter inspections 2019-05-31 00:25:52 +03:00
Yan Zhulanow b48e0a89c5 Debugger: Hide synthetic '$completion' variable in Kotlin variables mode 2019-05-30 15:27:11 +09:00
Yan Zhulanow bfb1d53ddf Debugger: Run control flow on code fragments (KT-30120) 2019-05-30 15:27:11 +09:00
Yan Zhulanow 35c63db9bc Debugger: Support coroutineContext for suspend functions without suspend calls (KT-24829) 2019-05-30 15:27:11 +09:00
Yan Zhulanow 999d5ce3bb Debugger: Fix VariableAsFunctionResolvedCall evaluation 2019-05-30 15:27:10 +09:00
Yan Zhulanow 0a6a811c57 Debugger: Fix lvalue evaluation (KT-11663, KT-19980) 2019-05-30 15:27:10 +09:00
Yan Zhulanow bb0bc8a38a Debugger: Fix toTypedArray() evaluation (KT-8579) 2019-05-30 15:27:09 +09:00
Yan Zhulanow 9ae8a8abf1 Debugger: Fix method evaluation on arrays (KT-11706) 2019-05-30 15:27:09 +09:00
Yan Zhulanow 38dba20e24 Debugger: Allow super calls (KT-20560) 2019-05-30 15:27:09 +09:00
Yan Zhulanow cbbb3c35da Debugger: Fix evaluation for local extension functions (KT-13188) 2019-05-30 15:27:09 +09:00
Yan Zhulanow ee0daae2ab Debugger: Support synchronized blocks and functions in evaluator (KT-11888) 2019-05-30 15:27:08 +09:00
Yan Zhulanow 55bbcc4601 Generate line numbers for closing '}' in 'init {}' blocks (KT-12787) 2019-05-30 15:27:08 +09:00
Yan Zhulanow a385b4d9d0 Debugger: Fix evaluation on value parameter name position (KT-30976) 2019-05-30 15:27:08 +09:00
Yan Zhulanow 577b3e096f Debugger: Fix test (lines were changed because of the updated copyright) 2019-05-30 15:27:08 +09:00
Yan Zhulanow ae7550c5af Move out JVM debugger functionality 2019-05-30 15:27:07 +09:00
Toshiaki Kameyama 65f06454be Add "Control flow with empty body" inspection
#KT-30970 Fixed
2019-05-29 18:04:24 +07:00
Dmitry Gridin 1c4fb9b00b ConstantConditionIfInspection.replaceWithBranch shouldn't remove subjectVariable with side effects
Relates to #KT-30975
2019-05-29 15:40:10 +07:00
Dmitry Gridin e2d5e9a184 Only when keyword should be highlighted in WhenWithOnlyElseInspection
#KT-31673 Fixed
2019-05-29 15:40:10 +07:00
Toshiaki Kameyama e955dcfc14 WhenWithOnlyElse: don't remove when subject variable if needed
#KT-30975 Fixed
2019-05-29 15:40:10 +07:00
Dmitry Gridin f5796a303d Fix tests
Relates to #KT-30622
2019-05-29 11:00:28 +07:00
Dmitry Gridin 8988b4b344 Convert ReplaceSubstringIntention to ReplaceSubstringInspection
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin 2310826ec9 Remove MergeWhenIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin 41daf99346 Remove IfThenToDoubleBangIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00
Dmitry Gridin afcb2f3436 Remove ConvertIfWithThrowToAssertIntention
Relates to #KT-31502
2019-05-29 11:00:28 +07:00