@@ -69,6 +69,11 @@ interface OutputNotificationBody {
6969 output : string ;
7070}
7171
72+ interface InactiveRegionParams {
73+ uri : string ;
74+ ranges : vscode . Range [ ] ;
75+ }
76+
7277// Requests
7378const NavigationListRequest : RequestType < TextDocumentIdentifier , string , void , void > = new RequestType < TextDocumentIdentifier , string , void , void > ( 'cpptools/requestNavigationList' ) ;
7479const GoToDeclarationRequest : RequestType < void , void , void , void > = new RequestType < void , void , void , void > ( 'cpptools/goToDeclaration' ) ;
@@ -97,6 +102,7 @@ const ReportTagParseStatusNotification: NotificationType<ReportStatusNotificatio
97102const ReportStatusNotification : NotificationType < ReportStatusNotificationBody , void > = new NotificationType < ReportStatusNotificationBody , void > ( 'cpptools/reportStatus' ) ;
98103const DebugProtocolNotification : NotificationType < OutputNotificationBody , void > = new NotificationType < OutputNotificationBody , void > ( 'cpptools/debugProtocol' ) ;
99104const DebugLogNotification : NotificationType < OutputNotificationBody , void > = new NotificationType < OutputNotificationBody , void > ( 'cpptools/debugLog' ) ;
105+ const InactiveRegionNotification : NotificationType < InactiveRegionParams , void > = new NotificationType < InactiveRegionParams , void > ( 'cpptools/inactiveRegions' ) ;
100106
101107const maxSettingLengthForTelemetry : number = 50 ;
102108let previousCppSettings : { [ key : string ] : any } = { } ;
@@ -434,6 +440,7 @@ class DefaultClient implements Client {
434440 this . languageClient . onNotification ( ReportNavigationNotification , ( e ) => this . navigate ( e ) ) ;
435441 this . languageClient . onNotification ( ReportStatusNotification , ( e ) => this . updateStatus ( e ) ) ;
436442 this . languageClient . onNotification ( ReportTagParseStatusNotification , ( e ) => this . updateTagParseStatus ( e ) ) ;
443+ this . languageClient . onNotification ( InactiveRegionNotification , ( e ) => this . updateInactiveRegions ( e ) ) ;
437444 this . setupOutputHandlers ( ) ;
438445 }
439446
@@ -620,6 +627,16 @@ class DefaultClient implements Client {
620627 this . model . tagParserStatus . Value = notificationBody . status ;
621628 }
622629
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+
623640 /*********************************************
624641 * requests to the language server
625642 *********************************************/
0 commit comments