@@ -62,9 +62,11 @@ export class Ctx {
62
62
this . traceOutputChannel = vscode . window . createOutputChannel (
63
63
"Rust Analyzer Language Server Trace"
64
64
) ;
65
+ this . pushExtCleanup ( this . traceOutputChannel ) ;
65
66
}
66
67
if ( ! this . outputChannel ) {
67
68
this . outputChannel = vscode . window . createOutputChannel ( "Rust Analyzer Language Server" ) ;
69
+ this . pushExtCleanup ( this . outputChannel ) ;
68
70
}
69
71
70
72
if ( ! this . client ) {
@@ -139,25 +141,10 @@ export class Ctx {
139
141
return editor && isRustEditor ( editor ) ? editor : undefined ;
140
142
}
141
143
142
- get visibleRustEditors ( ) : RustEditor [ ] {
143
- return vscode . window . visibleTextEditors . filter ( isRustEditor ) ;
144
- }
145
-
146
- registerCommand ( name : string , factory : ( ctx : Ctx ) => Cmd ) {
147
- const fullName = `rust-analyzer.${ name } ` ;
148
- const cmd = factory ( this ) ;
149
- const d = vscode . commands . registerCommand ( fullName , cmd ) ;
150
- this . pushExtCleanup ( d ) ;
151
- }
152
-
153
144
get extensionPath ( ) : string {
154
145
return this . extCtx . extensionPath ;
155
146
}
156
147
157
- get globalState ( ) : vscode . Memento {
158
- return this . extCtx . globalState ;
159
- }
160
-
161
148
get subscriptions ( ) : Disposable [ ] {
162
149
return this . extCtx . subscriptions ;
163
150
}
@@ -201,6 +188,13 @@ export class Ctx {
201
188
statusBar . text = `${ icon } rust-analyzer` ;
202
189
}
203
190
191
+ registerCommand ( name : string , factory : ( ctx : Ctx ) => Cmd ) {
192
+ const fullName = `rust-analyzer.${ name } ` ;
193
+ const cmd = factory ( this ) ;
194
+ const d = vscode . commands . registerCommand ( fullName , cmd ) ;
195
+ this . pushExtCleanup ( d ) ;
196
+ }
197
+
204
198
pushExtCleanup ( d : Disposable ) {
205
199
this . extCtx . subscriptions . push ( d ) ;
206
200
}
0 commit comments