Commit Graph

798 Commits

Author SHA1 Message Date
Dmitry Gridin ce1ec49625 Add case for private nested class/object in KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Nikolay Krasko 213b98fefe Review changes: revert compiler behaviour, add test, remove inner classes 2019-03-12 14:28:31 +03:00
Yan Zhulanow 6cb2146d31 Remove 'allowSpecialClassNames' extraction option 2019-02-25 14:43:58 +03:00
Yan Zhulanow 4ae01badff Extract function: avoid same parameter names 2019-02-25 14:43:55 +03:00
Toshiaki Kameyama b4789b95ef Rename: fix renaming of label by label reference in loop
#KT-29796 Fixed
2019-02-18 15:12:39 +03:00
Nicolay Mitropolsky 48619a49ed RenameKotlinPropertyProcessor made not update the property before all references are updated (KT-27602)
because otherwise language independent bean property references couldn't properly handle rename in some cases.

Groovy references were also affected by this bug because they weren't able to resolve to original property
2019-02-14 13:27:06 +03:00
Toshiaki Kameyama 6f7830a4b2 Make public: reformat after removing primary constructor visibility modifier
#KT-29444 Fixed
2019-02-09 02:56:14 +03:00
Vyacheslav Gerasimov 818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Denis Zharkov 91c86f7f56 Fix refactorings that remove parameter based on ultra-light classes
This commit fixes the exception attached to the bottom of the message
The problem is that when creating ChangeSignatureProcessor for old PsiMethod
that points to the parameter that is already removed from PSI, some pieces
of platform code run resolution on the light PSI that eventually checks
if the source element is valid.

For KtUltraLightParameter, it inherits "isValid" from LightElement and
the latter is defined as getNavigationElement().isValid(),
while here navigationElement points to already removed parameter,
and marked as invalid.

The simplest solution was to define KtUltraLightParameter::isValid
as it was before ultra-light classes, i.e. checking if parent is valid
(see KtLightElementBase::isValid)

com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl #JAVA  because: File language:Language: JAVA != Provider base language:Language: kotlin
invalidated at: no info
	at com.intellij.psi.util.PsiUtilCore.ensureValid(PsiUtilCore.java:482)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:190)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:138)
	at com.intellij.psi.util.PsiUtil.resolveClassInType(PsiUtil.java:445)
	at com.intellij.psi.util.PsiUtil.convertAnonymousToBaseType(PsiUtil.java:484)
	at com.intellij.psi.impl.light.LightTypeElement.<init>(LightTypeElement.java:33)
	at com.intellij.psi.impl.PsiElementFactoryImpl.createTypeElement(PsiElementFactoryImpl.java:142)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.fillOldParams(JavaChangeInfoImpl.java:218)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.<init>(JavaChangeInfoImpl.java:127)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.<init>(JavaChangeInfoImpl.java:86)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessor.generateChangeInfo(ChangeSignatureProcessor.java:121)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessor.<init>(ChangeSignatureProcessor.java:88)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo$getOrCreateJavaChangeInfos$3.invoke(KotlinChangeInfo.kt:400)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo$getOrCreateJavaChangeInfos$5.invoke(KotlinChangeInfo.kt:469)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo.getOrCreateJavaChangeInfos(KotlinChangeInfo.kt:498)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeSignatureUsageProcessor.processUsage(KotlinChangeSignatureUsageProcessor.kt:847)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessorBase.doChangeSignature(ChangeSignatureProcessorBase.java:218)
2018-11-26 11:36:25 +03:00
Alexey Sedunov 1b15ce3ddc Move: Fix top-level declaration detection for scripts
#KT-25858 Fixed
2018-08-09 10:06:31 +03:00
Mikhail Glukhikh 247bb912ba Fix refactoring test (bunch file -> original file) 2018-08-06 19:04:09 +03:00
Vyacheslav Gerasimov 0103c0d2fd Switch to 182 platform 2018-08-02 18:17:06 +03:00
Alexey Sedunov 5275e19c76 Move: Do not consider type alias -> expect class change as a conflict
Given they have the same fqname

 #KT-23594 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov 1c30a12d95 Move: Account for implemented modules in internal access check
#KT-23590 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov 0406d61622 Rename: Update filenames within expect/actual set (when necessary)
#KT-23772 Fixed
2018-07-27 16:08:13 +03:00
Mikhail Glukhikh ddd3a0a46e Implement liftToExpected correctly for primary constructor properties
Before this commit, we always tried to find expect property in this case.
However, there is at least one case when we should find parameter of
expect primary constructor instead (safe delete).
So #KT-25321 Fixed
2018-07-26 18:01:42 +03:00
Mikhail Glukhikh 48017a81ee Move isEquivalentTo() from KtClass to KtClassOrObject
This makes objects and companions with the same qualified name
compatible from find usages point of view
So #KT-25326 Fixed
So #KT-25438 Fixed
2018-07-26 18:00:26 +03:00
Mikhail Glukhikh 46cc773953 Test refactoring: header/impl -> expect/actual in safe delete tests 2018-07-26 18:00:21 +03:00
Yan Zhulanow e958a9771f Extract refactoring: Make an extracted function 'inline' if any of its type parameters are reified (#KT-23983) 2018-07-12 20:36:38 +03:00
Dmitry Savvinov 2783e9939b Fix internal-visibility mangling in IDE
Collect module name properly from facets settings, using CLI arguments
which define module name ('-module-name' on JVM and Common,
'-output-file' on JS).

^KT-23668 Fixed
2018-07-09 18:50:50 +03:00
Alexey Sedunov 22d74276a0 Misc: Configure stdlib in failing tests 2018-07-02 19:08:10 +03:00
Mikhail Glukhikh aac71bf904 Safe delete: when invoking on actual, delete expect & actual neighbors
So #KT-15666 Fixed
2018-06-29 10:54:24 +03:00
Mikhail Glukhikh 50e70e4638 Safe delete: when invoking on expect, delete also relevant actual
Partial fix of KT-15666
2018-06-29 10:53:43 +03:00
Mikhail Glukhikh 465d5c077e Safe delete: search for actual declarations more accurately 2018-06-29 10:53:42 +03:00
Alexey Sedunov 60583e557f PSI: Do not delete package directive for file in default package
#KT-24968 Fixed
2018-06-28 18:22:28 +03:00
Alexey Sedunov bede2e1c16 Extract Interface: Fix type import when converting parameter to property
#KT-18736 Fixed
2018-06-28 17:52:05 +03:00
Alexey Sedunov 9b7450cfdb Extract Superclass: Report private members used in abstracted members
#KT-16284 Fixed
2018-06-28 17:52:04 +03:00
Alexey Sedunov bd88e02172 Extract Superclass: Fix visibility lifting when moving to interface
#KT-16281 Fixed
2018-06-28 17:52:04 +03:00
Alexey Sedunov b0e0460ee6 Extract Superclass: Allow extraction to existing file
#KT-15351 Fixed
2018-06-28 17:52:04 +03:00
Mikhail Glukhikh e885e54233 Implement search from expect element in KotlinReferenceSearcher
So mostly #KT-17512 Fixed
2018-06-26 15:36:06 +03:00
Alexey Sedunov 16dbc6fb4d Extract Function: Forbid inappropriate declarations inside extractable fragment
#KT-20467 Fixed
 #KT-20469 Fixed
2018-06-19 12:22:40 +03:00
Alexey Sedunov 0ea1784d33 Introduce Parameter: Add suspend to lambdas with nested suspend-calls
#KT-24712 Fixed
2018-06-08 14:34:23 +03:00
Alexey Sedunov 8a838ab5bb Change Signature: Fix parameter name for kt-function overriding Java's
#KT-24763 Fixed
2018-06-08 14:34:23 +03:00
Alexey Sedunov 8978c4b9e8 Rename: Fix processing of references to synthetic Java properties
#KT-17742 Fixed
2018-06-08 14:34:23 +03:00
Alexey Sedunov 862dc76ed9 Rename: Fix processing of overriding methods with mangled names
#KT-24460 Fixed
2018-06-08 14:34:22 +03:00
Alexey Sedunov eea9113d1c Introduce Type Alias: Fix replacement of references to nested classes
#KT-15159 Fixed
2018-06-08 14:34:22 +03:00
Alexey Sedunov 3c267b206b Move: Fix exception on moving top-level declaration from/to script file
#KT-20260 Fixed
2018-06-04 20:17:43 +03:00
Alexey Sedunov 4e3c1e9f56 Rename: Do not search text occurrences of local declarations
#KT-23838 Fixed
2018-05-11 16:05:19 +03:00
Nikolay Krasko c83ff5e75f Remove files introduced in 181 from 173 branch 2018-04-27 19:45:23 +03:00
Vyacheslav Gerasimov 8c88ac69df Cleanup .181 bunch files 2018-04-27 18:25:21 +03:00
Vyacheslav Gerasimov bc403ce744 Switch to 181 platform 2018-04-27 18:25:17 +03:00
Nikolay Krasko c6f8c868ce Minor: remove unused FIND_FILE_USAGES directive 2018-04-23 16:41:13 +03:00
Nicolay Mitropolsky 06e65e5f48 182: removing Spring from Kotlin-Ultimate
because all necessary functionality is already in IDEA-Ultimate
2018-04-21 11:25:49 +03:00
Alexey Sedunov 53a4baac8b Safe Delete: Do not replace SafeDeleteOverrideAnnotation for Java methods
#KT-23613 Fixed
2018-04-19 19:06:48 +03:00
Alexey Sedunov 62f654b3d2 Introduce Variable: Avoid explicit types for expression of anonymous type
#KT-12078 Fixed
2018-04-13 20:23:07 +03:00
Alexey Sedunov e5b915661a Rename: Do not suggest camel names for backquoted non-identifiers
#KT-22888 Fixed
2018-04-13 20:23:05 +03:00
Alexey Sedunov ea66e1e3f7 Copy: Fix exception on copying KtFile to non-KtFile
#KT-22669 Fixed
2018-04-13 20:23:05 +03:00
Alexey Sedunov bf106d01b8 Find Usages: Restrict search scope of private top-level declarations
#KT-7622 Fixed
2018-04-13 20:23:04 +03:00
Alexey Sedunov 25d19b45e9 181: Safe Delete: Do not delegate class search to Java
This fixes tests failing in IDEA 181
2018-04-11 16:28:37 +03:00
Alexey Sedunov ffc059a0a1 181: Misc: Update Move test data 2018-04-11 16:28:36 +03:00