✨ jetbrains config reloading on save

This commit is contained in:
Nate Sesti 2024-02-18 18:50:26 -08:00
parent d982f79143
commit 3d775633fa
5 changed files with 9 additions and 7 deletions

View file

@ -52,10 +52,11 @@ export class ConfigHandler {
console.warn("Failed to load workspace configs");
}
const ideInfo = await this.ide.getIdeInfo();
this.savedConfig = await loadFullConfigNode(
this.ide.readFile,
workspaceConfigs,
(await this.ide.getIdeInfo()).ideType
ideInfo.ideType
);
this.savedConfig.allowAnonymousTelemetry =
this.savedConfig.allowAnonymousTelemetry &&

View file

@ -39,7 +39,7 @@ export type Protocol = {
Promise<BrowserSerializedContinueConfig>,
];
"config/deleteModel": [{ title: string }, void];
"config/reload": [undefined, void];
"config/reload": [undefined, Promise<BrowserSerializedContinueConfig>];
"context/getContextItems": [
{
name: string;

View file

@ -102,7 +102,8 @@ class CoreMessenger(continueCorePath: String, ideProtocolClient: IdeProtocolClie
"getSearchResults",
"getProblems",
"subprocess",
"getBranch"
"getBranch",
"getIdeInfo"
)
init {

View file

@ -83,7 +83,10 @@ export class Core {
on("config/deleteModel", (msg) => {
deleteModel(msg.data.title);
});
on("config/reload", (msg) => {});
on("config/reload", (msg) => {
this.configHandler.reloadConfig();
return this.configHandler.getSerializedConfig();
});
// Context providers
on("context/addDocs", async (msg) => {

View file

@ -49,9 +49,6 @@ export class IpcMessenger {
// Call handler and respond with return value
const listeners = this.typeListeners.get(msg.messageType as any);
if (!listeners) {
console.log("No listeners for messageType: ", msg.messageType);
}
listeners?.forEach(async (handler) => {
try {
const response = await handler(msg);