J2K: KtTypeCodeFragment.java
This commit is contained in:
@@ -14,25 +14,20 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.psi;
|
package org.jetbrains.kotlin.psi
|
||||||
|
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.kotlin.KtNodeTypes
|
||||||
import org.jetbrains.kotlin.KtNodeTypes;
|
|
||||||
|
|
||||||
public class KtTypeCodeFragment extends KtCodeFragment {
|
class KtTypeCodeFragment(
|
||||||
public KtTypeCodeFragment(Project project, String name, CharSequence text, PsiElement context) {
|
project: Project,
|
||||||
super(project, name, text, null, KtNodeTypes.TYPE_CODE_FRAGMENT, context);
|
name: String,
|
||||||
}
|
text: CharSequence,
|
||||||
|
context: PsiElement?
|
||||||
|
) : KtCodeFragment(project, name, text, null, KtNodeTypes.TYPE_CODE_FRAGMENT, context) {
|
||||||
|
override fun getContentElement() = findChildByClass(KtTypeReference::class.java)
|
||||||
|
|
||||||
public boolean hasTypeReference() {
|
val hasTypeReference: Boolean
|
||||||
return getContentElement() != null;
|
get() = getContentElement() != null
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public KtTypeReference getContentElement() {
|
|
||||||
return findChildByClass(KtTypeReference.class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -449,6 +449,6 @@ public class KotlinChangeSignatureDialog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun hasTypeReference(codeFragment: PsiCodeFragment?): Boolean
|
private fun hasTypeReference(codeFragment: PsiCodeFragment?): Boolean
|
||||||
= (codeFragment as? KtTypeCodeFragment)?.hasTypeReference() ?: false
|
= (codeFragment as? KtTypeCodeFragment)?.hasTypeReference ?: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user