File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
src/main/kotlin/org/domaframework/doma/intellij Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import com.intellij.psi.PsiMethod
2727import com.intellij.psi.util.PsiTreeUtil
2828import org.domaframework.doma.intellij.bundle.MessageBundle
2929import org.domaframework.doma.intellij.common.psi.PsiDaoMethod
30+ import org.domaframework.doma.intellij.common.util.PluginLoggerUtil
3031import org.domaframework.doma.intellij.extension.psi.DomaAnnotationType
3132
3233/* *
@@ -81,9 +82,18 @@ class ConvertSqlAnnotationToFileAction : PsiElementBaseIntentionAction() {
8182 // Do nothing when previewing
8283 if (IntentionPreviewUtils .isIntentionPreviewActive()) return
8384 val method = PsiTreeUtil .getParentOfType(element, PsiMethod ::class .java) ? : return
85+
86+ val startTime = System .nanoTime()
8487 val converter = SqlAnnotationConverter (project, method)
8588 WriteCommandAction .runWriteCommandAction(project) {
8689 converter.convertToSqlFile()
8790 }
91+
92+ PluginLoggerUtil .countLogging(
93+ className = this ::class .java.simpleName,
94+ actionName = " convertSqlAnnotationToFile" ,
95+ inputName = " IntentionAction" ,
96+ start = startTime,
97+ )
8898 }
8999}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import org.domaframework.doma.intellij.bundle.MessageBundle
2525import org.domaframework.doma.intellij.common.dao.findDaoMethod
2626import org.domaframework.doma.intellij.common.isSupportFileType
2727import org.domaframework.doma.intellij.common.psi.PsiDaoMethod
28+ import org.domaframework.doma.intellij.common.util.PluginLoggerUtil
2829import org.domaframework.doma.intellij.extension.psi.DomaAnnotationType
2930
3031/* *
@@ -84,9 +85,18 @@ class ConvertSqlFileToAnnotationAction : PsiElementBaseIntentionAction() {
8485 if (! isSupportFileType(element.containingFile)) return
8586
8687 val daoMethod = findDaoMethod(element.containingFile) ? : return
88+
89+ val startTime = System .nanoTime()
8790 val converter = SqlAnnotationConverter (project, daoMethod)
8891 WriteCommandAction .runWriteCommandAction(project) {
8992 converter.convertToSqlAnnotation()
9093 }
94+
95+ PluginLoggerUtil .countLogging(
96+ className = this ::class .java.simpleName,
97+ actionName = " convertSqlFileToAnnotation" ,
98+ inputName = " IntentionAction" ,
99+ start = startTime,
100+ )
91101 }
92102}
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ class SqlFormatPreProcessor : PreFormatProcessor {
7171 if (source.language != SqlLanguage .INSTANCE && ! isInjectedSqlFile(source)) {
7272 return rangeToReformat
7373 }
74+ logging()
7475
7576 // Do not execute processor processing in single-line text state
7677 if (isInjectedSqlFile(source)) {
@@ -85,8 +86,6 @@ class SqlFormatPreProcessor : PreFormatProcessor {
8586 source : PsiFile ,
8687 rangeToReformat : TextRange ,
8788 ): ProcessResult {
88- logging()
89-
9089 val visitor = SqlFormatVisitor ()
9190 source.accept(visitor)
9291
You can’t perform that action at this time.
0 commit comments