@@ -13,7 +13,7 @@ export function activateInlayHints(ctx: Ctx) {
13
13
if ( ! ctx . config . displayInlayHints ) {
14
14
return this . dispose ( ) ;
15
15
}
16
- if ( ! this . updater ) this . updater = HintsUpdater . create ( ctx ) ;
16
+ if ( ! this . updater ) this . updater = new HintsUpdater ( ctx ) ;
17
17
} ,
18
18
dispose ( ) {
19
19
this . updater ?. dispose ( ) ;
@@ -67,25 +67,21 @@ class HintsUpdater implements Disposable {
67
67
private sourceFiles = new Map < string , RustSourceFile > ( ) ; // map Uri -> RustSourceFile
68
68
private readonly disposables : Disposable [ ] = [ ] ;
69
69
70
- private constructor ( private readonly ctx : Ctx ) { }
71
-
72
- static create ( ctx : Ctx ) {
73
- const self = new HintsUpdater ( ctx ) ;
74
-
70
+ constructor ( private readonly ctx : Ctx ) {
75
71
vscode . window . onDidChangeVisibleTextEditors (
76
- self . onDidChangeVisibleTextEditors ,
77
- self ,
78
- self . disposables
72
+ this . onDidChangeVisibleTextEditors ,
73
+ this ,
74
+ this . disposables
79
75
) ;
80
76
81
77
vscode . workspace . onDidChangeTextDocument (
82
- self . onDidChangeTextDocument ,
83
- self ,
84
- self . disposables
78
+ this . onDidChangeTextDocument ,
79
+ this ,
80
+ this . disposables
85
81
) ;
86
82
87
83
// Set up initial cache shape
88
- ctx . visibleRustEditors . forEach ( editor => self . sourceFiles . set (
84
+ ctx . visibleRustEditors . forEach ( editor => this . sourceFiles . set (
89
85
editor . document . uri . toString ( ) ,
90
86
{
91
87
document : editor . document ,
@@ -94,9 +90,7 @@ class HintsUpdater implements Disposable {
94
90
}
95
91
) ) ;
96
92
97
- self . syncCacheAndRenderHints ( ) ;
98
-
99
- return self ;
93
+ this . syncCacheAndRenderHints ( ) ;
100
94
}
101
95
102
96
dispose ( ) {
0 commit comments