Skip to content

Commit

Permalink
refactor: remove internal api
Browse files Browse the repository at this point in the history
  • Loading branch information
lauvsong committed Jan 14, 2024
1 parent 04618ed commit b4bbee3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import com.intellij.ide.AppLifecycleListener

class IdeLifeCycleListener : AppLifecycleListener {

override fun appStarted() {
super.appStarted()
LanguageCheckService.start()
}

override fun appClosing() {
super.appClosing()
LanguageCheckService.shutdown()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.lauvsong.langcursor

import com.github.lauvsong.langcursor.services.LanguageCheckService
import com.github.lauvsong.langcursor.services.NotifyService
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.StartupActivity
Expand All @@ -11,9 +12,15 @@ class ProjectOpenStartUpActivity : StartupActivity.DumbAware {
if (isNotSupportedOs()) {
NotifyService.notifyNotSupportedOs(project)
}

initLanguageCheckService()
}

private fun isNotSupportedOs(): Boolean {
return !(SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC)
}

private fun initLanguageCheckService() {
LanguageCheckService
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ object LanguageCheckService {
private val scheduledExecutor: ScheduledExecutorService = Executors.newScheduledThreadPool(1)
private const val INTERVAL_MILLIS = 200L

fun start() {
init {
start()
}

private fun start() {
scheduledExecutor.scheduleAtFixedRate(
{ switchCursorColorByLanguage() },
0,
Expand Down

0 comments on commit b4bbee3

Please sign in to comment.