The creation of Kotlin functions from Kotlin usage does not need LC and
PsiType because both sides use KtClass and KtType. To avoid the
unnecessary conversion between KtClass and LC and conversion between
KtType and PsiType, this commits adds wrapper classes for KtClass and
KtType that are child classes of JvmClass and JvmType. See
JvmClassWrapperForKtClass and JvmTypeWrapperForKtType.
GitOrigin-RevId: 13b67b3573d8acef98d41aa9681cfb3070767893
Based on the template, this commit support the selection of parameter
names, parameter types, and return type. Now K2 create-from-usage for
functions has the same behaviors as K1 for "abstract" call test cases.
It was also tested in an instance of IJ as well.
Now the minimal K2 create-function-from-usage works:
Correct action messages for quick-fixes -> working
[WIP] Function creation
Container selection to inserts created functions -> working
Capturing parameter types information -> working
Parameter name selection -> working
Capturing return type information -> working
Rendering types -> working
Template -> working
Shortening reference -> working
Moving caret after inserting created function -> working
[TODO] Handling type parameter
GitOrigin-RevId: a41b54ec0d44607c0371ddeb2c85eca2948e01b6
If we use KtTypeRendererForSource.WITH_QUALIFIED_NAMES for
KtType.render(..), it will render kotlin.String! for
kotlin.String, which causes a syntax error when we use it in
create-from-usage. This commit defines a new instance of
KtTypeRendererForSource to fix this issue.
GitOrigin-RevId: db9cc930eea8e500e95dba1fcaba755d8caa51a6
We have a powerful architecture that supports cross-language for
create-from-usage like creating Java elements from usage in Java and
Groovy. They share the same CreateMethodAction based on
CreateMethodRequest. When we want to add a create-Java-element
quickfix from a language, we can simply implement a request class that
is a child of CreateMethodRequest.
Likewise, we already have a skeleton classes to support the same
cross-language feature for create-Kotlin-element from usage, which is
CreateKotlinCallableAction. It creates Kotlin callable based on a given
request.
This commit implements K2 create-from-usage (previously, we had
CreateCallableFromCallActionFactory and CreateCallableFromUsageFix)
based on CreateKotlinCallableAction and request. Currently,
Correct action messages for quick-fixes -> working
[WIP] Function creation
Container selection to inserts created functions -> working
Capturing parameter types information -> working
Parameter name selection -> working
Capturing return type information -> working
[WIP] Rendering types
[TODO] Template
[TODO] Shortening reference
[TODO] Handling type parameter
[TODO] Moving caret after inserting created function
GitOrigin-RevId: 27ccc20dcc62acec889d978552f1a4c0e4b8423c
This commit refactors class names for K2 create-from-usage from "Method"
to "KotlinFunction" because they handle Kotlin code rather than Java
methods.
GitOrigin-RevId: 8ec9e673ada8fe855494740ea92b6dcf3965a9c2
otherwise, if session is build by the element itself and element is located in library, symbol origin would not be as expected LIBRARY but SOURCES
^KTIJ-28216 fixed
^KTIJ-28176 fixed
GitOrigin-RevId: 2a613e8d78a6c57e70fd42c7bf313186b7778fb6
...and remove their 'final' modifier. Since final classes cannot be inherited, marking a method as final is unnecessary and confusing.
^IDEA-309065
GitOrigin-RevId: de044d57c690772aefc7044d87159c42ebc92907
Most of the implementations (except for Java) had to introduce default methods that are actually not used
Deprecate unused methods
GitOrigin-RevId: 6019cb0da09a6bc1d28d05a5222736573e7c747b
Idea class loader in tests leaks for FileComparisonFailure. It takes FileComparisonFailure from IDE's local installation instead of test module dependency.
GitOrigin-RevId: 94d4867f5a169f1079482844bcaf67440ffa167d
Reset initial tree state until after the 'SingleChangeListCommitWorkflowHandler.activate' is called,
as up-to-date inclusion is used to compute initial selection.
Follow-up: 20b8582f9186083c6b4470d7b85b5aa0eba2557a
4b2df3f6754161cb35289a3f483b19c9056aa780
GitOrigin-RevId: 804419b8f32673c5f94e09271bf7f3891ea44abf