Commit Graph

149 Commits

Author SHA1 Message Date
Nikolay Krasko 046a0e059c Always add last version of idea for which change is needed to BUNCH
BUNCH directive should contain last idea IDEA version this change is
meant for.
2019-01-18 19:42:43 +03:00
Denis Zharkov 82537cdc8b Add recovery for missing comma between arguments
^KT-13497 Fixed
2019-01-17 14:58:01 +03:00
Denis Zharkov 65e6e21d0f Add recovery for import lists in the middle of the file
Note, that it only works for top-level declarations

^KT-7185 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov e6710b6fa2 Add recovery for value parameter without type or name
The case for KT-7237 belongs to /NoGTInTypeArguments test
It was fixed implicitly: before it recovery was working but the name for
the next parameter was attached to type argument list.
After that change, parameter without name gets parsed correctly (with an
error of course)

^KT-13731 Fixed
^KT-7237 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov 5437a0e478 Add recovery for enum declaration without 'class' keyword
^KT-13703 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov 1688fed0b7 Minor. Rename PropertyParsingMode -> DeclarationParsingMode 2019-01-17 14:56:42 +03:00
Denis Zharkov 8b3ffee183 Minor. Rename defaultDetected -> companionDetected 2019-01-17 14:56:42 +03:00
Denis Zharkov ee75b8c7e5 Minor. Extract KotlinParsing::parseCommonDeclaration 2019-01-17 14:56:42 +03:00
Ilya Chernikov 01f2a21192 [minor] add comment to the "Fix locking in script definition provider" commit 2019-01-10 10:59:32 +01:00
Mikhail Glukhikh 18ea86cfb4 Remove parentheses: add semicolon before lambda if necessary
In 2010b175, it was suggested just not to suggest parentheses removal.
However, it contradicts with behaviour of "Replace contains" which
adds semicolon before lambda in this case. So in this commit I made
behaviour of remove parentheses the same.

This commit reverts production part of 2010b175
Fixes failing test of "replace contains"
2019-01-10 10:45:46 +03:00
Toshiaki Kameyama 2010b1756e Remove unnecessary parentheses: don't suggest when parentheses are for lambda 2019-01-09 12:16:01 +03:00
Toshiaki Kameyama 05d8932fa6 Remove useless cast: don't remove parentheses for lambda
#KT-28641 Fixed
2019-01-09 12:16:01 +03:00
Nikolay Krasko 5a40fc8679 Add UI options for comments generation (KT-5590)
#KT-5590 Fixed
2018-12-26 21:10:03 +03:00
Nikolay Krasko 571ee4a1fe Don't ruin indentation for comments inside expression declarations (KT-23295)
#KT-23295 Fixed
2018-12-26 15:39:40 +03:00
Nikolay Krasko 3e55b6e9f5 Consider qualified name is null if some part is null (EA-126499) 2018-12-26 15:39:39 +03:00
Mikhail Glukhikh a9147ff446 More tests for KT-28997, fix isLocal for anonymous object in script 2018-12-26 12:53:25 +03:00
Natalia Selezneva 9dc57567e4 Kotlin code fragments in markdown should have script definition because they are parsed as scripts 2018-12-25 15:32:27 +03:00
Marcin Moskala 686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Ilya Chernikov 71729f8e8f [minor] use psi original file if virtual file is not available...
for script dependencies, fixes completion tests
2018-12-20 17:09:24 +01:00
Toshiaki Kameyama ea0f9d124d Split property declaration: don't add parentheses for anonymous function
#KT-7593 Fixed
2018-12-18 09:28:57 +03:00
Ilya Chernikov 0b9770f8d1 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:00:12 +01:00
Nikolay Krasko a5724293b0 Diagnostic null value in operations node (EA-126606) 2018-12-13 12:36:01 +03:00
Nikolay Krasko 1d3d86023e Log NPE from getting operation reference in binary expression (EA-129499) 2018-12-13 12:36:00 +03:00
Ilya Chernikov abc13589c8 Fix locking in script definition provider
fixes possible parallel modifications on definitions loading, e.g.
as in https://github.com/shyiko/ktlint/issues/287
2018-12-11 15:20:08 +01:00
Denis Zharkov 5992896d76 Relax assertion in parser for a recovery case with annotations
^KT-24937 Fixed
2018-12-11 09:45:14 +03:00
Vyacheslav Gerasimov d84c5b1608 Switch to 183 platform 2018-12-06 20:16:58 +03:00
Toshiaki Kameyama 9ee9965c7a Convrt anonymous function to lambda: fix incorrectly conversion
#KT-28618
2018-12-06 09:28:56 +03:00
Vyacheslav Gerasimov a112bebf78 Build: Configure cache-redirector in allprojects block 2018-12-04 15:38:56 +03:00
Toshiaki Kameyama d3908aeb2e Add "map.get() with not-null assertion operator" inspection #KT-25171 Fixed 2018-11-29 14:42:18 +03:00
Nikolay Krasko 2d1c76344c Store presence of spread operator for value argument in stubs 2018-11-15 18:55:56 +03:00
Aleksei Semin 793cac02e8 Add inspection and quick-fix to remove empty parentheses in annotation entries 2018-11-13 10:38:08 +03:00
Nicolay Mitropolsky 4a64edd610 KotlinStringLiteralTextEscaper: provides offsets for already decoded (KT-27380) 2018-11-13 10:01:52 +03:00
Nikolay Krasko 9dab32f67d Re-implement getBodyBlockExpression() in stubbed elements
Avoid delegation to getBodyExpression() to monitor AST loading abuses.
2018-11-12 13:38:29 +03:00
Nikolay Krasko 2284028bbe Add bodyBlockExpression() helper function to KtDeclarationWithBody 2018-11-12 13:38:28 +03:00
Nikolay Krasko 2b8a81c5a8 Don't force getting body psi if null is predicted by stubs but allow it for resolve
We can't avoid loading AST in general, because there're no stubs for
expression bodies.
2018-11-12 13:38:27 +03:00
Nikolay Krasko e2269e13af Move AstLoadingFilter to incompatible API and update usages 2018-11-12 13:38:26 +03:00
Nikolay Krasko 02d7e701d0 Allow getting initializer from psi during resolve as there're no stubs 2018-11-12 13:38:25 +03:00
Toshiaki Kameyama 9c18e24de5 Change to function invocation fix: use parentheses in string template
#KT-5071 Fixed
2018-11-08 10:33:50 +03:00
Toshiaki Kameyama 0fcd1a2072 Introduce "Delegate to 'var' property" inspection #KT-26724 Fixed 2018-11-07 13:59:00 +03:00
Nikolay Krasko 6dcc3374fe Get string entries from stubs (KT-23738) 2018-11-06 13:43:23 +03:00
Nikolay Krasko 359e16eb82 Get argument name from stubs if possible (KT-23738) 2018-11-06 13:43:22 +03:00
Nikolay Krasko 3f53f9d9fb Allow storing dot qualified expression in annotations arguments (KT-23738) 2018-11-06 13:43:21 +03:00
Nikolay Krasko a794d26493 Get stubbed expressions in value arguments (KT-23738) 2018-11-06 13:43:20 +03:00
Nikolay Krasko a9c3b27d3e Don't generate stub for value arguments list when no arguments present (KT-23738)
Need this to conform stubs list obtained by decompiler.
Also ignore green stub, because is might not contain actual psi node.
2018-11-06 13:43:19 +03:00
Nikolay Krasko efa59bfc7e Make stubs for string entries (KT-23738) 2018-11-06 13:43:17 +03:00
Nikolay Krasko 37d7e618da Stub element for KtStringTemplateExpression (KT-23738) 2018-11-06 13:43:16 +03:00
Nikolay Krasko 11543ba897 Make possible store constant values in stubs (KT-23738) 2018-11-06 13:43:15 +03:00
Nikolay Krasko d9bc512556 Put arguments name to stubs in annotations (KT-23738) 2018-11-06 13:43:14 +03:00
Nikolay Krasko 12f127d631 Add stub for annotations value arguments (KT-23738) 2018-11-06 13:43:13 +03:00
Nikolay Krasko fbb0e7d927 Stubbed VALUE_ARGUMENT_LIST and store it for annotations (KT-23738) 2018-11-06 13:43:12 +03:00