Skip to content

WIP: add notebook.workingDirectory setting #8558

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

austin3dickey
Copy link
Contributor

@austin3dickey austin3dickey commented Jul 16, 2025

Addresses #7988. Adds a notebook.workingDirectory setting.

Release Notes

New Features

  • N/A

Bug Fixes

  • N/A

QA Notes

@:notebooks @:vscode-settings @:console @:extensions @:interpreter @:win

Copy link

github-actions bot commented Jul 16, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:notebooks @:vscode-settings @:console @:extensions @:interpreter @:win

readme  valid tags

Copilot

This comment was marked as outdated.

Copilot

This comment was marked as resolved.

@austin3dickey austin3dickey requested a review from Copilot July 23, 2025 19:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new notebook.workingDirectory setting that allows users to configure the default working directory for notebook kernels. The setting supports variable substitution (like ${workspaceFolder}) and is resource-scoped, meaning it can be configured per notebook or workspace. When empty, the system falls back to using the notebook file's directory.

Key changes include:

  • Addition of the new configuration setting with proper schema definition
  • Integration of working directory resolution into the runtime session service
  • Extension of session metadata to include the working directory
  • Updates to Python LSP and Jupyter kernel session handling to respect the new setting

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/notebook/common/notebookCommon.ts Adds the workingDirectory constant to NotebookSetting
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts Registers the notebook.workingDirectory configuration setting
src/vs/workbench/services/runtimeSession/common/runtimeSessionService.ts Adds workingDirectory to IRuntimeSessionMetadata interface
src/vs/workbench/services/runtimeSession/common/runtimeSession.ts Implements working directory resolution with variable substitution
extensions/positron-supervisor/src/KallichoreSession.ts Updates Jupyter kernel session to use configured working directory
extensions/positron-python/src/client/positron/lsp.ts Passes working directory to Python LSP initialization
extensions/positron-python/python_files/posit/positron/positron_jedilsp.py Updates Python LSP to use working directory for project path
src/vs/workbench/services/preferences/common/preferencesModels.ts Adds support for hiding settings via product configuration
src/vs/workbench/services/preferences/browser/preferencesService.ts Updates preferences service to use product service
src/vs/base/common/product.ts Adds hiddenSettings to product configuration interface
product.json Hides jupyter.notebookFileRoot setting
Test files Comprehensive test coverage for the new working directory functionality

}

// Get the workspace folder for variable resolution
const workspaceFolder = this._workspaceContextService.getWorkspaceFolder(notebookUri)
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

Missing semicolon at the end of the line. Should be const workspaceFolder = this._workspaceContextService.getWorkspaceFolder(notebookUri);

Suggested change
const workspaceFolder = this._workspaceContextService.getWorkspaceFolder(notebookUri)
const workspaceFolder = this._workspaceContextService.getWorkspaceFolder(notebookUri);

Copilot uses AI. Check for mistakes.

@@ -1645,7 +1695,7 @@ export class RuntimeSessionService extends Disposable implements IRuntimeSession
* @param runtime The runtime to get the manager for.
* @returns The session manager that manages the runtime.
*
* Throws an errror if no session manager is found for the runtime.
* Throws an error if no session manager is found for the runtime.
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

This appears to be a spelling correction from 'errror' to 'error' in the comment, which is good but should be noted as a separate fix rather than part of the main feature.

Copilot uses AI. Check for mistakes.

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.

1 participant