Commit Graph

65 Commits

Author SHA1 Message Date
Roman Golyshev f9b3daabd1 Change testData for ShortenRefsTestGenerated to not use sql package
- Those packages are missing in the mockJdk 1.8 in intellij repository,
and it leads to those tests failing in kotlin-ide repository
- Test in `ShortenRefsTestGenerated` do not fail, but they are working
for the wrong reason (they do not shorten unresolved references)
2020-06-05 16:03:51 +03:00
Roman Golyshev 2c12d26d28 KT-18538 Unwrap fake override in ShortenReferences
- Fake override prevents reference shortener from shortening of static
methods declared in the class bases when they are located not in
direct parent of the class (for example, in grand-
or grand-grand-parent)
- The completion uses descriptor with unwrapped fake override when it
performs the insertion. It leads to inserting the name of the base which
actually contains the static method instead of the direct parent class.
Now, when reference shortener compares unwrapped descriptors, this
problem should be fixed during insertion handling
2020-06-01 08:59:37 +00:00
Dmitry Gridin 40c3e436d1 ShortenReferences: add test with lots of FqName with root prefix 2019-10-16 16:35:43 +07:00
Dmitry Gridin 589094377e QualifiedExpressionResolver: change root prefix from _Qfadj4tPV to _root_ide_package_ 2019-09-27 17:52:11 +07:00
Alexander Podkhalyuzin 9a2da67919 ShortenReferences: cleanup code & add tests for property-function conflicts 2019-09-27 17:52:11 +07:00
Dmitry Gridin c4a1101600 KtSimpleNameReference: add root prefix support to bindToFqName function 2019-09-05 18:01:23 +07:00
Dmitry Gridin dd2bd320ba ShortenReferences: add root prefix support
#KT-9204 Fixed
2019-09-05 18:01:22 +07:00
Valentin Kipyatkov c63eb18b3c Fixed nested class in companion object case 2018-10-16 08:41:43 +03:00
Valentin Kipyatkov 28e2683146 One more test 2018-10-16 08:41:42 +03:00
Valentin Kipyatkov 69f74b2a51 Fixed ShortenReferences for extension on companion object 2018-10-16 08:41:42 +03:00
Valentin Kipyatkov d4e0f53583 Fixed ShortenReferences for the case of extension for object 2018-10-16 08:41:42 +03:00
Dmitry Savvinov 76c651421b Deprecate visibility of static members inherited from Java
Now they are not visible by short name through companion objects, just
like classifiers in KT-21515

^KT-25333 In progress
2018-07-19 13:32:38 +03:00
Dmitry Savvinov d570b863ce Introduce deprecation of companion objects nested classes
Introdude deprecation as per KT-21515. Warning is reported on type
usage, that soon will became invisible. Quickfix by adding explicit
import is added.

Idea behind implementation is to mark scopes that are deprecated (see
ClassResolutionScopesSupport).

Then, during walk along hierarchy of scopes, look at deprecation status
of the scope that has provided this classifier.
Note that we also have to check if there are *some* non-deprecated
visibility paths (because we can see classifier by two paths, e.g. if
we've added explicit import) -- then this type reference shouldn't be
treated as deprecated.
2018-02-21 16:04:49 +03:00
Alexey Sedunov 480982b690 Shorten References: Wrap elements to shorten in smart pointers
#KT-17526 Fixed
2017-04-24 20:52:11 +03:00
Alexey Sedunov aad11ff0f4 Shorten References: Skip companion receivers on callable references
This is temporary fix due to KT-13934 which prevents resolution
of references like X::foo where foo is a member or extension
of X companion object
2017-03-26 12:56:19 +03:00
Simon Ogorodnik 2490318f93 KT-16076 Completion inserts FQN kotlin.text.String
KT-14831 Don't add import statement and FQN on converting lambda to reference if typealias is used
KT-16088 Completion wrongly inserts FQN for `kotlin` package
 #KT-16076 fixed
 #KT-14831 fixed
 #KT-16088 fixed
2017-02-13 16:48:14 +03:00
Ilya Gorbunov a62cda8365 Replace types that are imported by default via typealiases such as java.util.ArrayList with something else as it conflicts now with kotlin.collections.ArrayList and has to imported explicitly. 2016-11-16 18:47:42 +03:00
Valentin Kipyatkov 9b55ad82a0 KT-14370 Completion inserts fully qualified name for any Java interface with single abstract method (SAM-interface)
#KT-14370 Fixed
2016-11-08 19:14:41 +03:00
Valentin Kipyatkov 73dc5fefcb KT-12077 Code completion inserts FQN for annotations with use-site target inside primary constructor
KT-13009 Kotlin: annotation auto-import is broken in multiple ways

  #KT-12077 Fixed
  #KT-13009 Fixed
2016-10-11 17:26:52 +03:00
Alexey Sedunov cf28dd04c8 Shorten References: Compare resolved calls when shortening receiver of qualified call expression
#KT-13660 Fixed
2016-09-16 13:13:30 +03:00
Dmitry Petrov 0033cf85c4 Shorten references tests for typealias. 2016-07-04 08:30:18 +03:00
Valentin Kipyatkov 1535e8ad90 KT-11955 Copy/Paste inserts FQ-name
#KT-11955 Fixed
2016-04-20 14:30:54 +03:00
Alexander Udalov e941ba761a Minor, fix case in test data file name 2016-04-18 17:26:58 +03:00
Valentin Kipyatkov b32859cf68 KT-11633 Kotlin code editor applies wrong indentation after completing a statement in data class
#KT-11633 Fixed
2016-04-18 17:15:52 +03:00
Ilya Gorbunov f4822cd757 Fix testData in compiler: add collections and ranges package to fq-names. 2016-01-22 05:54:38 +03:00
Alexey Sedunov 44bc937499 Shorten References: Fix removal of explicit companion references in the position of callee expression
#KT-10102
2015-12-02 13:54:01 +03:00
Dmitry Petrov 9856af48ca Drop createQualifier: testData update 2015-11-18 14:35:53 +03:00
Stanislav Erokhin 7d7d37719b Forbidden old invokeExtension convention. 2015-10-17 14:45:53 +03:00
Stanislav Erokhin d7a14075f1 Removed ImportPackage UI settings 2015-09-24 13:53:56 +03:00
Stanislav Erokhin 8a0f175135 Minor. Suppressed test for KT-9204. 2015-09-18 21:00:23 +03:00
Stanislav Erokhin 8efbf4fc32 Fixed testdata -- removed package import 2015-09-18 21:00:20 +03:00
Valentin Kipyatkov edcb330281 Corrected/removed tests related to on-the-fly import optimization 2015-07-22 21:16:13 +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
Dmitry Jemerov 625096466e IDE testdata: s/trait/interface 2015-05-13 16:13:13 +02:00
Valentin Kipyatkov 066a7c3002 Code style setting for packages to always use star imports and UI for it 2015-04-13 13:41:43 +03:00
Valentin Kipyatkov a8d737bf87 One more test for import nested classes setting 2015-04-13 13:41:43 +03:00
Valentin Kipyatkov 04b2bdcc79 Added test for "import packages" code style setting 2015-04-13 13:41:43 +03:00
Stanislav Erokhin 3de0dff575 Migrate testdata to new lambda syntax 2015-04-07 13:08: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 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
Valentin Kipyatkov 5b4afa140b Fixed bug in reference shortening related on on the fly import optimization 2015-03-03 13:41:32 +03:00
Pavel V. Talanov 989f07962b Write to trace in case class qualifier is a short reference to default object
This allows to fix some cases when there is a difference between explicit and short reference to default object
Fix shorten reference, optimize imports and import insert helper for default objects
ShortenReferences always transforms default object references to shorter form for now
Fix DescriptorUtils#getFqName() for default objects (affects test data mostly)
Fix DescriptorUtils#getImportableDescriptor()
2015-03-03 13:04:30 +03:00
Valentin Kipyatkov a137503ee9 More sophisticated import setting supported: *-import when more than N names used (default set to 5) 2015-02-19 11:07:03 +03:00
Valentin Kipyatkov 0a363fc371 Import is placed in some specific order on adding 2015-02-19 11:07:02 +03:00
Valentin Kipyatkov 20cf100714 Shorten references inserts imports for global functions and properties too 2015-02-19 11:07:01 +03:00
Valentin Kipyatkov 546836d5dd Fixed bug with importing some of SAM-constructors and factory functions
#KT-3449 Fixed
2015-02-12 18:18:01 +03:00
Valentin Kipyatkov 4fff1f44bb Fixed bug in import insertion: it did not work with descriptors taken before modifications 2015-02-12 17:34:50 +03:00
Alexey Sedunov e68481557e Shorten References: Support 'this' simplification 2015-02-11 14:40:22 +03:00
Valentin Kipyatkov 952c64f947 Rewritten shortening references algorithm to work correctly with new smart import insertion 2015-02-09 12:56:01 +03:00
Valentin Kipyatkov 3bc2f89a1b Corrected test data after changes in import insertion + added when more test which fails with the current reference shortening algorithm 2015-02-09 12:56:00 +03:00