mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Remove ApiWrapper from notebook extension (#11224)
* Remove ApiWrapper in notebook extension * delete file * Remove copyrights
This commit is contained in:
@@ -15,7 +15,6 @@ import { BookModel } from './bookModel';
|
||||
import { Deferred } from '../common/promise';
|
||||
import { IBookTrustManager, BookTrustManager } from './bookTrustManager';
|
||||
import * as loc from '../common/localizedConstants';
|
||||
import { ApiWrapper } from '../common/apiWrapper';
|
||||
import * as glob from 'fast-glob';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import { debounce } from '../common/utils';
|
||||
@@ -43,14 +42,14 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
public books: BookModel[];
|
||||
public currentBook: BookModel;
|
||||
|
||||
constructor(private _apiWrapper: ApiWrapper, workspaceFolders: vscode.WorkspaceFolder[], extensionContext: vscode.ExtensionContext, openAsUntitled: boolean, view: string, public providerId: string) {
|
||||
constructor(workspaceFolders: vscode.WorkspaceFolder[], extensionContext: vscode.ExtensionContext, openAsUntitled: boolean, view: string, public providerId: string) {
|
||||
this._openAsUntitled = openAsUntitled;
|
||||
this._extensionContext = extensionContext;
|
||||
this.books = [];
|
||||
this.initialize(workspaceFolders).catch(e => console.error(e));
|
||||
this.viewId = view;
|
||||
this.prompter = new CodeAdapter();
|
||||
this._bookTrustManager = new BookTrustManager(this.books, _apiWrapper);
|
||||
this._bookTrustManager = new BookTrustManager(this.books);
|
||||
|
||||
this._extensionContext.subscriptions.push(azdata.nb.registerNavigationProvider(this));
|
||||
}
|
||||
@@ -83,7 +82,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
if (bookPathToTrust) {
|
||||
let trustChanged = this._bookTrustManager.setBookAsTrusted(bookPathToTrust);
|
||||
if (trustChanged) {
|
||||
let notebookDocuments = this._apiWrapper.getNotebookDocuments();
|
||||
let notebookDocuments = azdata.nb.notebookDocuments;
|
||||
if (notebookDocuments) {
|
||||
// update trust state of opened items
|
||||
notebookDocuments.forEach(document => {
|
||||
@@ -93,9 +92,9 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
}
|
||||
});
|
||||
}
|
||||
this._apiWrapper.showInfoMessage(loc.msgBookTrusted);
|
||||
vscode.window.showInformationMessage(loc.msgBookTrusted);
|
||||
} else {
|
||||
this._apiWrapper.showInfoMessage(loc.msgBookAlreadyTrusted);
|
||||
vscode.window.showInformationMessage(loc.msgBookAlreadyTrusted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,7 +177,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
if (!this.currentBook) {
|
||||
this.currentBook = book;
|
||||
}
|
||||
this._bookViewer = this._apiWrapper.createTreeView(this.viewId, { showCollapseAll: true, treeDataProvider: this });
|
||||
this._bookViewer = vscode.window.createTreeView(this.viewId, { showCollapseAll: true, treeDataProvider: this });
|
||||
this._bookViewer.onDidChangeVisibility(e => {
|
||||
let openDocument = azdata.nb.activeNotebookEditor;
|
||||
let notebookPath = openDocument?.document.uri;
|
||||
@@ -236,7 +235,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
let notebookPath: string;
|
||||
// If no uri is passed in, try to use the current active notebook editor
|
||||
if (!uri) {
|
||||
let openDocument = this._apiWrapper.getActiveNotebookEditor();
|
||||
let openDocument = azdata.nb.activeNotebookEditor;
|
||||
if (openDocument) {
|
||||
notebookPath = openDocument.document.uri.fsPath;
|
||||
}
|
||||
@@ -514,7 +513,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
type: confirm,
|
||||
message: loc.confirmReplace,
|
||||
default: false
|
||||
}, this._apiWrapper);
|
||||
});
|
||||
}
|
||||
|
||||
getNavigation(uri: vscode.Uri): Thenable<azdata.nb.NavigationResult> {
|
||||
|
||||
Reference in New Issue
Block a user