mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Jupyter Book Search First Steps (#7704)
* Crawling for book search. needs icon * Remove context until decision on entry point * Add undefined check
This commit is contained in:
@@ -147,6 +147,14 @@
|
|||||||
"dark": "resources/dark/save_inverse.svg",
|
"dark": "resources/dark/save_inverse.svg",
|
||||||
"light": "resources/light/save.svg"
|
"light": "resources/light/save.svg"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "notebook.command.searchBook",
|
||||||
|
"title": "%title.searchJupyterBook%",
|
||||||
|
"icon": {
|
||||||
|
"dark": "resources/dark/manage_inverse.svg",
|
||||||
|
"light": "resources/light/manage.svg"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"languages": [
|
"languages": [
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
"title.SQL19PreviewBook": "SQL Server 2019 Guide",
|
"title.SQL19PreviewBook": "SQL Server 2019 Guide",
|
||||||
"books-preview-category": "Jupyter Books",
|
"books-preview-category": "Jupyter Books",
|
||||||
"title.saveJupyterBook": "Save Book",
|
"title.saveJupyterBook": "Save Book",
|
||||||
|
"title.searchJupyterBook": "Search Book",
|
||||||
"title.SavedBooks": "Saved Books",
|
"title.SavedBooks": "Saved Books",
|
||||||
"title.UntitledBooks": "Untitled Books"
|
"title.UntitledBooks": "Untitled Books"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ export class BookTreeItem extends vscode.TreeItem {
|
|||||||
this._sections = book.page;
|
this._sections = book.page;
|
||||||
if (book.isUntitled) {
|
if (book.isUntitled) {
|
||||||
this.contextValue = 'untitledBook';
|
this.contextValue = 'untitledBook';
|
||||||
|
} else {
|
||||||
|
this.contextValue = 'savedBook';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setPageVariables();
|
this.setPageVariables();
|
||||||
|
|||||||
@@ -191,7 +191,13 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async searchJupyterBooks(): Promise<void> {
|
||||||
|
if (this.currentBook && this.currentBook.bookPath) {
|
||||||
|
let filesToIncludeFiltered = path.join(this.currentBook.bookPath, '**', '*.md') + ',' + path.join(this.currentBook.bookPath, '**', '*.ipynb');
|
||||||
|
vscode.commands.executeCommand('workbench.action.findInFiles', { filesToInclude: filesToIncludeFiltered, query: '' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private runThrottledAction(resource: string, action: () => void) {
|
private runThrottledAction(resource: string, action: () => void) {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
|
|||||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openMarkdown', (resource) => bookTreeViewProvider.openMarkdown(resource)));
|
extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openMarkdown', (resource) => bookTreeViewProvider.openMarkdown(resource)));
|
||||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openExternalLink', (resource) => bookTreeViewProvider.openExternalLink(resource)));
|
extensionContext.subscriptions.push(vscode.commands.registerCommand('bookTreeView.openExternalLink', (resource) => bookTreeViewProvider.openExternalLink(resource)));
|
||||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.saveBook', () => untitledBookTreeViewProvider.saveJupyterBooks()));
|
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.saveBook', () => untitledBookTreeViewProvider.saveJupyterBooks()));
|
||||||
|
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.searchBook', () => bookTreeViewProvider.searchJupyterBooks()));
|
||||||
|
|
||||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('_notebook.command.new', (context?: azdata.ConnectedContext) => {
|
extensionContext.subscriptions.push(vscode.commands.registerCommand('_notebook.command.new', (context?: azdata.ConnectedContext) => {
|
||||||
let connectionProfile: azdata.IConnectionProfile = undefined;
|
let connectionProfile: azdata.IConnectionProfile = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user