Commit Graph

38989 Commits

Author SHA1 Message Date
Mikhail Glukhikh a77390ccd6 Change both IfThenTo... inspections highlight level
Retain WEAK WARNING for null checks, one-liners,
and is checks without dot calls in main branch.
Set INFORMATION (no highlighting, just fix) for other cases.

Switch off both bound intentions.
So #KT-15076 Fixed
2017-05-11 20:46:51 +03:00
Mikhail Glukhikh 2d9a5afb15 Refactoring: convert problemHighlightType to function with parameter 2017-05-11 20:46:37 +03:00
Mikhail Glukhikh d9a33af61e Reduce range of IfThenTo... inspections to just 'if' 2017-05-11 20:46:31 +03:00
Mikhail Glukhikh 781a45c747 Minor refactoring: IfThenToSelectData.clausesReplaceableByElvis 2017-05-11 20:46:24 +03:00
Mikhail Glukhikh f3ee5ea45f IfThenToDoubleBang: fix AWT from writeAction problem 2017-05-11 20:46:17 +03:00
Mikhail Glukhikh 66c5717adc Refactoring of IfThen: ToDoubleBang / ToElvis / ToSafeAccess
Some common actions were extracted to IfThenUtils.kt
Use consistent logic in all three intentions
Also fixes potential PSI consistency problems in conversions dot->safe calls
2017-05-11 20:46:11 +03:00
Dmitry Neverov fd6d1520c7 Convert 'if' with 'is' check to 'as?' with safe call #KT-17054 Fixed 2017-05-11 20:46:05 +03:00
Mikhail Glukhikh 0361ed8c68 Refactoring: SelfTargetingIntention / IntentionBasedInspection
Remove complex logic which disables intention when bound inspection on
Add much simpler logic in SelfTargetingIntention.equals
2017-05-11 20:45:59 +03:00
Alexey Andreev 1900b20e6e Implement inlining of Array constructor in JS BE
See KT-15456
2017-05-11 17:10:45 +03:00
Mikhail Glukhikh 6523f237a6 Test fix (I hope so) from parameter info group 2017-05-11 16:38:51 +03:00
Mikhael Bogdanov 97bcf9f538 Add default lambda inlining prototype 2017-05-11 11:06:47 +02:00
Mikhael Bogdanov b7af4ac882 Add SKIP_INLINE_CHECK_IN directive to inline test framework 2017-05-11 11:06:47 +02:00
Mikhael Bogdanov daf6768181 Add proper DefaultLambda initialization,
patch lambda related instructions in default method

Remove default lambda linked instructions from default method
2017-05-11 11:06:46 +02:00
Mikhael Bogdanov ec066a06d8 Clean code after convertion to Kotlin 2017-05-11 11:06:45 +02:00
Mikhael Bogdanov 1e9ffe42b1 Convert MethodInliner.java to Kotlin 2017-05-11 11:06:44 +02:00
Mikhael Bogdanov e34f934aba Rename MethodInliner.java to MethodInliner.kt 2017-05-11 11:06:44 +02:00
Mikhael Bogdanov f915192827 Minor. Clean and refactoring after convertion 2017-05-11 11:06:43 +02:00
Mikhael Bogdanov 3fe152aad3 Convert AnonymousObjectTransformer.java to Kotlin 2017-05-11 11:06:42 +02:00
Mikhael Bogdanov 36c43b630e Rename AnonymousObjectTransformer.java to AnonymousObjectTransformer.kt 2017-05-11 11:06:41 +02:00
Mikhael Bogdanov 980414674a Add default lambda parsing 2017-05-11 11:06:40 +02:00
Mikhael Bogdanov 70e550e984 Introduce ExpressionLambda and DefaultLambda abstractions,
extract common part to LambdaInfo
2017-05-11 11:06:40 +02:00
Mikhael Bogdanov 9c51392aff Convert LambdaInfo.java to Kotlin 2017-05-11 11:06:39 +02:00
Mikhael Bogdanov f8f4fc5de1 Rename LambdaInfo.java to LambdaInfo.kt 2017-05-11 11:06:38 +02:00
Sergey Igushkin 7097246866 Unify build output with Maven
* Added manifest properties to `gradle-tools` projects.
* Add `-kotlin-module` to free compiler args to make the module names
  match the ones in Maven build
* Fixed path to the Groovy sources in `kotlin-gradle-plugin/pom.xml`
2017-05-10 20:15:08 +03:00
Sergey Igushkin 7030b89b7c Fix rootDir mis-use in commonConfiguration.gradle:
replace with `kotlin_root`, that is set in the projects
2017-05-10 20:03:26 +03:00
Sergey Igushkin c3ae37c6ce Gradle build fixes & improvements:
* Fix Java not compiled in kotlin-gradle-plugin Kotlin source set
* Fix the integration tests running under Java 6
* Fix kotlin-gradle-subplugin-example not being installed -- needed
  for a test
* Fix Android tests being always excluded
* Move versions out of `build.gradle` (x2) to a common `versions.gradle`
* Move JDK, dist and bootstrap to `commonConfiguration.gradle`
* Build `kotlin-gradle-plugin` with JDK_18
2017-05-10 20:03:26 +03:00
Sergey Igushkin 8e65b5f2c8 Gradle plugins migration to Gradle build
* Add gradle-tools subproject
* Add Gradle buildscripts to the related projects
* Remove the projects from the libraries pom.xml
* Move AndroidGradleWrapper.groovy to separate source root
* Changed artifact dependencies to project dependencies where needed
* Extract common configuration into commonConfiguration.gradle
* (convert functions to closures to be able to call them)
* Refactor DSL usage
* Replace `project.properties` with `findProperty`
* Unify Gradle wrapper between `libraries` and `gradle-tools`
(as a temporary solution, just made the wrapper files the same)
2017-05-10 20:03:26 +03:00
Anton Bannykh 503891846f Updated some tests to expect the new '-Xfoo=bar' advanced options syntax 2017-05-10 19:32:52 +03:00
Mikhail Glukhikh f0543439f4 Use InfixCallToOrdinaryIntention directly for INFIX_MODIFIER_REQUIRED
So #KT-10211 Fixed
2017-05-10 17:43:46 +03:00
Mikhail Glukhikh 967c01f0ba Override 'equals' in SelfTargetingIntention
This prevents suggestion of duplicating intentions
2017-05-10 17:43:45 +03:00
Kirill Rakhman a8b2d3b4e8 Add inspection to detect copy() calls in a data class without named arguments
So #KT-17660 Fixed
2017-05-10 17:43:44 +03:00
Alexey Andreev 2c10f253c5 Fix node.js tests on Windows agents in Teamcity 2017-05-10 16:46:49 +03:00
Dmitry Neverov 3002639fd7 Take control flow into account for checking fall-through switch branches
#KT-16133 Fixed
2017-05-10 15:57:21 +03:00
Dmitry Neverov 31478f8efa Detect escaped backslashes
#KT-15761 Fixed
2017-05-10 15:51:18 +03:00
Dmitry Jemerov 9c4f897d31 Index properties defined in primary constructor
#KT-15029 Fixed
2017-05-10 14:27:28 +02:00
Dmitry Jemerov ec53a6dbe7 Return non-default lexer state for unmatched backtick
When a document is changed, the editor highlighter restarts the lexer
at the last point where it was in the default state. Previously, if
a matching backtick was deleted and then reinserted, the lexer was
resumed just before the reinsertion point, and as the result the two
backticks were parsed not as two delimiters of a single token but as
two BAD_CHARACTER tokens. With this change, all tokens after the
unmatched backtick will be in a non-default state, so the lexer will
restart at the first backtick and will correctly see the two backticks
as a single token.

 #KT-9091 Fixed
2017-05-10 14:27:27 +02:00
Dmitry Jemerov 66877c138d Correctly handle editor selection in "Show expression type"
To avoid showing a large list, the previous logic returned only the
element directly at caret and other elements with the same start
offset. When selection is present, the platform logic looks only at
elements which have a larger range than the selection, so our elements
could be completely filtered out. Now we look at the selection
ourselves and adjust the returned elements accordingly.

 #KT-16423 Fixed
2017-05-10 14:27:26 +02:00
Dmitry Jemerov c3c0bcb1be Better caret position for new Kotlin file/class
#KT-15255 Fixed
2017-05-10 14:27:26 +02:00
Dmitry Jemerov d1893cfa5f Don't highlight entire complex callee expression as call
If an expression returns something that has invoke() defined on it,
this entire expression can act as a callee. If we highlight it, this
will suppress more useful highlighting such as string literals.

 #KT-16159 Fixed
2017-05-10 14:27:25 +02:00
Dmitry Jemerov 5d9307024a Hide Kotlin live template macros from non-Kotlin contexts
#KT-16635 Fixed
2017-05-10 14:27:24 +02:00
Dmitry Jemerov c778e0454d Show line markers for suspending iteration
#KT-16803 Fixed
2017-05-10 14:27:23 +02:00
Dmitry Jemerov baa43a2a55 Show line markers for sealed classes
#KT-16755 Fixed
2017-05-10 14:27:22 +02:00
Dmitry Jemerov f64aaed205 Allow updating of fold region for imports when it's collapsed
#KT-12856 Fixed
2017-05-10 14:26:15 +02:00
Dmitry Jemerov 66ce2a6998 Render anonymous objects in Show Expression Type
#KT-17304 Fixed
2017-05-10 14:25:03 +02:00
Dmitry Jemerov 06a1d362d1 Pass Editor to StructureViewModel (required for autoscroll from source)
#KT-17439 Fixed
2017-05-10 14:25:02 +02:00
Dmitry Jemerov b33c544fdf Enable rainbow highlighting for destructuring declaration entries
#KT-17652 Fixed
2017-05-10 14:25:02 +02:00
Mikhail Glukhikh 382bf9a500 ConvertReferenceToLambda status refactoring
Intention is not registered now; inspection is enabled by default now,
 but has highlight level of "No highlighting"
2017-05-10 14:56:38 +03:00
Mikhail Glukhikh 759e6643c6 ConvertLambdaToReference refactoring
Intention is not registered now; inspection is enabled by default now,
 but has highlight level of "No highlighting"
Inspection does not depend on text length now

So #KT-14335 Fixed
2017-05-10 14:56:37 +03:00
Mikhail Glukhikh 1d722e01f0 Get rid of local version of RemoveModifierFix 2017-05-10 14:56:36 +03:00
Mikhail Glukhikh 02345670b2 Get rid of local version of AddModifierFix 2017-05-10 14:56:35 +03:00