Always require an argument to command

#75612
This commit is contained in:
Matt Bierner
2019-08-20 11:26:49 -07:00
parent f509f7f141
commit 1802be3b70

View File

@@ -3,8 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { SkinnyTextDocument } from '../tableOfContentsProvider';
@@ -16,15 +14,7 @@ export class RenderDocument implements Command {
private readonly engine: MarkdownEngine
) { }
public async execute(document?: SkinnyTextDocument | string): Promise<string | undefined> {
if (!document) {
if (!vscode.window.activeTextEditor) {
return;
}
document = vscode.window.activeTextEditor.document;
}
public async execute(document: SkinnyTextDocument | string): Promise<string> {
return this.engine.render(document);
}
}