Explorar el Código

update NotificationGroup id and remove deprecated file

windchargerj hace 5 meses
padre
commit
1f07b76d43

+ 1 - 1
src/main/kotlin/io/xmake/actions/BuildAction.kt

@@ -42,7 +42,7 @@ class BuildAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/CleanAction.kt

@@ -42,7 +42,7 @@ class CleanAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/CleanConfigurationAction.kt

@@ -31,7 +31,7 @@ class CleanConfigurationAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/QuickStartAction.kt

@@ -29,7 +29,7 @@ class QuickStartAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/RebuildAction.kt

@@ -42,7 +42,7 @@ class RebuildAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/RunAction.kt

@@ -49,7 +49,7 @@ class RunAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/UpdateCmakeListsAction.kt

@@ -65,7 +65,7 @@ class UpdateCmakeListsAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 1 - 1
src/main/kotlin/io/xmake/actions/UpdateCompileCommandsAction.kt

@@ -70,7 +70,7 @@ class UpdateCompileCommandsAction : AnAction() {
                 ConsoleViewContentType.ERROR_OUTPUT
             )
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Configuration", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
         }

+ 0 - 82
src/main/kotlin/io/xmake/utils/ConsoleProcessHandler.kt

@@ -1,82 +0,0 @@
-package io.xmake.utils
-
-import com.intellij.execution.configurations.GeneralCommandLine
-import com.intellij.execution.process.KillableColoredProcessHandler
-import com.intellij.execution.process.ProcessTerminatedListener
-import com.intellij.execution.ui.ConsoleView
-import com.intellij.execution.ui.ConsoleViewContentType
-import com.intellij.openapi.diagnostic.Logger
-import com.intellij.openapi.util.Key
-import java.io.IOException
-import java.io.OutputStreamWriter
-
-@Deprecated("Please refer to runProcessWithHandler.")
-class ConsoleProcessHandler(
-    private val consoleView: ConsoleView,
-    commandLine: GeneralCommandLine,
-    showExitCode: Boolean = false
-) : KillableColoredProcessHandler(commandLine) {
-
-    // the output content
-    var outputContent = ""
-
-    // initialize
-    init {
-
-        // shows exit code upon termination
-        if (showExitCode) {
-            ProcessTerminatedListener.attach(this)
-        }
-    }
-
-    override fun coloredTextAvailable(textOriginal: String, attributes: Key<*>) {
-        append(textOriginal, attributes)
-    }
-
-    // append info to the console view
-    private fun append(s: String, k: Key<*>) {
-        this.consoleView.print(s, ConsoleViewContentType.getConsoleViewType(k))
-        outputContent += s
-    }
-
-    // append input info to the console view
-    fun input(s: String) {
-        try {
-            processInputWriter.append(s)
-        } catch (ex: IOException) {
-            Log.error(ex)
-        }
-    }
-
-    // append input info and flush it
-    fun inputWithFlush(s: String) {
-        try {
-            processInputWriter.append(s)
-            processInputWriter.flush()
-        } catch (ex: IOException) {
-            Log.error(ex)
-        }
-    }
-
-    var _outputStreamWriter: OutputStreamWriter? = null
-    private val processInputWriter: OutputStreamWriter
-        get() {
-            if (_outputStreamWriter == null) {
-                _outputStreamWriter = OutputStreamWriter(processInput)
-            }
-            return _outputStreamWriter ?: OutputStreamWriter(processInput)
-        }
-
-    // flush io
-    fun flush() {
-        try {
-            processInputWriter.flush()
-        } catch (ex: IOException) {
-            Log.error(ex)
-        }
-    }
-
-    companion object {
-        private val Log = Logger.getInstance(ConsoleProcessHandler::class.java.getName())
-    }
-}

+ 1 - 1
src/main/kotlin/io/xmake/utils/SystemUtils.kt

@@ -78,7 +78,7 @@ object SystemUtils {
             }
         } catch (e: XMakeToolkitNotSetException) {
             NotificationGroupManager.getInstance()
-                .getNotificationGroup("XMake")
+                .getNotificationGroup("XMake.NotificationGroup")
                 .createNotification("Error with XMake Toolkit", e.message ?: "", NotificationType.ERROR)
                 .notify(project)
             throw ProcessNotCreatedException(e.message ?: "", commandLine)

+ 1 - 1
src/main/resources/META-INF/plugin.xml

@@ -50,7 +50,7 @@
         <runConfigurationProducer implementation="io.xmake.run.XMakeRunConfigurationProducer"/>
 
         <!-- notifications -->
-        <notificationGroup id="XMake" displayType="BALLOON"/>
+        <notificationGroup id="XMake.NotificationGroup" displayType="BALLOON"/>
 
         <fileType name="xmake.lua" language="xmake.lua" fieldName="INSTANCE"
                   fileNames="xmake.lua" fileNamesCaseInsensitive="xmake.lua"