Skip to content

fix(interactive): create a session from a picker for the folder it listed sessions for - #1992

Merged
eitsupi merged 2 commits into
mainfrom
fix/interactive-picker-folder
Nov 22, 2026
Merged

eitsupi merged 2 commits into
mainfrom
fix/interactive-picker-folder

Conversation

@eitsupi

@eitsupi eitsupi commented Nov 22, 2026

Copy link
Copy Markdown
Member

With no active editor, the Connect picker listed sessions with the first workspace folder's arf but kept no resource. Choosing New persistent R session then read the active editor again, so a file opened in another folder while the picker was open decided which arf was offered.

The Connect picker and the execution target picker now resolve that folder when they open, and use it for both listing and creating sessions.

…sted sessions for

With no active editor, the Connect picker listed sessions with the first
workspace folder's arf, but kept no resource. Choosing New persistent R
session then read the active editor again, so a file opened in another
folder while the picker was open decided the arf that was offered. The
Connect picker and the execution target picker now resolve that folder
when they open, and use it for both listing and creation.
@eitsupi
eitsupi requested a review from renkun-ken November 22, 2026 15:23
@eitsupi
eitsupi marked this pull request as ready for review November 22, 2026 15:23

@renkun-ken renkun-ken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced the focus change on the base commit with a mocked two-folder VS Code workspace. Both Connect and Run R code listed sessions with the first folder’s arf, then offered the second folder’s arf for creation. At 1ff2675, both pickers use the first folder’s arf for both steps. A picker opened from an R file also keeps that file’s folder when focus moves. All 10 CI checks passed.

* resource's, or else the first folder. Its arf setting applies, as its
* directory does.
*/
/**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small documentation nit. Adding pickerResource() here leaves two JSDoc blocks above it. Moving the existing “The workspace folder…” block directly above sessionFolder() would restore that method’s hover documentation.

sandbox.stub(vscode.window, 'activeTextEditor').get(() => active);
const picker = sandbox.stub(vscode.window, 'showQuickPick');
picker.onFirstCall().callsFake((async (items: unknown) => {
const choices = (await items) as (vscode.QuickPickItem & { create?: boolean })[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional test improvement. The first picker’s discovery warning already includes the arf path it checked. Asserting that its detail contains missing[0] here would catch a future change that makes discovery use the wrong folder even if creation still uses the right one.

…the folder it creates them for

The test now also checks that listing reported the first folder's arf,
so a change that lists sessions for another folder than creation uses
fails it. The documentation of sessionFolder() is back above that
method, after pickerResource() was inserted below it.
@eitsupi
eitsupi merged commit 06e8fb9 into main Nov 22, 2026
10 checks passed
@eitsupi
eitsupi deleted the fix/interactive-picker-folder branch November 22, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants