New J2K: Add dependency to idea-core in j2k
This commit is contained in:
committed by
Ilya Kirillov
parent
29c536579f
commit
41640e1a15
@@ -14,7 +14,6 @@ dependencies {
|
||||
compile(project(":compiler:frontend.script"))
|
||||
compile(project(":compiler:light-classes"))
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":j2k"))
|
||||
compile(project(":idea:ide-common"))
|
||||
compile(project(":idea:idea-jps-common"))
|
||||
compile(project(":plugins:android-extensions-compiler"))
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.j2k
|
||||
|
||||
import com.intellij.psi.JavaDocTokenType
|
||||
import com.intellij.psi.PsiWhiteSpace
|
||||
import com.intellij.psi.javadoc.PsiDocComment
|
||||
import com.intellij.psi.javadoc.PsiDocTag
|
||||
|
||||
interface DocCommentConverter {
|
||||
fun convertDocComment(docComment: PsiDocComment): String
|
||||
}
|
||||
|
||||
object EmptyDocCommentConverter : DocCommentConverter {
|
||||
override fun convertDocComment(docComment: PsiDocComment) = docComment.text
|
||||
}
|
||||
|
||||
|
||||
fun PsiDocTag.content(): String =
|
||||
children
|
||||
.dropWhile { it?.node?.elementType == JavaDocTokenType.DOC_TAG_NAME }
|
||||
.dropWhile { it is PsiWhiteSpace }
|
||||
.filterNot { it?.node?.elementType == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS }
|
||||
.joinToString("") { it.text }
|
||||
@@ -28,8 +28,8 @@ import com.intellij.psi.xml.XmlFile
|
||||
import com.intellij.psi.xml.XmlTag
|
||||
import com.intellij.psi.xml.XmlText
|
||||
import com.intellij.psi.xml.XmlTokenType
|
||||
import org.jetbrains.kotlin.j2k.DocCommentConverter
|
||||
import org.jetbrains.kotlin.j2k.content
|
||||
import org.jetbrains.kotlin.idea.j2k.DocCommentConverter
|
||||
import org.jetbrains.kotlin.idea.j2k.content
|
||||
|
||||
object IdeaDocCommentConverter : DocCommentConverter {
|
||||
override fun convertDocComment(docComment: PsiDocComment): String {
|
||||
|
||||
Reference in New Issue
Block a user