Commit Graph

38954 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh bb76783654 Minor (import removed) 2017-05-10 14:56:33 +03:00
Alexey Sedunov f70bac019a Change Signature: Fix TypeInfo comparison
#KT-13437 Fixed
2017-05-10 14:49:53 +03:00
Alexey Sedunov 8bbf8e185a Move: Filter out usages with visibility error before refactoring
If declaration is already invisible before move,
no visibility conflict should be reported

 #KT-17571 Fixed
2017-05-10 14:49:52 +03:00
Alexey Sedunov 0a5f9d8181 Move: Specify conflict containing declaration more precisely
Also do not render class fqname for member declarations

 #KT-17547 Fixed
2017-05-10 14:49:51 +03:00
Mikhail Zarechenskiy fba52359ac Add tests for obsolete issues
#KT-13112 Obsolete
 #KT-14249 Obsolete
2017-05-10 13:52:26 +03:00
Mikhail Zarechenskiy 38eff6966d Lazy resolve: fix scope for primary constructor parameters
For classes on top level scope was getting for file, which may introduce resolution problems with generics

 #KT-8829 Fixed
2017-05-10 13:52:21 +03:00
Kirill Rakhman dbcf796e90 Add Smart Enter processor for object expessions (#1079)
Fixes #KT-17807
2017-05-10 11:49:08 +03:00
Dmitry Jemerov 4b811a3639 Fix tests 2017-05-09 11:50:31 +02:00
nd e20e097a63 Stricter type checks in 'convert to range' intention (#1073)
#KT-17079 #KT-17762 Fixed
2017-05-09 10:31:32 +03:00
Nadia Humbert-Labeaumaz e76f1acc0b Remove "Move to class body" intention for annotation parameters (#1076)
#KT-17708 Fixed
2017-05-09 10:27:37 +03:00
Dmitry Jemerov 80e17cbe9c Don't crash on non-jar files added to classpath
#KT-17698 Fixed
2017-05-09 09:18:07 +02:00
Yuli Fiterman 4393e2d518 KT-7848 -- unmerged changes (#1075)
* KT-7848 Initial implementation of literal copy/paste processor for Kotlin

* KT-7848: Tests

* KT-7848: fix issues caught in unit tests with recognizing invalid template entries

* KT-7848: check for KtFile

* KT-7848:  fix capitalization for test data file names

* KT-7848:  Initial changes according as per review

* KT-7848:  TemplateTokenSequence tests

* KT-7848:  fix off by one error caught in test

* KT-7848:  Reformat with keep empty lines in code -> 0
2017-05-08 18:50:41 +03:00
Yuli Fiterman 99b1bb98dc KT-7848: Literal copy/paste processor for Kotlin (#1074)
* KT-7848 Initial implementation of literal copy/paste processor for Kotlin

* KT-7847: Tests

* KT-7847: fix issues caught in unit tests with recognizing invalid template entries

* KT-7847: check for KtFile

* KT-7847:  fix capitalization for test data file names

* KT-7847:  Initial changes according as per review
2017-05-08 17:18:28 +03:00
Kirill Rakhman 8e00af5642 Add intention to convert top level val with object expression to object declaration (#974)
* Add intention to convert top level val with object expression to object
Fixes #KT-14137

* fix intention description
2017-05-08 16:35:03 +03:00
nd 93b5eec71e Convert to secondary constructor is not applicable to data classes (#1071)
#KT-15942 Fixed
2017-05-08 16:24:37 +03:00
nd c9f475b402 Detect redundant semicolon before empty import list (#1072)
#KT-16577 Fixed
2017-05-08 16:14:22 +03:00
xiexed b8942c5f04 Readme for ultimate project (#1070) 2017-05-08 15:55:30 +03:00
Ilya Chernikov 71a04f8cfc Fix script-related tests that aren't ready for roots changed optimizations
(cherry picked from commit ab52c55)
2017-05-08 00:20:37 +02:00
Ilya Chernikov ca331d2f55 Optimize scripting-related cache creation and update
reduce number of cases when changes are reported from script dependencies
  provider, that causing rootsChanged event, in particular empty dependencies
  are filtered out now

Should reduce IDEA startup delays.
2017-05-07 17:32:48 +02:00
Ilya Chernikov 07ad9aa08d Add logging with time measurement to script dependencies caching and caches updating 2017-05-07 17:32:47 +02:00
Ilya Chernikov 3f9aec31bd Optimize scripting-related files monitoring
filter vfs changes events to take only non-infrastructure files from actual
project
also drop unnecessary readAction during internal caches update

Should reduce IDEA startup delays.
2017-05-07 17:32:46 +02:00
Dmitry Jemerov 8337cd455f Fix reporting exception problems on Kotlin UAST fields (KT-17714) 2017-05-06 08:18:08 +02:00
shiraji 56d712a02a Introduce quick-fix adding label to 'return' in closures #KT-16851 Fixed 2017-05-05 23:27:10 +03:00
Ilya Gorbunov 2f7ab1c0c1 Inline some properties from kotlinManifest.properties that were used only once 2017-05-05 21:56:56 +03:00
Ilya Gorbunov 96c36fb317 Remove manifest.impl.value.kotlin.version and other unused properties from kotlinManifest.properties 2017-05-05 21:56:56 +03:00
Ilya Gorbunov 720e6ecdb6 kotlin.language.version property no longer used in maven build 2017-05-05 21:56:56 +03:00
Mikhail Zarechenskiy 3bfc17c2d4 Avoid redundant cache entries: move checks to the caller function 2017-05-05 21:30:39 +03:00
Mikhail Zarechenskiy adb8e60615 Fix resolve of last destructuring declaration in block
Last declaration in block is resolved in DEPENDENT mode because it has
 influence on return type and therefore fake call for destructuring declaration
 wasn't completed (see `getBlockReturnedTypeWithWritableScope`)

 Now we resolve fake call for destructuring declaration in INDEPENDENT
 mode as it doesn't have effect on return type

 #KT-15480 Fixed
2017-05-05 21:30:38 +03:00
Mikhail Zarechenskiy 7530a9426f Warn about val reassignment via backing field
#KT-16681 In Progress
2017-05-05 21:30:37 +03:00
Mikhail Zarechenskiy e821b25288 Resolve type alias SAM constructors in synthetic scope 2017-05-05 21:30:36 +03:00
Mikhail Zarechenskiy 7541a3754d Move SAM constructors to synthetic scope 2017-05-05 21:30:35 +03:00
Mikhail Zarechenskiy 429f0e4f68 Adapt changes in IDE after moving SAM adapters to synthetic scope
The main change is that now to get static sam adapters one should do it using synthetic scopes and static scope of container
2017-05-05 21:30:10 +03:00
Mikhail Zarechenskiy 8e233162ed Drop SamAdapterOverridabilityCondition as it became obsolete
There is no need in checking overridability of sam adapters as now we don't create fake synthesized methods for static sam adapters
2017-05-05 21:30:10 +03:00
Mikhail Zarechenskiy 95ede7fb67 Move SAM adapters from static scope to synthetic one 2017-05-05 21:30:10 +03:00
Alexey Tsvetkov 2ff28ebced Merge sequent filter and map calls into one loop
ScopeTowerProcessors.kt contains a few code snippets
that look like `collectCandidates(...).filter { ... }.map { ... }`.
Filter argument is always side-effect free, so it is safe
to merge `filter` and `map` calls into one for-loop.

The change also makes sense, because modified functions are quite hot.
For example `NoExplicitReceiverScopeTowerProcessor.simpleProcess`
produces 11,392,768 ArrayList instances (~1.08% of all objects)
when compiling the compiler according to aprof at the moment of writing.

On my machine the change improves compilation speed of the compiler up to 5%.
2017-05-05 20:02:04 +03:00