forked from catppuccin/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: trigger re-compile after updating the extension
- Loading branch information
1 parent
0ad0367
commit 1fcf30f
Showing
4 changed files
with
84 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
import { workspace, window, ConfigurationChangeEvent } from "vscode"; | ||
import { workspace, ConfigurationChangeEvent } from "vscode"; | ||
import { getThemePaths } from "./helpers"; | ||
import utils from "./utils"; | ||
import utils, { UpdateTrigger } from "./utils"; | ||
|
||
export const activate = () => { | ||
const config = utils.getConfiguration(); | ||
const paths = getThemePaths(); | ||
|
||
// regenerate the theme files when the config changes | ||
workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => { | ||
if (event.affectsConfiguration("catppuccin")) { | ||
const config = utils.getConfiguration(); | ||
const paths = getThemePaths(); | ||
utils.updateThemes(config, paths); | ||
window.showInformationMessage( | ||
"Catppuccin Configuration changed, re-generating the JSON theme." | ||
); | ||
utils.updateThemes(config, paths, UpdateTrigger.CONFIG_CHANGE); | ||
} | ||
}); | ||
|
||
// regenerate on a fresh install if non-default config is set | ||
if (utils.isFreshInstall() && !utils.isDefaultConfig()) { | ||
utils.updateThemes(config, paths, UpdateTrigger.FRESH_INSTALL); | ||
} | ||
}; | ||
|
||
export const deactivate = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters