Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop migrating jupyter users to shift+enter execute #15782

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading