|
1 | 1 | import * as vscode from "vscode"; |
2 | 2 | import cmd = require("node-cmd"); |
3 | 3 | import util = require("util"); |
| 4 | +import { gte } from "semver"; |
| 5 | + |
4 | 6 | import { fileExists, outputChannel } from "../utils"; |
5 | 7 |
|
6 | 8 | /** Run a command using `node-cmd` and return a Promise */ |
@@ -323,19 +325,22 @@ export async function loadStudioColors(languageServerExt: vscode.Extension<any> |
323 | 325 | 128 |
324 | 326 | ? "Dark" |
325 | 327 | : "Light"; |
| 328 | + const themeName = `InterSystems Default ${darkLight}${ |
| 329 | + gte(languageServerExt.packageJSON.version, "2.4.0") ? " Modern" : "" |
| 330 | + }`; |
326 | 331 |
|
327 | 332 | // Modify the theme |
328 | 333 | const editorConfig = vscode.workspace.getConfiguration("editor"); |
329 | 334 | const workbenchConfig = vscode.workspace.getConfiguration("workbench"); |
330 | 335 | const tokensConfig = editorConfig.get("semanticTokenColorCustomizations"); |
331 | | - tokensConfig[`[InterSystems Default ${darkLight}]`] = { rules }; |
| 336 | + tokensConfig[`[${themeName}]`] = { rules }; |
332 | 337 | await editorConfig.update("semanticTokenColorCustomizations", tokensConfig, true); |
333 | 338 | const colorsConfig = workbenchConfig.get("colorCustomizations"); |
334 | | - colorsConfig[`[InterSystems Default ${darkLight}]`] = { "editor.background": editorBackground }; |
| 339 | + colorsConfig[`[${themeName}]`] = { "editor.background": editorBackground }; |
335 | 340 | await workbenchConfig.update("colorCustomizations", colorsConfig, true); |
336 | 341 |
|
337 | 342 | // Activate it globally |
338 | | - await workbenchConfig.update("colorTheme", `InterSystems Default ${darkLight}`, true); |
| 343 | + await workbenchConfig.update("colorTheme", themeName, true); |
339 | 344 | } |
340 | 345 | ) |
341 | 346 | .then( |
|
0 commit comments