mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 22:24:14 +00:00
Simplify some more ctors
This commit is contained in:
parent
3c12cd49ec
commit
3717b0e03f
3 changed files with 3 additions and 9 deletions
|
@ -37,12 +37,10 @@ export function analyzerStatus(ctx: Ctx): Cmd {
|
||||||
|
|
||||||
class TextDocumentContentProvider
|
class TextDocumentContentProvider
|
||||||
implements vscode.TextDocumentContentProvider {
|
implements vscode.TextDocumentContentProvider {
|
||||||
private ctx: Ctx;
|
|
||||||
uri = vscode.Uri.parse('rust-analyzer-status://status');
|
uri = vscode.Uri.parse('rust-analyzer-status://status');
|
||||||
eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||||
|
|
||||||
constructor(ctx: Ctx) {
|
constructor(private readonly ctx: Ctx) {
|
||||||
this.ctx = ctx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
provideTextDocumentContent(
|
provideTextDocumentContent(
|
||||||
|
|
|
@ -42,12 +42,10 @@ function code_format(expanded: ExpandedMacro): string {
|
||||||
|
|
||||||
class TextDocumentContentProvider
|
class TextDocumentContentProvider
|
||||||
implements vscode.TextDocumentContentProvider {
|
implements vscode.TextDocumentContentProvider {
|
||||||
private ctx: Ctx;
|
|
||||||
uri = vscode.Uri.parse('rust-analyzer://expandMacro/[EXPANSION].rs');
|
uri = vscode.Uri.parse('rust-analyzer://expandMacro/[EXPANSION].rs');
|
||||||
eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||||
|
|
||||||
constructor(ctx: Ctx) {
|
constructor(private readonly ctx: Ctx) {
|
||||||
this.ctx = ctx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async provideTextDocumentContent(_uri: vscode.Uri): Promise<string> {
|
async provideTextDocumentContent(_uri: vscode.Uri): Promise<string> {
|
||||||
|
|
|
@ -68,12 +68,10 @@ interface SyntaxTreeParams {
|
||||||
|
|
||||||
class TextDocumentContentProvider
|
class TextDocumentContentProvider
|
||||||
implements vscode.TextDocumentContentProvider {
|
implements vscode.TextDocumentContentProvider {
|
||||||
private ctx: Ctx;
|
|
||||||
uri = vscode.Uri.parse('rust-analyzer://syntaxtree');
|
uri = vscode.Uri.parse('rust-analyzer://syntaxtree');
|
||||||
eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
eventEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||||
|
|
||||||
constructor(ctx: Ctx) {
|
constructor(private readonly ctx: Ctx) {
|
||||||
this.ctx = ctx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
provideTextDocumentContent(uri: vscode.Uri): vscode.ProviderResult<string> {
|
provideTextDocumentContent(uri: vscode.Uri): vscode.ProviderResult<string> {
|
||||||
|
|
Loading…
Reference in a new issue