@@ -75,6 +75,11 @@ interface InactiveRegionParams {
75
75
ranges : vscode . Range [ ] ;
76
76
}
77
77
78
+ interface DecorationRangesPair {
79
+ decoration : vscode . TextEditorDecorationType ;
80
+ ranges : vscode . Range [ ] ;
81
+ }
82
+
78
83
// Requests
79
84
const NavigationListRequest : RequestType < TextDocumentIdentifier , string , void , void > = new RequestType < TextDocumentIdentifier , string , void , void > ( 'cpptools/requestNavigationList' ) ;
80
85
const GoToDeclarationRequest : RequestType < void , void , void , void > = new RequestType < void , void , void , void > ( 'cpptools/goToDeclaration' ) ;
@@ -194,11 +199,6 @@ export function createNullClient(): Client {
194
199
return new NullClient ( ) ;
195
200
}
196
201
197
- interface decorationRangesPair {
198
- decoration : vscode . TextEditorDecorationType ;
199
- ranges : vscode . Range [ ] ;
200
- }
201
-
202
202
class DefaultClient implements Client {
203
203
private languageClient : LanguageClient ; // The "client" that launches and communicates with our language "server" process.
204
204
private disposables : vscode . Disposable [ ] = [ ] ;
@@ -211,7 +211,7 @@ class DefaultClient implements Client {
211
211
private crashTimes : number [ ] = [ ] ;
212
212
private failureMessageShown = new PersistentState < boolean > ( "DefaultClient.failureMessageShown" , false ) ;
213
213
private isSupported : boolean = true ;
214
- private inactiveRegionsDecorations = new Map < string , decorationRangesPair > ( ) ;
214
+ private inactiveRegionsDecorations = new Map < string , DecorationRangesPair > ( ) ;
215
215
216
216
// The "model" that is displayed via the UI (status bar).
217
217
private model : ClientModel = {
@@ -399,7 +399,7 @@ class DefaultClient implements Client {
399
399
public onDidChangeVisibleTextEditors ( editors : vscode . TextEditor [ ] ) : void {
400
400
//Apply text decorations to inactive regions
401
401
for ( let e of editors ) {
402
- let valuePair : decorationRangesPair = this . inactiveRegionsDecorations . get ( e . document . uri . toString ( ) ) ;
402
+ let valuePair : DecorationRangesPair = this . inactiveRegionsDecorations . get ( e . document . uri . toString ( ) ) ;
403
403
//if (valuePair !== undefined) {
404
404
e . setDecorations ( valuePair . decoration , valuePair . ranges ) ; // VSCode clears the decorations when the text editor becomes invisible
405
405
//}
@@ -653,15 +653,15 @@ class DefaultClient implements Client {
653
653
let decoration : vscode . TextEditorDecorationType = vscode . window . createTextEditorDecorationType ( renderOptions ) ;
654
654
655
655
// Recycle the active text decorations when we receive a new set of inactive regions
656
- let valuePair : decorationRangesPair = this . inactiveRegionsDecorations . get ( params . uri ) ;
656
+ let valuePair : DecorationRangesPair = this . inactiveRegionsDecorations . get ( params . uri ) ;
657
657
if ( valuePair !== undefined ) {
658
658
// Disposing of and resetting the decoration will undo previously applied text decorations
659
659
valuePair . decoration . dispose ( ) ;
660
660
valuePair . decoration = decoration ;
661
661
662
662
valuePair . ranges = params . ranges ; // As vscode.TextEditor.setDecorations only applies to visible editors, we must cache the range for when another editor becomes visible
663
663
} else { // The entry does not exist. Make a new one
664
- let toInsert : decorationRangesPair = {
664
+ let toInsert : DecorationRangesPair = {
665
665
decoration : decoration ,
666
666
ranges : params . ranges
667
667
} ;
0 commit comments