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%", "title": "%title.SQL19PreviewBook%",
"category": "%books-preview-category%" "category": "%books-preview-category%"
}, },
{
"command": "books.command.openLocalizedBooks",
"title": "%title.PreviewLocalizedBook%",
"category": "%books-preview-category%"
},
{ {
"command": "notebook.command.saveBook", "command": "notebook.command.saveBook",
"title": "%title.saveJupyterBook%", "title": "%title.saveJupyterBook%",

View File

@@ -32,5 +32,6 @@
"title.saveJupyterBook": "Save Book", "title.saveJupyterBook": "Save Book",
"title.searchJupyterBook": "Search Book", "title.searchJupyterBook": "Search Book",
"title.SavedBooks": "Saved Books", "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); newNotebook(connectionProfile);
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.open', () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.open', async () => {
openNotebook(); await openNotebook();
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runactivecell', () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runactivecell', async () => {
runActiveCell(); await runActiveCell();
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runallcells', () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.runallcells', async () => {
runAllCells(); await runAllCells();
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.clearactivecellresult', () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.clearactivecellresult', async () => {
clearActiveCellOutput(); await clearActiveCellOutput();
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcell', async () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcell', async () => {
let cellType: CellType; let cellType: CellType;
@@ -77,20 +77,24 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
return; return;
} }
if (cellType) { if (cellType) {
addCell(cellType); await addCell(cellType);
} }
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcode', () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addcode', async () => {
addCell('code'); await addCell('code');
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addtext', () => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.addtext', async () => {
addCell('markdown'); await addCell('markdown');
})); }));
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.analyzeNotebook', (explorerContext: azdata.ObjectExplorerContext) => { extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.analyzeNotebook', async (explorerContext: azdata.ObjectExplorerContext) => {
analyzeNotebook(explorerContext); await analyzeNotebook(explorerContext);
})); }));
extensionContext.subscriptions.push(vscode.window.registerUriHandler(new NotebookUriHandler())); 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()); let appContext = new AppContext(extensionContext, new ApiWrapper());
controller = new JupyterController(appContext); controller = new JupyterController(appContext);