Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt when no templates found #1089

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/rmarkdown/draft.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QuickPickItem, QuickPickOptions, Uri, window, workspace } from 'vscode';
import { QuickPickItem, QuickPickOptions, Uri, window, workspace, env } from 'vscode';
import { extensionContext } from '../extension';
import { executeRCommand, getCurrentWorkspaceFolder, getRpath, ToRStringLiteral, spawnAsync, getConfirmation } from '../util';
import * as cp from 'child_process';
Expand Down Expand Up @@ -86,7 +86,12 @@ async function launchTemplatePicker(cwd: string): Promise<TemplateItem> {
const selection = await window.showQuickPick<TemplateItem>(items, options);
return selection;
} else {
void window.showInformationMessage('No templates found.');
void window.showInformationMessage('No templates found. Would you like to browse the wiki page for R packages that provide R Markdown templates?', 'Yes', 'No')
.then((select: string) => {
if (select === 'Yes') {
void env.openExternal(Uri.parse('https://github.com/REditorSupport/vscode-R/wiki/R-Markdown#templates'));
}
});
}
}
return undefined;
Expand Down