Skip to content

Commit

Permalink
feat: handle configuration changes from the app
Browse files Browse the repository at this point in the history
  • Loading branch information
bm424 committed Dec 12, 2023
1 parent c5710e4 commit 839dccd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type ExtensionMessage =
request: "openLink";
linkType: "url" | "file" | "directory";
link: string;
documentRange: DocumentRange | null;
}
| {
target: "extension";
Expand All @@ -35,6 +36,13 @@ export type ExtensionMessage =
target: "extension";
request: "insertAtCursor";
content: string;
}
| {
target: "extension";
request: "updateConfiguration";
section: string;
value: any;
configurationTarget: boolean;
};

type LanguageServerMessage = {
Expand Down Expand Up @@ -107,6 +115,15 @@ export class ChatProvider implements vscode.WebviewViewProvider {
this.handleInsertAtCursorRequest(message);
break;
}
case "updateConfiguration": {
await vscode.workspace
.getConfiguration()
.update(
message.section,
message.value,
message.configurationTarget
);
}
}
}
}
Expand Down

0 comments on commit 839dccd

Please sign in to comment.