Commit Graph

58 Commits

Author SHA1 Message Date
Igor Yakovlev 9e05c702ab Fix KtDotQualifiedExpressionElementType stub building for complex qualified elements
Fixed #EA212081
2020-02-12 18:59:35 +03:00
Nikolay Krasko 2d1c76344c Store presence of spread operator for value argument in stubs 2018-11-15 18:55:56 +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 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 f892714bea Test for stubs in annotations (KT-23738) 2018-11-06 13:43:07 +03:00
Dmitry Savvinov 5ab79a111d Introduce 'mayHaveContract'-flag in stubs
This is needed for further commit, which supports contracts-based
smartcasts in partial body resolve mode.

NB: Stubs can be built from 3 sources:
- source code (contract presence can be checked by PSI)
- binary data (contract presence can be checked by Kotlin Metadata)
- decompiled sources

The last case is a bit of a headache, because usually bodies are omitted
in decompiled sources. To workaround it, we have to inject stubbed
contract-call in the body.
2018-07-27 16:59:24 +03:00
Dmitry Jemerov 4dd3f30f2d Build stubs for local functions; show them in Goto Symbol
#KT-14161 Fixed
2017-05-18 21:02:24 +02:00
Dmitry Jemerov 8f38d03b48 Indicate vararg parameters in Goto Symbol presentation
#KT-17899 Fixed
2017-05-18 21:02:24 +02:00
Nikolay Krasko c1538aea43 Get annotation for injection from reference descriptor (KT-15548)
#KT-15548 Fixed
2017-01-12 14:21:47 +03:00
Dmitry Petrov a15d423db4 Support modifiers on types in parser
(required for 'suspend' on functional types).

TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.

Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.

Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.

In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
2016-12-15 23:57:41 +03:00
Nikolay Krasko d1dfcfaca1 Fix stub-psi mismatch exception on restoring annotation for nullable types
(cherry picked from commit 1aa37f11258dde289a9f7cb700294a038168fbdc)

Conflicts:
	compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt
	idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt
2016-10-25 13:22:53 +03:00
Nikolay Krasko 355dca2a97 Add toString for KotlinStubBaseImpl
Try to simplify "Stub and PSI element type mismatch" exception analyze.

(cherry picked from commit 11aa71e)
2016-10-21 00:18:27 +03:00
Denis Zharkov b5bdb070a0 Fix test data after 4725dd3 2016-07-16 09:10:35 +03:00
Alexander Udalov 7eafae1936 Drop isAbsoluteInRootPackage from stubs 2016-06-01 19:30:04 +03:00
Dmitry Jemerov 009e3f9cd7 rename PSI classes according to current terminology:
KtMultiDeclaration(Entry) -> KtDestructuringDeclaration(Entry)
KtFunctionLiteralExpression -> KtLambdaExpression
KtFunctionLiteralArgument -> KtLambdaArgument
KtDelegationSpecifierList -> KtSuperTypeList
KtDelegationSpecifier -> KtSuperTypeListEntry
KtDelegatorToSuperClass -> KtSuperTypeEntry
KtDelegatorToSuperCall -> KtSuperTypeCallEntry
KtDelegationByExpressionSpecifier ->KtDelegatedSuperTypeEntry
2015-12-10 16:15:13 +01:00
Pavel V. Talanov dbd49c37c1 Psi: Introduce KtScriptInitializer, a separate entity for script initializers which are quite a bit different from class initializers 2015-11-19 22:57:07 +03:00
Pavel V. Talanov aeb4abe39d Fix decompiled text for named companion object
Fix stub/ast mismatch for compiled named companion objects
Add tests
2015-10-19 15:27:49 +03:00
Valentin Kipyatkov 090ea37a32 Fixed test data to use only annotation syntax with @ 2015-10-15 19:20:08 +03:00
Denis Zharkov e1e3a6c9ad Introduce const into decompiler and stub builder 2015-09-23 08:20:57 +03:00
Denis Zharkov fc447e2d2f Parse some builtin annotations as modifiers
But still resolve them as annotations.
Mostly it's needed as begin of migration path, one day they become modifiers anyway

Some tests are dropped because they supposed that `annotation` should have parameter
2015-09-08 08:53:35 +03:00
Denis Zharkov 31244edec9 Deprecate deprecated in favor of Deprecated 2015-09-04 18:19:31 +03:00
Mikhail Glukhikh 022e7d1169 Deprecated enum syntax removed: most idea tests 2015-08-10 16:24:16 +03:00
Mikhail Glukhikh 1eac4d67de "annotation" is now parsed as an identifier. It is no longer a soft keyword.
Sometimes it's allowed to parse "annotation" unescaped even if other annotations must be escaped.
A set of annotations and their options tests.
A swarm of existing tests fixed (mostly kotlin.annotation.annotation() added to txt-files).
STUB_VERSION increased. Some quick fixes slightly changed.
2015-07-14 16:24:55 +03:00
Denis Zharkov c9f79c2d05 Adjust testData: get rid of obsolete annotations 2015-06-12 09:23:31 +03:00
Pavel V. Talanov 07d35d305e Create import list psi element even if no directives are present
Fix a problem where deleting last import directive via "optimize imports" could lead to incorrect psi structure resulting in CCE, see EA-64291
New imports are inserted at the head (after package directive if present) of the file (before any comments) if no imports were present
Add test for inserting import to file where a first statement is a comment
Drop code dealing with non-existing import list in ImportInsertHelperImpl
AbstractQuickFixTest: check for unexpected actions before changes to the file are made as it relies on the first line having specific format
2015-06-08 20:51:04 +03:00
Valentin Kipyatkov 8fd6a64be9 Refactored methods for val/var in PSI 2015-06-01 18:23:34 +03:00
Dmitry Jemerov 625096466e IDE testdata: s/trait/interface 2015-05-13 16:13:13 +02:00
Dmitry Jemerov 46841ef447 fix expected testdata for StubBuilderTestGenerated 2015-04-29 19:19:40 +02:00
Dmitry Jemerov f61a4a15cc rename "isTrait" to "isInterface": update test data 2015-04-29 16:50:20 +02:00
Dmitry Jemerov f93eeeb563 fix tests by adding missing 'init' keywords to testdata 2015-04-29 14:07:05 +02:00
Alexander Udalov fe602d34ce Support type annotations in cls stub builder
Also add test on decompiler
2015-04-29 01:03:56 +03:00
Valentin Kipyatkov 6a2cc66eb1 Got rid of isProbablyNothing in stubs + fixed exception on some files on indexing stubs 2015-04-02 10:10:31 +03:00
Valentin Kipyatkov bff2b2f378 Fixed tests for stubs 2015-04-02 10:09:25 +03:00
Pavel V. Talanov a986d913c3 Remove traces of class object constraints feature from parser, frontend, tests and psi 2015-04-01 20:09:34 +03:00
Denis Zharkov 8e69c06e5a Adjust stub-builder, decompiler and renderer to new PSI structure
of primary ctor
2015-03-31 20:20:22 +03:00
Pavel V. Talanov a50b218c6a default -> companion: Replace some missed usages of "isDefault" 2015-03-17 17:10:53 +03:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Pavel V. Talanov c0a031eafe Support secondary constructors in decompiled text
Build cls stubs for secondary constructors
2015-03-13 20:17:32 +03:00
Pavel V. Talanov 59f192ef90 Replace 'class object' with 'default object' in renderers and test data
Includes changes to decompiled text
Old syntax is used in builtins and project code for now
2015-03-06 19:36:54 +03:00
Pavel V. Talanov 48fbce9582 Refactor: process mentions of class object
Rename usages that refer to "default object" concept now
Test data file names are left as is
2015-03-03 20:57:08 +03:00
Pavel V. Talanov be5f00ad1c Update test data for various stub tests 2015-02-16 15:38:33 +03:00
Andrey Breslav 0f0f205248 Serializing information about star projections 2015-02-02 19:52:02 +03:00
Andrey Breslav 06c5be6489 Fix tests: No dangling annotations in stubs 2014-12-26 15:10:13 +03:00
Pavel V. Talanov e20dd42aa4 Refactor stubs:
Convert all interface classes to kotlin and move them into one file
Convert some of Impl classes
Fix typo: hasValOrValNode
Extract ModifierMaskUtils
Minors
2014-12-21 14:23:24 +03:00
Andrey Breslav 28b466d069 Parsing dynamic types 2014-12-01 20:43:37 +03:00