Skip to content

Commit af67769

Browse files
dhruvisompurajuliasilgemidleman
authored
Update "Interpreter" command palette actions (#7803)
Addresses #7189 This PR goes through all the interpreter commands we expose to users in the command palette and updates them so the naming scheme is consistent and works better with multiple interpreter sessions. This also updates a couple other UI element labels that trigger the command palette actions so labels match across the board. Note: The diff is a bit messy looking because I reordered a bunch of the actions, so hiding whitespace is recommended. I am also commenting the actions that were renamed/removed so its easier to find the destructive changes. For most of the actions, a user is now prompted to select an interpreter session they want to take the action on. There are a couple actions that specifically act on the foreground session/active console, and those now specify that by using the term "Active Interpreter Session/ Active Console". There’s a few actions in this list that I wasn’t sure what to do with and would love feedback on: * Create/Close Runtime Client Widget: This action gets exposed in the command palette and I wanted to ask if this should be shown to users. I don’t know what the use case is for this. Alternatively, do we want to move this into the “Developer” category? * Execute Code in Console/Execute Code Silently: from the comments it looks like this command is mainly used by QA. Can this be moved into the “Developer” category? I don’t love providing this as a path for users to run code because it’s a pretty odd experience. Here's the new list of interpreter actions after the cleanup: <img width="621" alt="Screenshot 2025-05-21 at 2 47 41 PM" src="https://github.com/user-attachments/assets/cfc18351-4cf1-4fa1-8071-6330a9090f04" /> The plus button in the console pane was also updated so the hover label matches the action being triggered. Prior to the fix, the button always. showed the "Duplicate Session" label - even when the action being triggered was the create new session action. https://github.com/user-attachments/assets/29d5c067-e3de-4452-919b-0be833206ec8 ### Release Notes #### New Features - Updated "Interpreter" command palette actions to work better with multiple interpreter sessions. - Fixed incorrect hover label for "+" button in console pane #### Bug Fixes - N/A ### QA Notes @:sessions @:web @:win @:console --------- Signed-off-by: Dhruvi Sompura <[email protected]> Co-authored-by: Julia Silge <[email protected]> Co-authored-by: Marie Idleman <[email protected]>
1 parent f4dd909 commit af67769

File tree

14 files changed

+485
-540
lines changed

14 files changed

+485
-540
lines changed

extensions/positron-python/src/client/application/diagnostics/checks/unsupportedPythonVersion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class UnsupportedPythonVersionService extends BaseDiagnosticsService {
126126
prompt: Common.selectNewSession,
127127
command: commandFactory.createCommand(diagnostic, {
128128
type: 'executeVSCCommand',
129-
options: 'workbench.action.language.runtime.openActivePicker',
129+
options: 'workbench.action.language.runtime.selectSession',
130130
}),
131131
},
132132
{

extensions/positron-python/src/client/common/application/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface ICommandNameWithoutArgumentTypeMapping {
4444
// --- Start Positron ---
4545
[Commands.Show_Interpreter_Debug_Info]: [];
4646
// New command that opens the multisession interpreter picker
47-
['workbench.action.language.runtime.openActivePicker']: [];
47+
['workbench.action.language.runtime.selectSession']: [];
4848
// --- End Positron ---
4949
}
5050

src/vs/workbench/browser/parts/positronTopActionBar/components/topActionBarSessionManager.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { ActionBarCommandButton } from '../../../../../platform/positronActionBa
1717
import { CommandCenter } from '../../../../../platform/commandCenter/common/commandCenter.js';
1818
import { ILanguageRuntimeSession } from '../../../../services/runtimeSession/common/runtimeSessionService.js';
1919
import { localize } from '../../../../../nls.js';
20+
import { LANGUAGE_RUNTIME_SELECT_SESSION_ID, LANGUAGE_RUNTIME_START_NEW_SESSION_ID } from '../../../../contrib/languageRuntime/browser/languageRuntimeActions.js';
2021

2122
const startSession = localize('positron.console.startSession', "Start Session");
2223

@@ -38,8 +39,8 @@ export const TopActionBarSessionManager = () => {
3839
const hasActiveConsoleSessions = context.runtimeSessionService.activeSessions.find(
3940
session => session.metadata.sessionMode === LanguageRuntimeSessionMode.Console);
4041
const command = hasActiveConsoleSessions
41-
? 'workbench.action.language.runtime.openActivePicker'
42-
: 'workbench.action.language.runtime.openStartPicker';
42+
? LANGUAGE_RUNTIME_SELECT_SESSION_ID
43+
: LANGUAGE_RUNTIME_START_NEW_SESSION_ID;
4344

4445
// Main useEffect.
4546
useEffect(() => {

src/vs/workbench/common/contextkeys.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const PositronTopActionBarFocused = new RawContextKey<boolean>('positronT
128128
export const PositronTopActionBarVisibleContext = new RawContextKey<boolean>('positronTopActionBarVisible', true, localize('positronTopActionBarVisible', "Whether Positron Top Action Bar is visible"));
129129
export const PositronConsoleFocused = new RawContextKey<boolean>('positronConsoleFocused', false, localize('positronConsoleFocused', "Whether Positron Console has keyboard focus"));
130130
export const PositronConsoleTabFocused = new RawContextKey<boolean>('positronConsoleTabFocused', false, localize('positronConsoleTabFocused', "Whether Positron Console Tab has keyboard focus"));
131+
export const PositronConsoleInstancesExistContext = new RawContextKey<boolean>('positronConsoleInstancesExist', false, localize('positronConsoleInstancesExist', "Whether any Positron Console instances exist"));
131132
export const PositronVariablesFocused = new RawContextKey<boolean>('positronVariablesFocused', false, localize('positronVariablesFocused', "Whether Positron Variables has keyboard focus"));
132133
export const PositronHelpFocused = new RawContextKey<boolean>('positronHelpFocused', false, localize('positronHelpFocused', "Whether Positron Help has keyboard focus"));
133134
export const PositronDataExplorerFocused = new RawContextKey<boolean>('positronDataExplorerFocused', false, localize('positronDataExplorerFocused', "Whether Positron Data Explorer has keyboard focus"));

0 commit comments

Comments
 (0)