@@ -6,11 +6,10 @@ const seedrandom = seedrandom_; // https://github.com/jvandemo/generator-angular
6
6
import * as scopes from './scopes' ;
7
7
import * as scopesMapper from './scopes_mapper' ;
8
8
9
- import { Server } from './server' ;
10
9
import { Ctx } from './ctx' ;
11
10
12
11
export function activateHighlighting ( ctx : Ctx ) {
13
- const highlighter = new Highlighter ( ) ;
12
+ const highlighter = new Highlighter ( ctx ) ;
14
13
15
14
ctx . client . onReady ( ) . then ( ( ) => {
16
15
ctx . client . onNotification (
@@ -118,6 +117,12 @@ function createDecorationFromTextmate(
118
117
}
119
118
120
119
class Highlighter {
120
+ private ctx : Ctx ;
121
+
122
+ constructor ( ctx : Ctx ) {
123
+ this . ctx = ctx ;
124
+ }
125
+
121
126
private static initDecorations ( ) : Map <
122
127
string ,
123
128
vscode . TextEditorDecorationType
@@ -213,7 +218,7 @@ class Highlighter {
213
218
string ,
214
219
[ vscode . Range [ ] , boolean ]
215
220
> = new Map ( ) ;
216
- const rainbowTime = Server . config . rainbowHighlightingOn ;
221
+ const rainbowTime = this . ctx . config . rainbowHighlightingOn ;
217
222
218
223
for ( const tag of this . decorations . keys ( ) ) {
219
224
byTag . set ( tag , [ ] ) ;
@@ -232,13 +237,13 @@ class Highlighter {
232
237
colorfulIdents
233
238
. get ( d . bindingHash ) ! [ 0 ]
234
239
. push (
235
- Server . client . protocol2CodeConverter . asRange ( d . range ) ,
240
+ this . ctx . client . protocol2CodeConverter . asRange ( d . range ) ,
236
241
) ;
237
242
} else {
238
243
byTag
239
244
. get ( d . tag ) !
240
245
. push (
241
- Server . client . protocol2CodeConverter . asRange ( d . range ) ,
246
+ this . ctx . client . protocol2CodeConverter . asRange ( d . range ) ,
242
247
) ;
243
248
}
244
249
}
0 commit comments