Repository navigation
[Draft][Do Not Merge] Migrate VS 18 Pylance integration to consolidated LSP protocol - #8673
Conversation
Use Protocol.Internal 18.14.12 and System.Text.Json throughout the VS 18 Pylance protocol path. Adapt generated unions and wire contracts, preserve existing compatibility workarounds and legacy-target branches, align SDK resolution and VSIX packaging, and cover the actual client/host RPC paths with regression tests. Based on the migration starting points in microsoft#8671 and microsoft#8672; this is one independent change based on main, without either draft commit in its ancestry. Co-authored-by: Kayle Hinkle <kaylehinkle@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
| <Reference Include="Microsoft.VisualStudio.LanguageServer.Protocol.Internal" Condition="'$(VSTarget)' == '18.0'"> | ||
| <Private>True</Private> | ||
| <IncludeInVSIX>True</IncludeInVSIX> | ||
| </Reference> |
There was a problem hiding this comment.
Warning · Non-blocking recommendation
Could you align the VSIX installation target and prerequisite with the earliest host containing the consolidated LSP client, or retain an older-host compatibility path? The Internal reference and JsonElement callbacks are selected for every VS 18 target, while the README requires a consolidated-client host. If the advertised range remains [18.0,19.0), please confirm activation, completion, and callbacks on the earliest admitted host or raise the minimum version.
|
Reviewed commit: Result: 🔴 Verification detailsVerification: Automated verification is best effort. The PR author remains responsible for testing. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: C:\Program Files\RedHat\Podman\podman.EXE --connection pyrx-automation failed: stderr: Error: unable to start container "0b8133327e06aaae4d286ff351524fbf98057fc32f619305291ee7af2464a574": crun: open `memory.max` for writing: No such file or directory: OCI runtime attempted to invoke a command that was not found Test runs: none recorded. |
Visual Studio main now ships Microsoft.VisualStudio.LanguageServer.Protocol.Internal 18.14.12 and redirects 18.14.3-18.14.12 references to it. Its own codebase entry replaces the one PTVS registered, so the DLL packaged in the PTVS VSIX was never loaded. Compile against the package without packaging the DLL or registering a codebase, matching how PTVS consumes the LSP client and System.Text.Json. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The PR build's auto-injected Secure Supply Chain Analysis rejects Build/nuget.config when it declares more than one feed, which failed PTVS-Build run 26324.2. Revert to the single msft_consumption source used on main. Pinned versions that are not yet saved in msft_consumption must be saved there by a feed Collaborator before CI can restore them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.



Summary
Microsoft.VisualStudio.LanguageServer.Protocol.Internal18.14.12 and System.Text.Json in one main-based change.mainredirects Internal 18.14.3–18.14.12 to its own 18.14.12, so PTVS packages neither the Internal DLL nor the legacy protocol DLL and registers no codebase for them.Uses #8671 and #8672 as reference starting points, but is based directly on main rather than stacked on either draft. Neither draft is modified by this change.
Validation
At head
a136f539b:Python\Product\dirs.projrebuild: 0 errors, 0 warnings.Python\Tests\Core\PythonToolsTests.csprojbuild: 0 errors.ProtocolJsonSerializationTests,LspDiffTextEditFactoryTests,LanguageServerSettingsTests, andPythonAnalysisOptionsTests.Microsoft.VisualStudio.LanguageServer.Protocol*.dlland no Internal codebase in any pkgdef;Microsoft.PythonTools.dllreferences Internal 18.14.12.0. The entry list is otherwise identical to the previous payload.main), which ships Internal 18.14.12: PTVS loaded from the candidate extension, Internal resolved only to VS's own image, Pylance initialized,client/registerCapabilitycallbacks succeeded, and diagnostics were published with no exceptions.Earlier heads (no C# source has changed since
766f91eeb; later commits changed only packaging, codebase registration and restore configuration):b0495063f). Passed: project creation and Pylance start; completion, resolve, auto-import and the brackets option; hover, Go To Definition, Find All References, highlight, rename and signature help; diagnostics; code actions; type checking modes; Add New Item and external file changes; Interactive Window execute, completion, Clear and Reset; Execute Project in Interactive; debugging; global default environment changes; Open Folder withPythonSettings.jsonsearch paths; and solution/folder switch, exit and restart.c986ff44ctherefore stops packaging it.Outstanding gates
Build\nuget.configdeclared extra feeds;a136f539brestores the singlemsft_consumptionsource. CI restores that feed anonymously, and seven pins are not yet saved there (anonymous download returns 401 "not yet saved"): Internal 18.14.12, plus CoreUtility, Language.StandardClassification, Text.Data, Text.Logic, Text.UI and Text.UI.Wpf 18.14.8. A feed Collaborator must save them before CI can restore.mainbuilds that ship Internal 18.14.12 or later; VS cannot redirect PTVS's 18.14.12 reference to an older copy.mainand not caused by this PR (track separately): the initialize stream rewrite does not apply on current VS, so Pylance roots at the solution folder and never requestsworkspace/configuration;GetSettings(null)prefers the REPL context while an Interactive Window is open; VS pushes{"settings":{}}when settings files change; committing Pylance'shelpcompletion can replace$helpin the REPL.