Fix minor compile warnings
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.kdoc.parser
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
|
||||
enum class KDocKnownTag(val isReferenceRequired: Boolean, val isSectionStart: Boolean) {
|
||||
AUTHOR(false, false),
|
||||
THROWS(true, false),
|
||||
@@ -35,12 +33,11 @@ enum class KDocKnownTag(val isReferenceRequired: Boolean, val isSectionStart: Bo
|
||||
|
||||
companion object {
|
||||
fun findByTagName(tagName: CharSequence): KDocKnownTag? {
|
||||
var tagName = tagName
|
||||
if (StringUtil.startsWith(tagName, "@")) {
|
||||
tagName = tagName.subSequence(1, tagName.length)
|
||||
}
|
||||
val name = if (tagName.startsWith('@')) {
|
||||
tagName.subSequence(1, tagName.length)
|
||||
} else tagName
|
||||
try {
|
||||
return valueOf(tagName.toString().toUpperCase())
|
||||
return valueOf(name.toString().toUpperCase())
|
||||
} catch (ignored: IllegalArgumentException) {
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ object EditCommaSeparatedListHelper {
|
||||
return addItemBefore(list, allItems, item, null, prefix)
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
@JvmOverloads
|
||||
fun <TItem : KtElement> addItemAfter(
|
||||
list: KtElement,
|
||||
|
||||
@@ -292,6 +292,7 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m
|
||||
val file = createFile(text)
|
||||
val declarations = file.declarations
|
||||
assert(declarations.size == 1) { "${declarations.size} declarations in $text" }
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
return declarations.first() as TDeclaration
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user