Commit Graph

140 Commits

Author SHA1 Message Date
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
Nikolay Krasko 0f0dfe725e Refactoring: move KtExpression.unpackFunctionLiteral to utils file 2018-11-06 13:43:10 +03:00
Nikolay Krasko 7c49eeded7 Make KtProperty.getInitializer() use stub check 2018-11-06 13:43:09 +03:00
Nikolay Krasko 4f52f62b44 Use stubs in KtProperty for getDelegate() and getDelegateExpression() 2018-11-06 13:43:08 +03:00
victor.petukhov fe072e3366 Fix the lack of the handling of whitespace characters in the KDoc lexer
Affected characters are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
This problem reproduces with JFlex since 1.5.0: http://jflex.de/changelog.html#jflex-1.5.0-jan-21-2014
2018-11-06 11:18:58 +03:00
victor.petukhov 9e6ac6cb2a Fix the lack of the handling of whitespace characters in the Kotlin lexer
Affected characters are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
This problem reproduces with JFlex since 1.5.0: http://jflex.de/changelog.html#jflex-1.5.0-jan-21-2014
2018-11-06 11:18:38 +03:00
Mikhail Glukhikh 2c626d6c5d Implement raw FIR builder (initial version)
All necessary FIR tree implementations were created
FIR renderer & three first builder tests were added
#KT-24013 Fixed
2018-11-02 19:44:49 +03:00
Natalia Selezneva 6ae95b747d Fix KotlinScriptDefinitionProvider compilation for 181 branch
Use FileTypeRegistry.getFileTypeByFileName instead of isFileOfType
2018-11-01 12:09:27 +03:00
Natalia Selezneva 715a5699de Do not use stubs looking for script definition
Fix EA-128960
2018-10-31 16:13:42 +03:00
Natalia Selezneva 6af9929992 Do not try to find script definition for decompiled kotlin files 2018-10-31 16:13:41 +03:00