mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-26 07:20:09 +08:00
Add notes
This commit is contained in:
parent
1c9f5f50db
commit
0e0271ec78
@ -18,6 +18,11 @@ import org.jetbrains.kotlin.psi.KtCallExpression
|
|||||||
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
import org.jetbrains.kotlin.psi.KtNamedDeclaration
|
||||||
import org.jetbrains.kotlin.psi.KtTypeProjection
|
import org.jetbrains.kotlin.psi.KtTypeProjection
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如何增加一个错误:
|
||||||
|
* 1. 在 [MiraiConsoleErrors] 添加
|
||||||
|
* 2. 在 [MiraiConsoleErrorsRendering] 添加对应的 render
|
||||||
|
*/
|
||||||
object MiraiConsoleErrors {
|
object MiraiConsoleErrors {
|
||||||
@JvmField
|
@JvmField
|
||||||
val ILLEGAL_PLUGIN_DESCRIPTION = create<PsiElement, String>(ERROR)
|
val ILLEGAL_PLUGIN_DESCRIPTION = create<PsiElement, String>(ERROR)
|
||||||
|
@ -22,6 +22,9 @@ import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
|
|||||||
import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticFactoryToRendererMap
|
import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticFactoryToRendererMap
|
||||||
import org.jetbrains.kotlin.diagnostics.rendering.Renderers
|
import org.jetbrains.kotlin.diagnostics.rendering.Renderers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see MiraiConsoleErrors
|
||||||
|
*/
|
||||||
object MiraiConsoleErrorsRendering : DefaultErrorMessages.Extension {
|
object MiraiConsoleErrorsRendering : DefaultErrorMessages.Extension {
|
||||||
private val MAP = DiagnosticFactoryToRendererMap("MiraiConsole").apply {
|
private val MAP = DiagnosticFactoryToRendererMap("MiraiConsole").apply {
|
||||||
put(
|
put(
|
||||||
|
@ -116,6 +116,7 @@ class ContextualParametersChecker : DeclarationChecker {
|
|||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
fun checkVersionRequirement(inspectionTarget: PsiElement, value: String): Diagnostic? {
|
fun checkVersionRequirement(inspectionTarget: PsiElement, value: String): Diagnostic? {
|
||||||
// TODO: 2020/10/23 checkVersionRequirement
|
// TODO: 2020/10/23 checkVersionRequirement
|
||||||
|
// 实现: 先在 MiraiConsoleErrors 添加一个 error, 再检测 value 并 report 一个错误.
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user