Commit Graph

7896 Commits

Author SHA1 Message Date
Dmitry Gridin d0c02a1a34 PackageDirectoryMismatchInspection: fix exception from empty script file
#KT-33437 Fixed
2019-09-03 16:20:40 +07:00
Dmitriy Novozhilov 5b118b65fc [FIR] Tests. Update testdata broken in 9508fc60 2019-09-02 11:13:27 +03:00
Dmitriy Novozhilov 56ac1201b6 [FIR] Add abstract data flow analyzer with callbacks for body resolve transformer 2019-09-02 10:43:06 +03:00
Nikolay Krasko 4d0fc1dc22 Remove 182 support
#KT-33536 Fixed
2019-08-30 12:13:44 +03:00
Toshiaki Kameyama 0ec18b4a33 Explicit this inspection: fix false negative with local variable
#KT-30136 Fixed
2019-08-30 12:07:13 +03:00
Mikhail Glukhikh f2c77c45e9 FIR: simplify rendering of dispatch & extension receivers 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh 62bb127fc9 FIR: add K/J test with getValue() / value fake cycle 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh b531e535b6 FIR call resolve: set values of dispatch & extension receivers 2019-08-30 11:47:31 +03:00
Dmitriy Novozhilov ef4ef08b1d [FIR] Add default upper bound for java type parameters 2019-08-30 11:10:31 +03:00
Igor Yakovlev 7b2f39530a Fix invalid testdata for ConvertToScopeIntention applicability 2019-08-28 16:31:49 +03:00
Dmitry Gridin b04fbbd43b Fix testUnusedSymbol_class_inspectionData_Inspections_test test 2019-08-28 19:11:42 +07:00
Igor Yakovlev 1e72116a9c Fix test data for intention tests
The ExtractDeclarationFromCurrentFileIntention applicability range was changed by commit 3b35c2d24 so the test data of several test comes invalid
2019-08-28 13:07:33 +03:00
Dmitry Gridin 55f4610926 Tests: fix invalidBundleOrProperty test for 183
#KT-32860 Fixed
2019-08-28 17:03:13 +07:00
Toshiaki Kameyama d4e4a4c3e7 To ordinary string literal: remove 'trimIndent()' if string is single line
#KT-32616 Fixed
2019-08-27 22:21:49 +03:00
Dmitry Gridin ea02d0c632 ExpectActualUtils: repairSuperTypeList should consider type parameters 2019-08-27 17:26:11 +07:00
Dmitry Gridin 56a7445660 CreateExpect: should prefer type aliases
#KT-32571 Fixed
2019-08-27 17:26:10 +07:00
Dmitry Gridin 5928a36fa2 CreateExpect: should save receiver annotations
#KT-32694 Fixed
2019-08-27 17:26:09 +07:00
Dmitry Gridin 1c98cb763e addRemoveModifier: shouldn't add extra new line
#KT-26635 Fixed
2019-08-27 17:26:09 +07:00
Dmitry Gridin 73ae993d81 TypeAccessibilityChecker: add more tests 2019-08-27 17:26:09 +07:00
Dmitry Gridin 3617f3d247 TypeAccessibilityChecker: fix callable with upper bound 2019-08-27 17:26:08 +07:00
Dmitry Gridin 18f0bbe8f1 QuickFixMultiModule: change tests structure 2019-08-27 17:26:08 +07:00
Dmitry Gridin bddf768d59 CreateExpect: fix case with parameters in constructor without var/val 2019-08-27 17:26:07 +07:00
Dmitry Gridin dffb44c11c Create actual/expect quick fix should render super type correctly 2019-08-27 17:22:15 +07:00
Toshiaki Kameyama a3c3ab08fd Override/Implement members: place members in the same order as super class members 2019-08-26 13:18:31 +07:00
Igor Yakovlev 5a511dd635 Refactor and fix of the run/apply/let/also intention converter
1) Optimize and refactored code
2) Added support for correct renaming of target identifier to this/it
3) Added support of cases with difficult application targets (like: var x = 1 + 2)
4) Show error hint when refactoring failed for some reason
5) Improved intention applicability checking to eliminate false-positive cases
6) Fixed EA-209577
2019-08-23 19:37:00 +03:00
Roman Golyshev e488e920d8 KT-32366: Add tests for right preview window
- also, fix missing test generation in `GenerateTests` bunch files (which was introduced in e54b43ba)
2019-08-23 18:22:26 +03:00
Toshiaki Kameyama 64d4cca589 Redundant override: do not report when class has derived property
#KT-32479 Fixed
2019-08-23 14:57:20 +07:00
Toshiaki Kameyama 729ed1a44e Pull Members Up: fix invalid code format on function with comment and another indent
#KT-32426 Fixed
2019-08-23 14:25:49 +07:00
Toshiaki Kameyama 7c2f6ecba7 Redundant curly braces in string template: remove braces for 'this'
#KT-32972 Fixed
2019-08-23 14:19:41 +07:00
Dereck Bridie 8f2a73b734 KT-28471: "Add initializer" quickfix initializes non-null variable with null 2019-08-23 14:15:08 +07:00
Toshiaki Kameyama c0f896c96a flatMap call could be simplified to flatten(): Fix false positive with Array
#KT-33204 Fixed
2019-08-23 14:12:17 +07:00
Dmitriy Novozhilov e6bf3b3263 [FIR] Render nullability in type renderer, not in fir renderer 2019-08-22 10:55:07 +03:00
Burak Eregar d1cbee44f1 Move refactoring: suggest file name starting with an uppercase letter
Fixed #KT-30342
2019-08-21 00:58:59 +03:00
Dmitry Gridin cf3b92d80e CreateTypeParameterFromUsageFix: fix KNPE for type alias
#KT-33302 Fixed
#EA-120181 Fixed
2019-08-20 17:04:00 +07:00
Roman Golyshev e915bc2a69 fix expected output for when statement in scratch files
- the behaviour changed due to KT-33127 fixing
2019-08-14 15:35:38 +03:00
Dmitry Savvinov 9290ec34db Provide proper platformSpecficContainer in CompositePlatformConfigurator
Now, call 'configureDefaultCheckers' and 'configureExtensionsAndCheckers'
from all childs configurators, instead of taking just container from
CommonPlatformAnalyzerServices

This is needed because some IDE services tend to re-create containers
(in particular, PerFileAnalysisCache and ResolveElementCache do that to
re-inject new trace) and use usual injection DSL, which, in particular,
takes 'platformSpecificContainer'.

Returning 'common'-conatiner leads to losing all platform-specific checkers.
On the other hand, calling exactly 'configureDefaultCheckers' +
'configureExtensionsAndCheckers' should be correct, because that's how
single-platform 'platformSpecificContainer' is composed (see
PlatformConfiguratorBase), and in 'createContainerForCompositePlatform'
we don't use 'platformSpecificContainer' anyways

^KT-23305 Fixed
2019-08-13 12:12:29 +03:00
Nicolay Mitropolsky 51e007116f KotlinLineMarkerProvider: ignore non-leaf elements when putting gutters (KT-28075, KT-30052, KT-33182)
previously for instance `KtClassBody` could get here as `leaf` and `leaf.parent` will return `KtClass` for it, making gutter for `KtClass` appear twice if origingal identifier and `KtClassBody` got here in different passes (one in "inner" other in "outer")
2019-08-08 16:38:47 +03:00
Toshiaki Kameyama f5c0a30c51 Add intention to replace "Map.getOrDefault"
#KT-21503 Fixed
2019-08-07 17:38:15 +03:00
Yan Zhulanow 0a092d6613 Debugger: Fix breakpoint firing in '$suspendImpl' (KT-27645) 2019-08-07 01:15:33 +09:00
Yan Zhulanow 52a958256d Debugger: Disable exception on 'variable not found' event (EA-138365)
The error message is still visible to the user, so it doesn't make much sense to duplicate it as an exception.
2019-08-07 01:15:30 +09:00
Yan Zhulanow d6487e89ad Debugger: Prohibit 'suspend fun' calls in evaluated expressions
Currently, it's impossible to call suspend functions in evaluated code fragments (see KT-31701).
This commit officially prohibits such calls, so users will see a semi-friendly error message.
2019-08-07 01:15:29 +09:00
Yan Zhulanow 3d3bde5483 Debugger: Do not ignore duplicated locations for line breakpoints 2019-08-07 01:15:28 +09:00
Yan Zhulanow 780c0518e5 Debugger: Disallow breakpoints for @InlineOnly function bodies (KT-32687, KT-24408)
Kotlin compiler strips all debug information for @InlineOnly functions, making them non-debuggable.
This commit disables breakpoints inside @InlineOnly functions to prevent false expectations.
2019-08-07 01:15:28 +09:00
Yan Zhulanow 25fb77e7ad Debugger: Add breakpoint applicability tests
This commit adds a number of tests that check breakpoint placing behavior, and an inline action that work the same way as tests.
2019-08-07 01:15:28 +09:00
Yan Zhulanow a8d08815a6 Simplify call: Fix false positive in "filter {}" detection (KT-32468)
"Simplify filter {}" conversion changes semantics when the casted type is not a subtype if an initial collection element type.
This commit limits a replacement suggestion to subtype cases.
2019-08-07 01:15:28 +09:00
Yan Zhulanow b1f132d750 Debugger: Add stepping tests for function breakpoints 2019-08-07 01:15:27 +09:00
Yan Zhulanow 129ca7f2d8 Debugger: Fix breakpoint applicability (KT-10984)
Ensure that breakpoints of each type can be placed only on lines where it makes sense to place a breakpoint.

Here is a quick summary of the rules:
1. Method breakpoints are available for functions, property accessors, constructors;
2. Line breakpoints are available on any line with an expression, excluding some cases like 'const' property initializers or annotations;
3. Line breakpoints should be available on a '}' in functions and lambdas;
4. Line breakpoints are not suggested for one-liners;
5. Lambda breakpoints should be shown for single-line lambdas.
2019-08-07 01:15:27 +09:00
Ilya Kirillov 02f2009f2a Do not show "Replace overloaded operator with function call" intention on incomplete expressions
#KT-33115 fixed
2019-08-05 15:14:27 +03:00
Toshiaki Kameyama 892135ae23 Unused symbol: don't report for enum entry when enum builtin function is used
#KT-31133 Fixed
2019-08-05 12:50:28 +03:00
Toshiaki Kameyama 776cccf57c FunctionWithLambdaExpressionBodyInspection: fix ClassCastException for "Remove braces" quick fix
#KT-32580 Fixed
2019-08-05 12:35:23 +03:00