mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Use ??= in more places (#163594)
This commit is contained in:
@@ -21,10 +21,7 @@ export class FindFileReferencesCommand implements Command {
|
||||
) { }
|
||||
|
||||
public async execute(resource?: vscode.Uri) {
|
||||
if (!resource) {
|
||||
resource = vscode.window.activeTextEditor?.document.uri;
|
||||
}
|
||||
|
||||
resource ??= vscode.window.activeTextEditor?.document.uri;
|
||||
if (!resource) {
|
||||
vscode.window.showErrorMessage(localize('error.noResource', "Find file references failed. No resource provided."));
|
||||
return;
|
||||
|
||||
@@ -35,9 +35,7 @@ export class VsCodeOutputLogger extends Disposable implements ILogger {
|
||||
private _outputChannel?: vscode.OutputChannel;
|
||||
|
||||
private get outputChannel() {
|
||||
if (!this._outputChannel) {
|
||||
this._outputChannel = this._register(vscode.window.createOutputChannel('Markdown'));
|
||||
}
|
||||
this._outputChannel ??= this._register(vscode.window.createOutputChannel('Markdown'));
|
||||
return this._outputChannel;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,9 +144,7 @@ class VSCodeExtensionMarkdownContributionProvider extends Disposable implements
|
||||
public readonly onContributionsChanged = this._onContributionsChanged.event;
|
||||
|
||||
public get contributions(): MarkdownContributions {
|
||||
if (!this._contributions) {
|
||||
this._contributions = this.getCurrentContributions();
|
||||
}
|
||||
this._contributions ??= this.getCurrentContributions();
|
||||
return this._contributions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user