Skip to content

Test startup settings in VS Code with the Python extension (#5226) - #5226

Closed
kinto0 wants to merge 1 commit into
facebook:mainfrom
kinto0:export-D125113437
Closed

kinto0 wants to merge 1 commit into
facebook:mainfrom
kinto0:export-D125113437

Conversation

@kinto0

@kinto0 kinto0 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Stack context: Make the language server answer startup requests with the client's workspace settings instead of default settings.

  • This diff adds VS Code extension tests that run the real extension, the Python extension (ms-python.python), and the server. A small stdio shim between VS Code and the server controls the client's workspace/configuration responses. In instant mode, the shim forwards them at once. In delay mode, the shim holds them for 3 seconds, as a slow Python extension does. In drop mode, the shim discards the first response.
  • The Rust tests in this stack drive the server with a scripted client. These tests check the same behavior with the requests, the settings, and the interpreter that VS Code and the Python extension really send. With instant and delay, go-to-definition at startup must resolve into the virtual environment that only the Python extension names, and every diagnostic set that VS Code shows must come from the workspace settings. delay also checks that the definition request reached the server before the settings did. With drop, the server must still answer at startup.
  • The workspaces are built in a temporary directory, because Pyrefly finds a virtual environment near a project without the client's settings.

Differential Revision: D125113437

@meta-codesync

meta-codesync Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@kinto0 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125113437.

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

…5226)

Summary:

Stack context: Make the language server answer startup requests with the client's workspace settings instead of default settings.

- This diff adds VS Code extension tests that run the real extension, the Python extension (`ms-python.python`), and the server. A small stdio shim between VS Code and the server controls the client's `workspace/configuration` responses. In `instant` mode, the shim forwards them at once. In `delay` mode, the shim holds them for 3 seconds, as a slow Python extension does. In `drop` mode, the shim discards the first response.
- The Rust tests in this stack drive the server with a scripted client. These tests check the same behavior with the requests, the settings, and the interpreter that VS Code and the Python extension really send. With `instant` and `delay`, go-to-definition at startup must resolve into the virtual environment that only the Python extension names, and every diagnostic set that VS Code shows must come from the workspace settings. `delay` also checks that the definition request reached the server before the settings did. With `drop`, the server must still answer at startup.
- The workspaces are built in a temporary directory, because Pyrefly finds a virtual environment near a project without the client's settings.

Differential Revision: D125113437
@meta-codesync meta-codesync Bot changed the title Test startup settings in VS Code with the Python extension Test startup settings in VS Code with the Python extension (#5226) Oct 14, 2026
@kinto0
kinto0 force-pushed the export-D125113437 branch from 20daec8 to 2fac842 Compare October 14, 2026 18:33
@github-actions github-actions Bot added size/xl and removed size/xl labels Oct 14, 2026

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 4b07099 Oct 15, 2026
@meta-codesync meta-codesync Bot added the Merged label Oct 15, 2026
@meta-codesync

meta-codesync Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 4b07099.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants