@@ -31,6 +31,7 @@ interface extensionConfiguration {
31
31
enable : boolean ;
32
32
maxLength : number | null ;
33
33
} ;
34
+ codeLens : boolean ;
34
35
binaryPath : string | null ;
35
36
}
36
37
let extensionConfiguration : extensionConfiguration = {
@@ -39,6 +40,7 @@ let extensionConfiguration: extensionConfiguration = {
39
40
enable : false ,
40
41
maxLength : 25
41
42
} ,
43
+ codeLens : false ,
42
44
binaryPath : null ,
43
45
} ;
44
46
let pullConfigurationPeriodically : NodeJS . Timeout | null = null ;
@@ -230,6 +232,9 @@ let compilerLogsWatcher = chokidar
230
232
if ( extensionConfiguration . inlayHints . enable === true ) {
231
233
sendInlayHintsRefresh ( ) ;
232
234
}
235
+ if ( extensionConfiguration . codeLens === true ) {
236
+ sendCodeLensRefresh ( ) ;
237
+ }
233
238
} ) ;
234
239
let stopWatchingCompilerLog = ( ) => {
235
240
// TODO: cleanup of compilerLogs?
@@ -424,6 +429,15 @@ function codeLens(msg: p.RequestMessage) {
424
429
return response ;
425
430
}
426
431
432
+ function sendCodeLensRefresh ( ) {
433
+ let request : p . RequestMessage = {
434
+ jsonrpc : c . jsonrpcVersion ,
435
+ method : p . CodeLensRefreshRequest . method ,
436
+ id : serverSentRequestIdCounter ++ ,
437
+ } ;
438
+ send ( request ) ;
439
+ }
440
+
427
441
function definition ( msg : p . RequestMessage ) {
428
442
// https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition
429
443
let params = msg . params as p . DefinitionParams ;
@@ -1014,9 +1028,11 @@ function onMessage(msg: p.Message) {
1014
1028
full : true ,
1015
1029
} ,
1016
1030
inlayHintProvider : extensionConfiguration . inlayHints . enable ,
1017
- codeLensProvider : {
1018
- workDoneProgress : false
1019
- } ,
1031
+ codeLensProvider : extensionConfiguration . codeLens
1032
+ ? {
1033
+ workDoneProgress : false ,
1034
+ }
1035
+ : undefined ,
1020
1036
} ,
1021
1037
} ;
1022
1038
let response : p . ResponseMessage = {
0 commit comments