1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-03-26 07:20:09 +08:00

Migrate use of deprecated LineMarkerInfo constructor

This commit is contained in:
Him188 2022-04-20 17:56:12 +01:00
parent 481973d5e6
commit d7f66e3ba5
2 changed files with 16 additions and 28 deletions
mirai-console/tools/intellij-plugin/src/line/marker

View File

@ -1,10 +1,10 @@
/*
* Copyright 2019-2021 Mamoe Technologies and contributors.
* Copyright 2019-2022 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.console.intellij.line.marker
@ -42,18 +42,13 @@ class CommandDeclarationLineMarkerProvider : LineMarkerProvider {
}
@Suppress("DEPRECATION")
class Info(callElement: PsiElement) : LineMarkerInfo<PsiElement>(
callElement,
callElement.textRange,
Icons.CommandDeclaration,
tooltipProvider,
null, GutterIconRenderer.Alignment.RIGHT
) {
companion object {
val tooltipProvider = { _: PsiElement ->
"子指令定义"
}
}
}
{ "子指令定义" },
null,
GutterIconRenderer.Alignment.RIGHT,
{ "子指令定义" }
)
}

View File

@ -1,10 +1,10 @@
/*
* Copyright 2019-2021 Mamoe Technologies and contributors.
* Copyright 2019-2022 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.console.intellij.line.marker
@ -29,20 +29,13 @@ class PluginMainLineMarkerProvider : LineMarkerProvider {
}
@Suppress("DEPRECATION")
class Info(callElement: PsiElement) : LineMarkerInfo<PsiElement>(
// this constructor is deprecated but is not going to be removed. The newer ones are since 203 which is too high.
callElement,
callElement.textRange,
Icons.PluginMainDeclaration,
tooltipProvider,
null, GutterIconRenderer.Alignment.RIGHT
{ "Mirai Console Plugin" },
null, GutterIconRenderer.Alignment.RIGHT,
{ "Mirai Console Plugin" }
) {
companion object {
val tooltipProvider = { _: PsiElement ->
"Mirai Console Plugin"
}
}
}
}