Skip to content

Commit

Permalink
hardcoded old settings in client code
Browse files Browse the repository at this point in the history
  • Loading branch information
austin3dickey committed Jan 13, 2025
1 parent 7a84547 commit f31b6c8
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
3 changes: 3 additions & 0 deletions extensions/positron-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,9 @@
"preview"
]
},
// --- Start Positron ---
// Removed python.REPL.* settings
// --- End Positron ---
"python.testing.autoTestDiscoverOnSaveEnabled": {
"default": true,
"description": "%python.testing.autoTestDiscoverOnSaveEnabled.description%",
Expand Down
3 changes: 3 additions & 0 deletions extensions/positron-python/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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`.",
Expand Down
5 changes: 5 additions & 0 deletions extensions/positron-python/src/client/repl/replUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>('REPL.sendToNativeREPL', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -49,7 +53,9 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
this.interpreterService = serviceContainer.get<IInterpreterService>(IInterpreterService);
this.configSettings = serviceContainer.get<IConfigurationService>(IConfigurationService);
this.commandManager = serviceContainer.get<ICommandManager>(ICommandManager);
this.activeResourceService = this.serviceContainer.get<IActiveResourceService>(IActiveResourceService);
// --- Start Positron ---
// this.activeResourceService = this.serviceContainer.get<IActiveResourceService>(IActiveResourceService);
// --- End Positron ---
}

public async normalizeLines(code: string, wholeFileContent?: string, resource?: Uri): Promise<string> {
Expand Down Expand Up @@ -95,8 +101,11 @@ export class CodeExecutionHelper implements ICodeExecutionHelper {
let smartSendSettingsEnabledVal = true;
const configuration = this.serviceContainer.get<IConfigurationService>(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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f31b6c8

Please sign in to comment.