From f31b6c8ea6d54ad066991bce9e813fe1b3a9a72c Mon Sep 17 00:00:00 2001 From: Austin Dickey Date: Mon, 13 Jan 2025 14:02:58 -0600 Subject: [PATCH] hardcoded old settings in client code --- extensions/positron-python/package.json | 3 +++ extensions/positron-python/package.nls.json | 3 +++ .../src/client/repl/replUtils.ts | 5 +++++ .../repl/variables/variablesProvider.ts | 5 +++++ .../client/terminals/codeExecution/helper.ts | 19 ++++++++++++++----- .../codeExecution/terminalCodeExecution.ts | 5 ++++- 6 files changed, 34 insertions(+), 6 deletions(-) diff --git a/extensions/positron-python/package.json b/extensions/positron-python/package.json index c7700c42f371..d66d5ab534d8 100644 --- a/extensions/positron-python/package.json +++ b/extensions/positron-python/package.json @@ -773,6 +773,9 @@ "preview" ] }, + // --- Start Positron --- + // Removed python.REPL.* settings + // --- End Positron --- "python.testing.autoTestDiscoverOnSaveEnabled": { "default": true, "description": "%python.testing.autoTestDiscoverOnSaveEnabled.description%", diff --git a/extensions/positron-python/package.nls.json b/extensions/positron-python/package.nls.json index 42588b2b8135..d6091f1faef1 100644 --- a/extensions/positron-python/package.nls.json +++ b/extensions/positron-python/package.nls.json @@ -83,6 +83,9 @@ "python.poetryPath.description": "Path to the poetry executable.", "python.quietMode.description": "Start Positron's IPython shell in quiet mode, to suppress initial version and help messages (restart Positron to apply).", "python.pixiToolPath.description": "Path to the pixi executable.", + // --- Start Positron --- + // Removed python.REPL.* settings + // --- End Positron --- "python.tensorBoard.logDirectory.description": "Set this setting to your preferred TensorBoard log directory to skip log directory prompt when starting TensorBoard.", "python.tensorBoard.logDirectory.markdownDeprecationMessage": "Tensorboard support has been moved to the extension [Tensorboard extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.tensorboard). Instead use the setting `tensorBoard.logDirectory`.", "python.tensorBoard.logDirectory.deprecationMessage": "Tensorboard support has been moved to the extension Tensorboard extension. Instead use the setting `tensorBoard.logDirectory`.", diff --git a/extensions/positron-python/src/client/repl/replUtils.ts b/extensions/positron-python/src/client/repl/replUtils.ts index 5f58f461155b..644b4f802ce0 100644 --- a/extensions/positron-python/src/client/repl/replUtils.ts +++ b/extensions/positron-python/src/client/repl/replUtils.ts @@ -39,6 +39,11 @@ export async function getSelectedTextToExecute(textEditor: TextEditor): Promise< * @returns boolean - True if sendToNativeREPL setting is enabled, False otherwise. */ export function getSendToNativeREPLSetting(): boolean { + // --- Start Positron --- + // This setting is hidden in favor of the Positron console. + // We leave the dead code path below to make merge conflicts easier to resolve. + return false; + // --- End Positron --- const uri = getActiveResource(); const configuration = getConfiguration('python', uri); return configuration.get('REPL.sendToNativeREPL', false); diff --git a/extensions/positron-python/src/client/repl/variables/variablesProvider.ts b/extensions/positron-python/src/client/repl/variables/variablesProvider.ts index f033451dc80e..bc61f21919ca 100644 --- a/extensions/positron-python/src/client/repl/variables/variablesProvider.ts +++ b/extensions/positron-python/src/client/repl/variables/variablesProvider.ts @@ -155,5 +155,10 @@ function getVariableResultCacheKey(uri: string, parent: Variable | undefined, st } function isEnabled(resource?: Uri) { + // --- Start Positron --- + // This setting is hidden in favor of the Positron console. + // We leave the dead code path below to make merge conflicts easier to resolve. + return true; + // --- End Positron --- return getConfiguration('python', resource).get('REPL.provideVariables'); } diff --git a/extensions/positron-python/src/client/terminals/codeExecution/helper.ts b/extensions/positron-python/src/client/terminals/codeExecution/helper.ts index ff1c4f218f8d..ad221eb85d62 100644 --- a/extensions/positron-python/src/client/terminals/codeExecution/helper.ts +++ b/extensions/positron-python/src/client/terminals/codeExecution/helper.ts @@ -6,7 +6,9 @@ import { inject, injectable } from 'inversify'; import { l10n, Position, Range, TextEditor, Uri } from 'vscode'; import { - IActiveResourceService, + // --- Start Positron --- + // IActiveResourceService, + // --- End Positron --- IApplicationShell, ICommandManager, IDocumentManager, @@ -36,7 +38,9 @@ export class CodeExecutionHelper implements ICodeExecutionHelper { private readonly commandManager: ICommandManager; - private activeResourceService: IActiveResourceService; + // --- Start Positron --- + // private activeResourceService: IActiveResourceService; + // --- End Positron --- // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error TS6133: 'configSettings' is declared but its value is never read. @@ -49,7 +53,9 @@ export class CodeExecutionHelper implements ICodeExecutionHelper { this.interpreterService = serviceContainer.get(IInterpreterService); this.configSettings = serviceContainer.get(IConfigurationService); this.commandManager = serviceContainer.get(ICommandManager); - this.activeResourceService = this.serviceContainer.get(IActiveResourceService); + // --- Start Positron --- + // this.activeResourceService = this.serviceContainer.get(IActiveResourceService); + // --- End Positron --- } public async normalizeLines(code: string, wholeFileContent?: string, resource?: Uri): Promise { @@ -95,8 +101,11 @@ export class CodeExecutionHelper implements ICodeExecutionHelper { let smartSendSettingsEnabledVal = true; const configuration = this.serviceContainer.get(IConfigurationService); if (configuration) { - const pythonSettings = configuration.getSettings(this.activeResourceService.getActiveResource()); - smartSendSettingsEnabledVal = pythonSettings.REPL.enableREPLSmartSend; + // --- Start Positron --- + // This setting is hidden in favor of the Positron console. + // const pythonSettings = configuration.getSettings(this.activeResourceService.getActiveResource()); + // smartSendSettingsEnabledVal = pythonSettings.REPL.enableREPLSmartSend; + // --- End Positron --- } const input = JSON.stringify({ diff --git a/extensions/positron-python/src/client/terminals/codeExecution/terminalCodeExecution.ts b/extensions/positron-python/src/client/terminals/codeExecution/terminalCodeExecution.ts index 3cba6141763b..bea352a2a924 100644 --- a/extensions/positron-python/src/client/terminals/codeExecution/terminalCodeExecution.ts +++ b/extensions/positron-python/src/client/terminals/codeExecution/terminalCodeExecution.ts @@ -56,7 +56,10 @@ export class TerminalCodeExecutionProvider implements ICodeExecutionService { const selection = await showWarningMessage(Diagnostics.invalidSmartSendMessage, Repl.disableSmartSend); traceInfo(`Selected file contains invalid Python or Deprecated Python 2 code`); if (selection === Repl.disableSmartSend) { - this.configurationService.updateSetting('REPL.enableREPLSmartSend', false, resource); + // --- Start Positron --- + // This setting is hidden in favor of the Positron console. + // this.configurationService.updateSetting('REPL.enableREPLSmartSend', false, resource); + // --- End Positron --- } } else { await this.getTerminalService(resource).executeCommand(code);