Skip to content

Commit 839dccd

Browse files
committed
feat: handle configuration changes from the app
1 parent c5710e4 commit 839dccd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/chat.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type ExtensionMessage =
2525
request: "openLink";
2626
linkType: "url" | "file" | "directory";
2727
link: string;
28+
documentRange: DocumentRange | null;
2829
}
2930
| {
3031
target: "extension";
@@ -35,6 +36,13 @@ export type ExtensionMessage =
3536
target: "extension";
3637
request: "insertAtCursor";
3738
content: string;
39+
}
40+
| {
41+
target: "extension";
42+
request: "updateConfiguration";
43+
section: string;
44+
value: any;
45+
configurationTarget: boolean;
3846
};
3947

4048
type LanguageServerMessage = {
@@ -107,6 +115,15 @@ export class ChatProvider implements vscode.WebviewViewProvider {
107115
this.handleInsertAtCursorRequest(message);
108116
break;
109117
}
118+
case "updateConfiguration": {
119+
await vscode.workspace
120+
.getConfiguration()
121+
.update(
122+
message.section,
123+
message.value,
124+
message.configurationTarget
125+
);
126+
}
110127
}
111128
}
112129
}

0 commit comments

Comments
 (0)