added openLocalizedook action that opens up the link to localized books. (#8025)

* initial commit

* addressed the tslint floating promise errors

* updated the command name with PM's feedback
This commit is contained in:
Maddy
2019-10-29 11:51:05 -07:00
committed by GitHub
parent d315ccff68
commit 6e7311ca87
3 changed files with 26 additions and 16 deletions

View File

@@ -140,6 +140,11 @@
"title": "%title.SQL19PreviewBook%",
"category": "%books-preview-category%"
},
{
"command": "books.command.openLocalizedBooks",
"title": "%title.PreviewLocalizedBook%",
"category": "%books-preview-category%"
},
{
"command": "notebook.command.saveBook",
"title": "%title.saveJupyterBook%",

View File

@@ -32,5 +32,6 @@
"title.saveJupyterBook": "Save Book",
"title.searchJupyterBook": "Search Book",
"title.SavedBooks": "Saved Books",
"title.UnsavedBooks": "Unsaved Books"
"title.UnsavedBooks": "Unsaved Books",
"title.PreviewLocalizedBook": "Get localized SQL Server 2019 guide"
}

View File

@@ -44,17 +44,17 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
}
newNotebook(connectionProfile);
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.open', () => {
openNotebook();
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.open', async () => {
await openNotebook();
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runactivecell', () => {
runActiveCell();
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runactivecell', async () => {
await runActiveCell();
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runallcells', () => {
runAllCells();
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runallcells', async () => {
await runAllCells();
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.clearactivecellresult', () => {
clearActiveCellOutput();
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.clearactivecellresult', async () => {
await clearActiveCellOutput();
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcell', async () => {
let cellType: CellType;
@@ -77,20 +77,24 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
return;
}
if (cellType) {
addCell(cellType);
await addCell(cellType);
}
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcode', () => {
addCell('code');
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcode', async () => {
await addCell('code');
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addtext', () => {
addCell('markdown');
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addtext', async () => {
await addCell('markdown');
}));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.analyzeNotebook', (explorerContext: azdata.ObjectExplorerContext) => {
analyzeNotebook(explorerContext);
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.analyzeNotebook', async (explorerContext: azdata.ObjectExplorerContext) => {
await analyzeNotebook(explorerContext);
}));
extensionContext.subscriptions.push(vscode.window.registerUriHandler(new NotebookUriHandler()));
extensionContext.subscriptions.push(vscode.commands.registerCommand('books.command.openLocalizedBooks', async () => {
const urlToOpen: string = 'https://aka.ms/localized-BDC-book';
await vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(urlToOpen));
}));
let appContext = new AppContext(extensionContext, new ApiWrapper());
controller = new JupyterController(appContext);