Commit Graph

260 Commits

Author SHA1 Message Date
Ilya Muradyan 489290263f Add info about the end of range in scripting REPL compiler messages 2020-06-05 21:58:28 +02:00
Yan Zhulanow c8bad15ba9 Fix EA-210182, check for context validity 2020-05-27 02:38:41 +09:00
Vladimir Dolzhenko 2d0445ebaa Add klib extension to ARCHIVE fileType
Fixed to #KT-38767
Relates to #KT-38571
2020-05-20 13:24:11 +00:00
Ilya Chernikov fb6ef38370 Revert "Add info about the end of range in scripting REPL compiler messages"
This reverts commit af251caf, because it breaks daemon/client
compatibility, which we'd like to keep as much as possible
2020-05-15 21:15:48 +02:00
Vladimir Dolzhenko f4b6e1bff6 Reworked deprecated fileTypeFactory EP usage
Relates to #KT-38571
2020-04-27 14:08:17 +00:00
Ilya Muradyan af251cafa4 Add info about the end of range in scripting REPL compiler messages 2020-04-16 21:16:08 +02:00
Ilya Kirillov 1535873c07 Do not try to lazy parse a block without opening bracket
It can consume the whole file in such case
which will result PsiBuilder going crazy

#KT-36191 fixed
2020-04-16 15:40:21 +03:00
Toshiaki Kameyama 9b3c3ae4ba "Replace 'invoke' with direct call" intention: do not add unnecessary parenthesis
#KT-37967 Fixed
2020-04-15 09:59:23 +02:00
Igor Yakovlev a71fd0e6d9 Support for showing rendered doc comments in editor
Fixed #KT-37361
2020-04-03 12:38:51 +03:00
Mikhail Zarechenskiy 38a719cb22 [NI] Fix trace manipulations for builder inference and ::-expressions
For a class literal Type::class we are resolving Type as a constructor,
 getting all diagnostics (about missing arguments, for example) and then
 just not committing this trace with errors

 #KT-37626 Fixed
2020-03-31 15:50:58 +03:00
Alexander Udalov b6fdc96994 Reverse dependency 'psi' <-> 'frontend.common'
Move ParseUtils to 'psi', and ImportPath to 'frontend.common'.

Now 'psi' depends on 'frontend.common', and that allows to remove
dependency of 'fir:tree:tree-generator' on 'psi', allowing the former to
compile in parallel with the old frontend code.
2020-03-28 21:30:07 +01:00
Roman Golyshev f656cd2889 KT-37781 Add FUN_KEYWORD to MODIFIERS_ORDER
- This way it is inserted before visibility modifiers
- ^KT-37781 Fixed
2020-03-26 19:37:10 +03:00
Dmitry Gridin ae96a68bd1 i18n: createByPattern: add @NonNls to parameters 2020-03-16 18:40:48 +07:00
Dmitry Gridin 2b8373447a i18n: KtPsiFactory: add @NonNls to parameters 2020-03-16 18:40:48 +07:00
Roman Golyshev e1cb561398 i18n: add bundle for idea/refactoring/rename
- Modify `text.parameter` value to `Parameter`;
use `text.parameter.0` in previous usages
- Add @Nls and @NonNls annotations to few places
2020-03-16 18:40:47 +07:00
Roman Golyshev 37e1333fe1 i18n: add bundle for idea/refactoring/pullUp
- Add @NonNls to used methods from `KtPsiFactory`
2020-03-16 18:40:47 +07:00
Alexander Udalov 795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Ilya Kirillov 9af30f4ac7 EA-210362: fix invalid cast to KtFile in KtCodeFragment 2020-02-25 13:58:28 +03:00
Toshiaki Kameyama a3252b9480 Unused symbol: fix false positive in anonymous object in top level or companion object
#KT-31800 Fixed
#KT-20868 Fixed
2020-02-21 14:36:18 +01:00
Pavel Kirpichenkov 07ca355af8 [NI] Fix smartcasts for conventional contains in when
Call argument for conventional `contains` after expanding `in` may come from a `when` subject during its branch analysis.
In this case data flow info from a previous when branch was not considered,
because data flow info for subject had been used instead of data flow before argument.
Use of the latter one for the conventional `contains` solves the issue.

The old FE uses `isExternal` property of value arguments to skip smartcast reporting on `when` subject,
if they come from branches. To prevent undesired smartcasts on `when` subject after branch analysis in the new FE,
`isExternal` arguments are skipped in diagnostic reporter and during recorded type update.

Also, the new FE interprets `isExternal` completely differently from the old FE.
In the old FE this property is used exclusively by `when` with subject.
In the new FE it is also used for parially resolved calls, lambda return arguments and receivers.
This may be preventing the use of data flow info before argument in the first place, but this assumption requires additional investigation.

^KT-36818 Fixed
2020-02-20 19:07:54 +03:00
Igor Yakovlev 9e05c702ab Fix KtDotQualifiedExpressionElementType stub building for complex qualified elements
Fixed #EA212081
2020-02-12 18:59:35 +03:00
Mikhail Zarechenskiy 45bbdaf73f Add base declaration checker for fun interfaces 2020-02-12 10:36:39 +03:00
Dmitry Petrov c5f14a29a4 PSI2IR: Generate adapted callable references
Callable reference is "adapted" if it requires some adaptation to an
expected function type - e.g., when a reference to
```
  fun foo(vararg xs: Int): Int
```
is used where `(Int, Int, Int) -> Int` is expected.

For such callable references we generate the following IR (in
pseudo-Kotlin):
```
  {
    fun foo'(p0: Int, p1: Int, p2: Int): Int {
      return [| foo(p0, p1, p2) |]
    }
    ::foo'
  }
```

where `[| foo(p0, p1, p2) |]` is calling function `foo` with arguments
`p0`, `p1`, and `p2`, as they were mapped by callable reference
resolution.
2020-01-24 11:21:25 +03:00
Dmitry Petrov 89c832b5a0 FE: provide argument mapping info for adapted callable reference 2020-01-24 11:21:25 +03:00
Dmitry Gridin 80194dd536 Trailing comma: cleanup code after review
#KT-34744
2020-01-23 17:36:38 +07:00
Dmitry Gridin ac8a8ecab4 ktPsiUtil: cleanup code 2020-01-23 17:36:38 +07:00
Mikhail Zarechenskiy 8206cadce2 FIC: support fun interfaces in stub builder 2020-01-17 19:36:12 +03:00
Mikhail Zarechenskiy f7ce1c669b FIC: Introduce isFun property for descriptors and proto 2020-01-17 19:35:06 +03:00
Mikhail Zarechenskiy 6655f0fc4c FIC: Increase STUB version because of changes in parser for declarations 2020-01-17 19:35:05 +03:00
Mikhail Zarechenskiy 4aa195e912 FIC: Parse fun keyword in front of interface as a modifier 2020-01-17 19:35:05 +03:00
Dmitry Gridin d013fc2234 Formatter: support trailing comma in when entry
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin 4adfaab3ec Formatter: support trailing comma in lambda parameters
#KT-34744
2020-01-17 21:02:53 +07:00
Dmitry Gridin bf92517500 KtVisitorVoid: add missing visitCollectionLiteralExpression 2020-01-17 21:02:52 +07:00
Vladimir Dolzhenko d176a26cdb Improve investigation info in KtDotQualifiedExpression
Relates to #EA-212081
2020-01-14 12:15:04 +01:00
Vladimir Dolzhenko d644c0125a Add more investigation info to getFilesForElements
Relates to #EA-209630
2020-01-14 12:11:32 +01:00
victor.petukhov fc7b836151 Fix isNegated psi method in KtWhenConditionInRange
^KT-34395 Fixed
2020-01-13 15:36:33 +03:00
Dmitriy Novozhilov f083edfac2 Allow contracts on final non-override members since 1.4 2019-12-26 17:43:27 +03:00
Aleksey Kladov 0aa527347d Stubs don't break KtTypeAlias::isTopLevel
`foo ?: bar is baz` is parsed as `(foo ?: bar) is baz`. So, if stub is non-null, this always returns `False`, because `Boolean` is definitely not a `KtFile`. See https://pl.kotl.in/6DtggcImf 

This Kotlin's "most vexing parse" badly needs a diagnostics.
2019-12-26 10:36:40 +03:00
Ilya Chernikov 7bb9f97b11 Allow to separate top-level script declarations and statements with semicolon
This fix allows to write one-liner scripts like "val x = 3; println(x)", which
were previously rejected by the parser.
2019-12-02 16:46:54 +01:00
Vladimir Dolzhenko a6f829f267 Add secondary ctors to incremental analysis
Relates to #KT-35121
2019-11-29 18:30:01 +01:00
victor.petukhov 62d204f4d6 Support trailing comma
^KT-34743 Fixed
2019-11-01 19:40:20 +03:00
Yan Zhulanow fa45122c6b Minor: Fix warnings in KtCodeFragment 2019-10-24 21:33:00 +09:00
Vladimir Dolzhenko 30229da95a Don't render pure error types in OverrideMemberChooserObject
#KT-34379 Fixed
2019-10-21 17:18:23 +02:00
Toshiaki Kameyama d86e87d35e Add quickfix to change object to class
#KT-33586 Fixed
2019-10-02 19:42:30 +07:00
Alex Chmyr b8cce67d2e KT-19355 fix for "Variable expected" error after J2K for increment/decrement of an object field 2019-09-25 10:08:42 +03:00
Natalia Selezneva 8f2aaf62c2 Implement modification stamp for ScriptInitializer
This should influence ResolveElementCache to correctly update caches
because it rely on modifications stamps of the declaration
Before this change file.modificationStamp was used for script initializers in file, so they all became outdated after some change in file
2019-09-12 09:56:42 +03:00
Ilya Kirillov c28515be59 New J2K: use nullable type for unknown for public declarations & prepare for mutability inference
#KT-32518 fixed
2019-09-10 14:09:25 +03:00
Nikolay Krasko 372c6377e8 Remove AstLoadingUtil after removing 182
#KT-33536 Fixed
2019-08-30 12:13:50 +03:00
Nikolay Krasko 4d0fc1dc22 Remove 182 support
#KT-33536 Fixed
2019-08-30 12:13:44 +03:00
Dmitry Gridin 1c98cb763e addRemoveModifier: shouldn't add extra new line
#KT-26635 Fixed
2019-08-27 17:26:09 +07:00