Simplify some more ctors

This commit is contained in:
Aleksey Kladov 2020-02-17 14:23:23 +01:00
parent 3c12cd49ec
commit 3717b0e03f
3 changed files with 3 additions and 9 deletions

View file

@ -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(

View file

@ -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> {

View file

@ -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> {