Skip to content

Commit 02729da

Browse files
committed
add interface for env var provider
1 parent c5dbd12 commit 02729da

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

src/kernels/deepnote/deepnoteServerStarter.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import * as fs from 'fs-extra';
1717
import * as os from 'os';
1818
import * as path from '../../platform/vscode-path/path';
1919
import { generateUuid } from '../../platform/common/uuid';
20-
import { SqlIntegrationEnvironmentVariablesProvider } from '../../platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider';
20+
import { ISqlIntegrationEnvVarsProvider } from '../../platform/notebooks/deepnote/types';
2121

2222
/**
2323
* Lock file data structure for tracking server ownership

src/kernels/serviceRegistry.node.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import { ClearJupyterServersCommand } from './jupyter/clearJupyterServersCommand
4949
import { KernelChatStartupCodeProvider } from './chat/kernelStartupCodeProvider';
5050
import { KernelWorkingDirectory } from './raw/session/kernelWorkingDirectory.node';
5151
import { SqlIntegrationEnvironmentVariablesProvider } from '../platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider';
52+
import { ISqlIntegrationEnvVarsProvider } from '../platform/notebooks/deepnote/types';
5253

5354
export function registerTypes(serviceManager: IServiceManager, isDevMode: boolean) {
5455
serviceManager.addSingleton<IExtensionSyncActivationService>(IExtensionSyncActivationService, Activation);
@@ -63,8 +64,8 @@ export function registerTypes(serviceManager: IServiceManager, isDevMode: boolea
6364
);
6465
serviceManager.addSingleton<IRawKernelSessionFactory>(IRawKernelSessionFactory, RawKernelSessionFactory);
6566
serviceManager.addSingleton<IKernelLauncher>(IKernelLauncher, KernelLauncher);
66-
serviceManager.addSingleton<SqlIntegrationEnvironmentVariablesProvider>(
67-
SqlIntegrationEnvironmentVariablesProvider,
67+
serviceManager.addSingleton<ISqlIntegrationEnvVarsProvider>(
68+
ISqlIntegrationEnvVarsProvider,
6869
SqlIntegrationEnvironmentVariablesProvider
6970
);
7071
serviceManager.addSingleton<KernelEnvironmentVariablesService>(

src/platform/notebooks/deepnote/types.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Event } from 'vscode';
2-
import { IDisposable } from '../../common/types';
1+
import { CancellationToken, Event } from 'vscode';
2+
import { IDisposable, Resource } from '../../common/types';
3+
import { EnvironmentVariables } from '../../common/variables/types';
34
import { IntegrationConfig } from './integrationTypes';
45

56
export const IIntegrationStorage = Symbol('IIntegrationStorage');
@@ -23,3 +24,15 @@ export interface IIntegrationStorage extends IDisposable {
2324
clear(): Promise<void>;
2425
}
2526

27+
export const ISqlIntegrationEnvVarsProvider = Symbol('ISqlIntegrationEnvVarsProvider');
28+
export interface ISqlIntegrationEnvVarsProvider {
29+
/**
30+
* Event fired when environment variables change
31+
*/
32+
readonly onDidChangeEnvironmentVariables: Event<Resource>;
33+
34+
/**
35+
* Get environment variables for SQL integrations used in the given notebook.
36+
*/
37+
getEnvironmentVariables(resource: Resource, token?: CancellationToken): Promise<EnvironmentVariables>;
38+
}

0 commit comments

Comments
 (0)