@@ -38,6 +38,10 @@ import { askSourceryCommand } from "./ask-sourcery";
3838
3939function createLangServer ( ) : LanguageClient {
4040 const token = workspace . getConfiguration ( "sourcery" ) . get < string > ( "token" ) ;
41+ const showCodeLens = workspace
42+ . getConfiguration ( "sourcery" )
43+ . get < boolean > ( "codeLens" ) ;
44+
4145 const packageJson = extensions . getExtension ( "sourcery.sourcery" ) . packageJSON ;
4246 const extensionVersion = packageJson . version ;
4347
@@ -76,6 +80,7 @@ function createLangServer(): LanguageClient {
7680 editor_version : "vscode " + version ,
7781 extension_version : extensionVersion ,
7882 telemetry_enabled : env . isTelemetryEnabled ,
83+ show_code_lens : showCodeLens ,
7984 } ,
8085 } ;
8186
@@ -224,6 +229,14 @@ function registerCommands(
224229 } )
225230 ) ;
226231
232+ context . subscriptions . push (
233+ commands . registerCommand ( "sourcery.chat.toggleCodeLens" , ( ) => {
234+ const config = vscode . workspace . getConfiguration ( ) ;
235+ const currentValue = config . get ( "sourcery.codeLens" ) ;
236+ config . update ( "sourcery.codeLens" , ! currentValue ) ;
237+ } )
238+ ) ;
239+
227240 context . subscriptions . push (
228241 commands . registerCommand ( "sourcery.scan.selectLanguage" , ( ) => {
229242 const items = [ "python" , "javascript" ] ;
0 commit comments