about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--editors/code/src/commands/analyzer_status.ts4
-rw-r--r--editors/code/src/commands/expand_macro.ts4
-rw-r--r--editors/code/src/commands/syntax_tree.ts4
3 files changed, 3 insertions, 9 deletions
diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts
index cfe7d1af057..6631e8db777 100644
--- a/editors/code/src/commands/analyzer_status.ts
+++ b/editors/code/src/commands/analyzer_status.ts
@@ -37,12 +37,10 @@ export function analyzerStatus(ctx: Ctx): Cmd {
 
 class TextDocumentContentProvider
     implements vscode.TextDocumentContentProvider {
-    private ctx: Ctx;
     uri = vscode.Uri.parse('rust-analyzer-status://status');
     eventEmitter = new vscode.EventEmitter<vscode.Uri>();
 
-    constructor(ctx: Ctx) {
-        this.ctx = ctx;
+    constructor(private readonly ctx: Ctx) {
     }
 
     provideTextDocumentContent(
diff --git a/editors/code/src/commands/expand_macro.ts b/editors/code/src/commands/expand_macro.ts
index dcdde78af5a..6fee6eb41ce 100644
--- a/editors/code/src/commands/expand_macro.ts
+++ b/editors/code/src/commands/expand_macro.ts
@@ -42,12 +42,10 @@ function code_format(expanded: ExpandedMacro): string {
 
 class TextDocumentContentProvider
     implements vscode.TextDocumentContentProvider {
-    private ctx: Ctx;
     uri = vscode.Uri.parse('rust-analyzer://expandMacro/[EXPANSION].rs');
     eventEmitter = new vscode.EventEmitter<vscode.Uri>();
 
-    constructor(ctx: Ctx) {
-        this.ctx = ctx;
+    constructor(private readonly ctx: Ctx) {
     }
 
     async provideTextDocumentContent(_uri: vscode.Uri): Promise<string> {
diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts
index 7dde66ad1a1..2887c96c803 100644
--- a/editors/code/src/commands/syntax_tree.ts
+++ b/editors/code/src/commands/syntax_tree.ts
@@ -68,12 +68,10 @@ interface SyntaxTreeParams {
 
 class TextDocumentContentProvider
     implements vscode.TextDocumentContentProvider {
-    private ctx: Ctx;
     uri = vscode.Uri.parse('rust-analyzer://syntaxtree');
     eventEmitter = new vscode.EventEmitter<vscode.Uri>();
 
-    constructor(ctx: Ctx) {
-        this.ctx = ctx;
+    constructor(private readonly ctx: Ctx) {
     }
 
     provideTextDocumentContent(uri: vscode.Uri): vscode.ProviderResult<string> {