generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/com/github/dcsmf/intellijformatmethodsplugin/utils/MethodUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.github.dcsmf.intellijformatmethodsplugin.utils | ||
|
||
import com.intellij.psi.PsiMethod | ||
|
||
object MethodUtil { | ||
/** | ||
* 构建带权限标识符、返回类型、泛型声明、函数名、参数列表和throws的JVM风格函数定义 | ||
* default <T> void buildDefaultField(String userId, @NotNull Group group, T t) throws Exception {System.out.println(t);} | ||
* | ||
*/ | ||
@JvmStatic | ||
fun getJvmStyleSignature(method: PsiMethod): String { | ||
if(method.isConstructor){ | ||
val returnTypeElement=method.returnTypeElement | ||
} | ||
return with(method) { | ||
modifierList.text | ||
} | ||
} | ||
} |