Skip to content

Commit

Permalink
stop migrating jupyter users to shift+enter execute (#15782)
Browse files Browse the repository at this point in the history
* stop migrating jupyter users to shift+enter execute

* prettier
  • Loading branch information
amunger authored Jun 19, 2024
1 parent a289e81 commit f18f386
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/interactive-window/interactiveWindowProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IE
Uri.parse(iw.inputBoxUriString)
);

this.updateExecuteConfigSetting().catch((ex) =>
logger.warn('Failed to update executeWithShiftEnter setting', ex)
);
result.notifyConnectionReset();

this._windows.push(result);
Expand Down Expand Up @@ -170,36 +167,10 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IE
}

await result.ensureInitialized();
this.updateExecuteConfigSetting().catch((ex) =>
logger.warn('Failed to update executeWithShiftEnter setting', ex)
);

return result;
}

private async updateExecuteConfigSetting() {
const updatedExecuteConfigKey = 'updatedExecuteInteractiveConfig';
const updatedExecuteConfig = this.globalMemento.get<boolean>(updatedExecuteConfigKey);
if (updatedExecuteConfig) {
// We've already updated the setting, don't change it again if the user removed it
return;
}

const config = workspace.getConfiguration('interactiveWindow');
const inspected = config.inspect<boolean>('executeWithShiftEnter');

if (
inspected?.workspaceValue === undefined &&
inspected?.workspaceFolderValue === undefined &&
inspected?.globalValue === undefined
) {
// Update the setting to execute with shift+enter if the user has not set it explicitly
// This is to ensure that the behavior stays consistent, but we should only keep doing this for a single release cycle
await config.update('executeWithShiftEnter', true, ConfigurationTarget.Global);
await this.globalMemento.update(updatedExecuteConfigKey, undefined);
}
}

/**
* Given a text document, return the associated interactive window if one exists.
* @param owner The URI of a text document which may be associated with an interactive window.
Expand Down

0 comments on commit f18f386

Please sign in to comment.