@@ -69,6 +69,11 @@ interface OutputNotificationBody {
69
69
output : string ;
70
70
}
71
71
72
+ interface InactiveRegionParams {
73
+ uri : string ;
74
+ ranges : vscode . Range [ ] ;
75
+ }
76
+
72
77
// Requests
73
78
const NavigationListRequest : RequestType < TextDocumentIdentifier , string , void , void > = new RequestType < TextDocumentIdentifier , string , void , void > ( 'cpptools/requestNavigationList' ) ;
74
79
const GoToDeclarationRequest : RequestType < void , void , void , void > = new RequestType < void , void , void , void > ( 'cpptools/goToDeclaration' ) ;
@@ -97,6 +102,7 @@ const ReportTagParseStatusNotification: NotificationType<ReportStatusNotificatio
97
102
const ReportStatusNotification : NotificationType < ReportStatusNotificationBody , void > = new NotificationType < ReportStatusNotificationBody , void > ( 'cpptools/reportStatus' ) ;
98
103
const DebugProtocolNotification : NotificationType < OutputNotificationBody , void > = new NotificationType < OutputNotificationBody , void > ( 'cpptools/debugProtocol' ) ;
99
104
const DebugLogNotification : NotificationType < OutputNotificationBody , void > = new NotificationType < OutputNotificationBody , void > ( 'cpptools/debugLog' ) ;
105
+ const InactiveRegionNotification : NotificationType < InactiveRegionParams , void > = new NotificationType < InactiveRegionParams , void > ( 'cpptools/inactiveRegions' ) ;
100
106
101
107
const maxSettingLengthForTelemetry : number = 50 ;
102
108
let previousCppSettings : { [ key : string ] : any } = { } ;
@@ -434,6 +440,7 @@ class DefaultClient implements Client {
434
440
this . languageClient . onNotification ( ReportNavigationNotification , ( e ) => this . navigate ( e ) ) ;
435
441
this . languageClient . onNotification ( ReportStatusNotification , ( e ) => this . updateStatus ( e ) ) ;
436
442
this . languageClient . onNotification ( ReportTagParseStatusNotification , ( e ) => this . updateTagParseStatus ( e ) ) ;
443
+ this . languageClient . onNotification ( InactiveRegionNotification , ( e ) => this . updateInactiveRegions ( e ) ) ;
437
444
this . setupOutputHandlers ( ) ;
438
445
}
439
446
@@ -620,6 +627,16 @@ class DefaultClient implements Client {
620
627
this . model . tagParserStatus . Value = notificationBody . status ;
621
628
}
622
629
630
+ private updateInactiveRegions ( params : InactiveRegionParams ) : void {
631
+ let renderOptions : vscode . DecorationRenderOptions = {
632
+ color : "rgba(255,0,255,0.5)"
633
+ } ;
634
+ let textEditorDecoration = vscode . window . createTextEditorDecorationType ( renderOptions ) ;
635
+
636
+ let editor = vscode . window . visibleTextEditors . find ( e => e . document . uri . toString ( ) == params . uri ) ; // document.uri == params.uri
637
+ editor . setDecorations ( textEditorDecoration , params . ranges ) ;
638
+ }
639
+
623
640
/*********************************************
624
641
* requests to the language server
625
642
*********************************************/
0 commit comments