Commit Graph

83 Commits

Author SHA1 Message Date
Vladimir Dolzhenko c9658eb6e4 Adjust tests due to keep imports for extension functions used in kdoc
Relates to #KT-27601
2020-02-25 09:29:39 +01:00
kvirolainen 90cfa80683 KT-27601 keep imports for extension functions used in kdoc 2020-02-22 08:55:50 +01:00
Mikhail Zarechenskiy 78affdd2b4 Fix old testdata: add missing operator modifier
This testdata was written when there was no "operator" modifier.

 After a83225218f rules for operators become stricter and now functions without operators are not considered as such
2019-09-25 01:52:55 +03:00
Dmitry Gridin 9316f45a5c Optimize Imports: improve tooltip information
#KT-21374 Fixed
2019-07-02 11:54:38 +07:00
Dmitry Gridin eee8d0263d Fix "Unused import" for 'provideDelegate'
#KT-31319 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin 3914530fa8 Don't delete import from stdlib if alias exists and used
#KT-31414 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin 32298522dd Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-14 21:01:20 +07:00
Dmitry Gridin e857425b35 Fix 'optimizeImports' tests 2019-05-06 18:12:39 +07:00
Dmitry Gridin ff26acacf9 Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-06 18:12:39 +07:00
Dmitry Gridin 96ed33e357 Optimize Imports should remove unused import alias
#KT-17375 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin 9062a2fe72 Fix false positive "Unused import directive" for imports under several alias
#KT-30949 Fixed
2019-05-06 18:10:51 +07:00
Natalia Selezneva 8f8c431524 Fix Optimize import for scripts not under source roots
KT-17231 Fixed
KT-21981 Fixed
2018-09-21 22:58:14 +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
Alexander Udalov f766b2c473 Improve "optimize imports" behavior on default imports
Optimize imports to classes when there's an import of a type alias to
that class with the same name. This results in "java.lang.*" imports
being optimized in favor of the corresponding type aliases in "kotlin.*"
which are imported by default
2018-07-16 13:45:11 +02: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
Simon Ogorodnik 7ed1669050 KT-19011: Fix import optimizing when extension functional type is used
It should check is extension functional type imported from companion
is actually called on companion instance

 #KT-19011 fixed
2017-07-21 03:08:06 +03:00
Simon Ogorodnik 9ca65fcf99 Fix addition of wrong java.lang imports on optimize imports
Add check to star importer, to not import already imported fqNames
 #KT-15273 fixed
2017-04-18 17:45:45 +03:00
Ilya Gorbunov 38b79a51d5 Fix tests after introducing exlcusions to default imports of kotlin.js package. 2017-01-30 19:44:51 +03:00
Simon Ogorodnik f1c4230a68 KT-14680 import statement to typealias reported as unused when using only TA constructor
#KT-14680 fixed
2017-01-26 21:18:20 +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 b84260f39f Fixed multiple bugs in optimize imports for JS-target
#KT-13689 Fixed
2016-10-10 14:48:16 +03:00
Valentin Kipyatkov 57faa5a39a Term changes 2016-09-30 21:37:48 +03:00
Valentin Kipyatkov 17adee68cd Fixed optimize imports for operators 2016-09-30 21:37:47 +03:00
Valentin Kipyatkov 95a3a29382 Optimize imports to prevent accedential changes in resolve because of import priorities
#KT-11640 Fixed
2016-09-30 21:37:47 +03:00
Valentin Kipyatkov 7628fa1608 Checked that KT-13766 Fixed by some changes in resolve
#KT-13766 Fixed
2016-09-30 21:37:46 +03:00
Valentin Kipyatkov 7d214c6e58 KT-13689 Typealias constructor usage counts as original type usage for optimize imports
#KT-13689 Fixed
(cherry picked from commit bde7e2b)
2016-09-20 10:55:36 +03:00
Valentin Kipyatkov 5e48b7349e KT-12803 Unused import when class is used in method reference
#KT-12803 Fixed
2016-07-04 20:49:40 +03:00
Valentin Kipyatkov e1d8c72aa7 KT-10770 IDEA cannot keep import if a type is only referenced by kdoc.
#KT-10770 Fixed
2016-04-29 11:23:23 +03:00
Ilya Gorbunov 2257fa36ec Drop deprecations: text and system
Fix import in testData
Fix testData: replace removed method.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov 25c4453dc5 Cleanup deprecated symbol usages in testData 2016-01-22 05:54:38 +03:00
Valentin Kipyatkov 4c2a14ff43 KT-9834 Optimizing imports with named import (kinda like static import)
#KT-9834 Fixed
2016-01-18 17:40:03 +03:00
Valentin Kipyatkov 15930a42b8 Fixed containingDeclaration for descriptors inside init-blocks for the case of no primary constructor
KT-10226 Wrong Imports optimization ("Unresolved reference" is being added)

 #KT-10226 Fixed
2016-01-14 21:53:41 +03:00
Sergey Mashkov e25d31618c Fix tests 2015-12-18 22:16:04 +03:00
Zalim Bashorov 5bf8b4d946 Allow to use "static" part of class in own constructors by short name, including in primary constructor 2015-12-09 21:42:32 +03:00
Valentin Kipyatkov 218c0cfff7 KT-9875 False unused import in kotlinSpacingRules.kt
#KT-9875 Fixed
2015-11-05 17:47:54 +03:00
Valentin Kipyatkov 3a9beb719f Better test 2015-10-19 18:40:15 +03:00
Valentin Kipyatkov 66ea544a48 Fixed incorrect handling of this and super expressions in copy/paste processing and optimize imports 2015-10-19 18:40:15 +03:00
Valentin Kipyatkov 115d7a2eae Code style setting for importing Java statics and enums with '*'
#KT-9592 Fixed
2015-10-19 18:40:14 +03:00
Valentin Kipyatkov 27228c2fcc KT-9638 Optimize imports: don't create import for static methods from superclasses
#KT-9638 Fixed
2015-10-19 18:40:14 +03:00
Valentin Kipyatkov edd2d853b1 KT-8961 Optimize Imports adds useless import for static Java method reference
#KT-8961 Fixed
2015-10-19 18:40:14 +03:00
Stanislav Erokhin 8efbf4fc32 Fixed testdata -- removed package import 2015-09-18 21:00:20 +03:00
Valentin Kipyatkov 30a9a8787e Optimize imports to use "packages to import with *" setting 2015-08-19 17:27:47 +03:00
Mikhail Glukhikh 022e7d1169 Deprecated enum syntax removed: most idea tests 2015-08-10 16:24:16 +03:00
Valentin Kipyatkov 68dec99ad7 KT-8389 Meaningless self-import insterted on "optimize imports"
#KT-8389 Fixed
2015-07-22 21:11:00 +03:00
Dmitry Jemerov 625096466e IDE testdata: s/trait/interface 2015-05-13 16:13:13 +02: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 862d391da6 KT-6834 Optimize Imports: do not modify file if import list had not change
#KT-6834 Fixed
2015-03-03 13:41:32 +03:00
Valentin Kipyatkov b0d82bef7d Tested KT-2718 Package names that match Kotlin keywords should be escaped properly 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