@@ -19,12 +19,25 @@ export async function activate(context: vscode.ExtensionContext) {
1919 sendTelemetry : true ,
2020 } ) ;
2121
22- const provider = new ChatPanel ( context . extensionUri ) ;
23- context . subscriptions . push (
24- vscode . window . registerWebviewViewProvider ( "firecoder.chat-gui" , provider , {
25- webviewOptions : { retainContextWhenHidden : true } ,
26- } )
27- ) ;
22+ const isChatEnabled = configuration . get ( "experimental.chat" ) ;
23+
24+ if ( isChatEnabled ) {
25+ const provider = new ChatPanel ( context . extensionUri ) ;
26+ context . subscriptions . push (
27+ vscode . window . registerWebviewViewProvider (
28+ "firecoder.chat-gui" ,
29+ provider ,
30+ {
31+ webviewOptions : { retainContextWhenHidden : true } ,
32+ }
33+ )
34+ ) ;
35+ context . subscriptions . push (
36+ vscode . commands . registerCommand ( "firecoder.startNewChat" , async ( ) => {
37+ await provider . sendMessageToWebview ( "startNewChat" , { } ) ;
38+ } )
39+ ) ;
40+ }
2841
2942 statusBar . init ( context ) ;
3043
@@ -44,12 +57,6 @@ export async function activate(context: vscode.ExtensionContext) {
4457 )
4558 ) ;
4659
47- context . subscriptions . push (
48- vscode . commands . registerCommand ( "firecoder.startNewChat" , async ( ) => {
49- await provider . sendMessageToWebview ( "startNewChat" , { } ) ;
50- } )
51- ) ;
52-
5360 context . subscriptions . push (
5461 vscode . commands . registerCommand ( "firecoder.inlineSuggest" , async ( ) => {
5562 await vscode . commands . executeCommand (
@@ -65,9 +72,7 @@ export async function activate(context: vscode.ExtensionContext) {
6572 ...new Set ( [
6673 configuration . get ( "completion.autoMode" ) ,
6774 configuration . get ( "completion.manuallyMode" ) ,
68- ...( configuration . get ( "experimental.chat" )
69- ? [ "chat-medium" as const ]
70- : [ ] ) ,
75+ ...( isChatEnabled ? [ "chat-medium" as const ] : [ ] ) ,
7176 ] ) ,
7277 ] . map ( ( serverType ) => servers [ serverType ] . startServer ( ) )
7378 ) ;
0 commit comments