Skip to content

Commit d3616ab

Browse files
author
hongyu9
committed
refactor: Optimize the processing logic of theme files and add a default method for theme directories
1 parent 40a7239 commit d3616ab

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

jetbrains_plugin/src/main/kotlin/com/sina/weibo/agent/core/RPCManager.kt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,28 @@ class RPCManager(
5454
// Send empty configuration model
5555
logger.info("Sending configuration information to extension process")
5656
val themeName =
57-
if (ThemeManager.getInstance().isDarkThemeForce()) "Default Dark Modern" else "Default Light Modern"
57+
if (ThemeManager.getInstance().isDarkThemeForce()) "Visual Studio 2017 Dark - C++" else "Visual Studio 2017 Light - C++"
5858

59-
// Create empty configuration model
60-
val emptyMap = mapOf(
61-
"contents" to emptyMap<String, Any>(),
62-
"keys" to emptyList<String>(),
63-
"overrides" to emptyList<String>()
64-
)
6559
// Get proxy configuration
6660
val httpProxyConfig = ProxyConfigUtil.getHttpProxyConfigForInitialization()
67-
61+
6862
// Build configuration contents
6963
val contentsBuilder = mutableMapOf<String, Any>(
70-
"workbench" to mapOf("colorTheme" to themeName)
64+
"workbench.colorTheme" to themeName
7165
)
72-
66+
7367
// Add proxy configuration if available
7468
httpProxyConfig?.let {
7569
contentsBuilder["http"] = it
7670
logger.info("Using proxy configuration for initialization: $it")
7771
}
72+
73+
// Create empty configuration model
74+
val emptyMap = mapOf(
75+
"contents" to emptyMap<String, Any>(),
76+
"keys" to emptyList<String>(),
77+
"overrides" to emptyList<String>()
78+
)
7879

7980
val emptyConfigModel = mapOf(
8081
"defaults" to mapOf(

jetbrains_plugin/src/main/kotlin/com/sina/weibo/agent/theme/ThemeManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import com.intellij.openapi.application.ApplicationManager
1515
import com.intellij.openapi.diagnostic.Logger
1616
import com.intellij.openapi.util.Disposer
1717
import com.intellij.util.messages.MessageBusConnection
18+
import com.sina.weibo.agent.core.ServiceProxyRegistry
1819
import java.io.File
1920
import java.io.IOException
2021
import java.io.InputStream
@@ -64,7 +65,7 @@ class ThemeManager : Disposable {
6465

6566
// JSON serialization
6667
private val gson = Gson()
67-
68+
6869
/**
6970
* Initialize theme manager
7071
* @param resourceRoot Theme resource root directory

0 commit comments

Comments
 (0)