mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Move sql related code to sqlNotebook folder (#4254)
* Move sql related code to sqlNotebook folder * Resolve PR comments: rename folder to sql. * Fixed the import path after rename folder
This commit is contained in:
@@ -7,8 +7,8 @@ import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
|
|||||||
import { Table } from 'sql/base/browser/ui/table/table';
|
import { Table } from 'sql/base/browser/ui/table/table';
|
||||||
import { textFormatter } from 'sql/parts/grid/services/sharedServices';
|
import { textFormatter } from 'sql/parts/grid/services/sharedServices';
|
||||||
import { RowNumberColumn } from 'sql/base/browser/ui/table/plugins/rowNumberColumn.plugin';
|
import { RowNumberColumn } from 'sql/base/browser/ui/table/plugins/rowNumberColumn.plugin';
|
||||||
import { IDataResource } from 'sql/workbench/services/notebook/common/sqlSessionManager';
|
|
||||||
import { escape } from 'sql/base/common/strings';
|
import { escape } from 'sql/base/common/strings';
|
||||||
|
import { IDataResource } from 'sql/workbench/services/notebook/sql/sqlSessionManager';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render DataResource as a grid into a host node.
|
* Render DataResource as a grid into a host node.
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ import {
|
|||||||
} from 'sql/workbench/services/notebook/common/notebookService';
|
} from 'sql/workbench/services/notebook/common/notebookService';
|
||||||
import { RenderMimeRegistry } from 'sql/parts/notebook/outputs/registry';
|
import { RenderMimeRegistry } from 'sql/parts/notebook/outputs/registry';
|
||||||
import { standardRendererFactories } from 'sql/parts/notebook/outputs/factories';
|
import { standardRendererFactories } from 'sql/parts/notebook/outputs/factories';
|
||||||
import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager';
|
|
||||||
import { SessionManager, noKernel } from 'sql/workbench/services/notebook/common/sessionManager';
|
|
||||||
import { Extensions, INotebookProviderRegistry, NotebookProviderRegistration } from 'sql/workbench/services/notebook/common/notebookRegistry';
|
import { Extensions, INotebookProviderRegistry, NotebookProviderRegistration } from 'sql/workbench/services/notebook/common/notebookRegistry';
|
||||||
import { Emitter, Event } from 'vs/base/common/event';
|
import { Emitter, Event } from 'vs/base/common/event';
|
||||||
import { Memento } from 'vs/workbench/common/memento';
|
import { Memento } from 'vs/workbench/common/memento';
|
||||||
@@ -27,7 +25,6 @@ import { IExtensionManagementService, IExtensionIdentifier } from 'vs/platform/e
|
|||||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { getIdFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
import { getIdFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||||
import { Deferred } from 'sql/base/common/promise';
|
import { Deferred } from 'sql/base/common/promise';
|
||||||
import { SqlSessionManager } from 'sql/workbench/services/notebook/common/sqlSessionManager';
|
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { NotebookEditorVisibleContext } from 'sql/workbench/services/notebook/common/notebookContext';
|
import { NotebookEditorVisibleContext } from 'sql/workbench/services/notebook/common/notebookContext';
|
||||||
@@ -39,6 +36,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
|||||||
import { registerNotebookThemes } from 'sql/parts/notebook/notebookStyles';
|
import { registerNotebookThemes } from 'sql/parts/notebook/notebookStyles';
|
||||||
import { IQueryManagementService } from 'sql/platform/query/common/queryManagement';
|
import { IQueryManagementService } from 'sql/platform/query/common/queryManagement';
|
||||||
import { ILanguageMagic, notebookConstants } from 'sql/parts/notebook/models/modelInterfaces';
|
import { ILanguageMagic, notebookConstants } from 'sql/parts/notebook/models/modelInterfaces';
|
||||||
|
import { SqlNotebookProvider } from 'sql/workbench/services/notebook/sql/sqlNotebookProvider';
|
||||||
|
|
||||||
export interface NotebookProviderProperties {
|
export interface NotebookProviderProperties {
|
||||||
provider: string;
|
provider: string;
|
||||||
@@ -470,50 +468,4 @@ export class NotebookService extends Disposable implements INotebookService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export class SqlNotebookProvider implements INotebookProvider {
|
|
||||||
private manager: SqlNotebookManager;
|
|
||||||
|
|
||||||
constructor(private _instantiationService: IInstantiationService) {
|
|
||||||
this.manager = new SqlNotebookManager(this._instantiationService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public get providerId(): string {
|
|
||||||
return SQL_NOTEBOOK_PROVIDER;
|
|
||||||
}
|
|
||||||
|
|
||||||
getNotebookManager(notebookUri: URI): Thenable<INotebookManager> {
|
|
||||||
return Promise.resolve(this.manager);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleNotebookClosed(notebookUri: URI): void {
|
|
||||||
// No-op
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SqlNotebookManager implements INotebookManager {
|
|
||||||
private _contentManager: nb.ContentManager;
|
|
||||||
private _sessionManager: nb.SessionManager;
|
|
||||||
|
|
||||||
constructor(private _instantiationService: IInstantiationService) {
|
|
||||||
this._contentManager = new LocalContentManager();
|
|
||||||
this._sessionManager = new SqlSessionManager(this._instantiationService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public get providerId(): string {
|
|
||||||
return SQL_NOTEBOOK_PROVIDER;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get contentManager(): nb.ContentManager {
|
|
||||||
return this._contentManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get serverManager(): nb.ServerManager {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get sessionManager(): nb.SessionManager {
|
|
||||||
return this._sessionManager;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import { nb } from 'sqlops';
|
||||||
|
|
||||||
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
import { INotebookManager, SQL_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/common/notebookService';
|
||||||
|
import { LocalContentManager } from 'sql/workbench/services/notebook/node/localContentManager';
|
||||||
|
import { SqlSessionManager } from 'sql/workbench/services/notebook/sql/sqlSessionManager';
|
||||||
|
|
||||||
|
export class SqlNotebookManager implements INotebookManager {
|
||||||
|
private _contentManager: nb.ContentManager;
|
||||||
|
private _sessionManager: nb.SessionManager;
|
||||||
|
|
||||||
|
constructor(private _instantiationService: IInstantiationService) {
|
||||||
|
this._contentManager = new LocalContentManager();
|
||||||
|
this._sessionManager = new SqlSessionManager(this._instantiationService);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get providerId(): string {
|
||||||
|
return SQL_NOTEBOOK_PROVIDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get contentManager(): nb.ContentManager {
|
||||||
|
return this._contentManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get serverManager(): nb.ServerManager {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get sessionManager(): nb.SessionManager {
|
||||||
|
return this._sessionManager;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
import { INotebookManager, INotebookProvider, SQL_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/common/notebookService';
|
||||||
|
import { SqlNotebookManager } from 'sql/workbench/services/notebook/sql/sqlNotebookManager';
|
||||||
|
|
||||||
|
export class SqlNotebookProvider implements INotebookProvider {
|
||||||
|
private manager: SqlNotebookManager;
|
||||||
|
|
||||||
|
constructor(private _instantiationService: IInstantiationService) {
|
||||||
|
this.manager = new SqlNotebookManager(this._instantiationService);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get providerId(): string {
|
||||||
|
return SQL_NOTEBOOK_PROVIDER;
|
||||||
|
}
|
||||||
|
|
||||||
|
getNotebookManager(notebookUri: URI): Thenable<INotebookManager> {
|
||||||
|
return Promise.resolve(this.manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleNotebookClosed(notebookUri: URI): void {
|
||||||
|
// No-op
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user