Skip to content

Commit

Permalink
Always export env vars to the terminal (#869)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->

## Tests
<!-- How is this tested? -->
  • Loading branch information
kartikgupta-db authored Sep 20, 2023
1 parent b3d56fb commit deaaaf7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,58 +96,39 @@ export class DatabricksEnvFileManager implements Disposable {

this.disposables.push(
userEnvFileWatcher,
userEnvFileWatcher.onDidChange(() => this.writeFile(), this),
userEnvFileWatcher.onDidDelete(() => this.writeFile(), this),
userEnvFileWatcher.onDidCreate(() => this.writeFile(), this),
userEnvFileWatcher.onDidChange(async () => {
await this.emitToTerminal();
await this.writeFile();
}, this),
userEnvFileWatcher.onDidDelete(async () => {
await this.emitToTerminal();
await this.writeFile();
}, this),
userEnvFileWatcher.onDidCreate(async () => {
await this.emitToTerminal();
await this.writeFile();
}, this),
this.featureManager.onDidChangeState(
"notebooks.dbconnect",
async () => {
await this.clearTerminalEnv();
await this.emitToTerminal();
await this.writeFile();
}
),
this.featureManager.onDidChangeState(
"debugging.dbconnect",
(featureState) => {
if (!featureState.avaliable) {
this.clearTerminalEnv();
} else {
this.emitToTerminal();
}
() => {
this.emitToTerminal();
this.writeFile();
},
this
),
this.connectionManager.onDidChangeCluster(async (cluster) => {
if (
!cluster ||
this.connectionManager.state !== "CONNECTED" ||
!(
await this.featureManager.isEnabled(
"debugging.dbconnect"
)
).avaliable
) {
this.clearTerminalEnv();
} else {
this.emitToTerminal();
}
this.connectionManager.onDidChangeCluster(async () => {
this.emitToTerminal();
this.writeFile();
}, this),
this.connectionManager.onDidChangeState(async () => {
if (
this.connectionManager.state !== "CONNECTED" ||
!(
await this.featureManager.isEnabled(
"debugging.dbconnect"
)
).avaliable
) {
this.clearTerminalEnv();
} else {
this.emitToTerminal();
}
this.emitToTerminal();
this.writeFile();
}, this)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export function showRestartNotebookDialogue(
try {
const choice = await window.showInformationMessage(
"Environment variables have changed. Restart all jupyter kernels to pickup the latest environment variables. ",
{
modal: true,
},
"Restart All Jupyter Kernels"
);

Expand Down

0 comments on commit deaaaf7

Please sign in to comment.