Repository navigation
Delegate Pylance language-client lifecycle with compatibility fallback - #25370
Bill Schnurr (bschnurr) wants to merge 15 commits into
Conversation
| new LanguageClient(PYTHON_LANGUAGE, 'Python Language Server', args[0], args[1]), | ||
| start: (client: BaseLanguageClient): Promise<void> => client.start(), | ||
| stop: (client: BaseLanguageClient): Promise<void> => client.stop(), | ||
| getTelemetryReporter: () => reporter, |
There was a problem hiding this comment.
keeping getTelemetryReporter() removing others
| const api = pylanceExtension.exports; | ||
| if (api.client && api.client.isEnabled()) { | ||
| pylanceApi = api; | ||
| await api.client.start(); |
There was a problem hiding this comment.
just removing this call to start. not sure why the diff is messed up. My other idea was to leave this logic in. but change pylance's api.client.isEnabled() to return false and then just return in that case.
|
|
||
| export namespace OutputChannelNames { | ||
| export const languageServer = l10n.t('Python Language Server'); | ||
| export const JediLanguageServer = l10n.t('Jedi'); |
There was a problem hiding this comment.
renamed Jedi's output window to 'Jedi'
| this.serverManager.dispose(); | ||
| this.serverProxy.dispose(); | ||
| this.analysisOptions.dispose(); | ||
| this.outputChannel.dispose(); |
There was a problem hiding this comment.
now dispose Jedi's output channel here instead of the global one
| }, | ||
| start: (client: BaseLanguageClient): Promise<void> => client.start(), | ||
| stop: (client: BaseLanguageClient): Promise<void> => client.stop(), | ||
| getTelemetryReporter: () => getTelemetryReporter(), |
There was a problem hiding this comment.
diff is messed up, removing createClient, start, stop
| createClient(...args: any[]): BaseLanguageClient; | ||
| start(client: BaseLanguageClient): Promise<void>; | ||
| stop(client: BaseLanguageClient): Promise<void>; | ||
| getTelemetryReporter(): TelemetryReporter; |
There was a problem hiding this comment.
removing
createClient(...args: any[]): BaseLanguageClient;
start(client: BaseLanguageClient): Promise<void>;
stop(client: BaseLanguageClient): Promise<void>;
…vscode-python into remove-pylance-client2
| this.analysisOptions = new JediLanguageServerAnalysisOptions( | ||
| environmentService, | ||
| outputChannel, | ||
| this.outputChannel, |
There was a problem hiding this comment.
extension manager now owns the output channel
| }, | ||
| }, | ||
| pylance: { | ||
| createClient: (...args: any[]): BaseLanguageClient => { |
There was a problem hiding this comment.
remove pylance apis except getTelemetryReporter
|
Bill Schnurr (@bschnurr) what is the status on this PR? |
|
This was a first attempt to see if i was on the right track. |
i'll update and see if it still builds.. one outstanding question i had was is it ok to only support the latest pylance going forward? |
|
Karthik Nadig (@karthiknadig) would be able to answer that question better |
|
Bill Schnurr (@bschnurr) Yes, support only the latest is fine. But to do this I recommend updating the VS Code engine versions in both Python and Pylance extensions. This way when users get the latest Python extension, it will match the VS Code engine for both python and pylance, making them both latest. Version checking in the code is OK. But it can still trigger a lot of different types of hard to find problems. |
|
hi Bill Schnurr (@bschnurr) wanted to follow up. Did you update the engine version request? What is the status of this PR? Thanks |
|
sorry. totally forgot about this PR. some major Pylance had some major startup rewrites. need to test this again |
Keep the legacy client API for older Pylance versions and delegate lifecycle management when supported. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR. |
|
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: Podman CLI is not installed or is not on PATH. Test runs: none recorded. |
Stella Huang (StellaHuang95)
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.
The test was removed with PylanceLSExtensionManager; that manager is back as the compatibility fallback, so restore coverage using the current watcher constructor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f288d97
|
Hi Stella,
Thank you for the review. I've addressed the feedback and updated the PR
accordingly. Please take another look when you have a chance. I appreciate
your time and suggestions.
…On Wed, Nov 25, 2026 at 11:38 PM Stella Huang ***@***.***> wrote:
*StellaHuang95* left a comment (microsoft/vscode-python#25370)
<#25370 (comment)>
🔒 Automated review in progress — Stella Huang ***@***.***)
<https://github.com/StellaHuang95> is auto-reviewing this PR.
—
Reply to this email directly, view it on GitHub
<#25370?email_source=notifications&email_token=CJF4U4ZKJMQAPKOSP56CHK3524KJVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJWHE3TMOBTHEYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-7169768390>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CJF4U44PANQLFJPYQBMUKDD524KJVAVCNFSNUABFKJSXA33TNF2G64TZHMYTANRUGYZDONRVHNEXG43VMU5TGMZQGQ4TSMBQGMZKC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CJF4U46LQKDCZA2PNOHXLUL524KJVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJWHE3TMOBTHEYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/CJF4U44U7WE4PQMVZXACKLT524KJVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJWHE3TMOBTHEYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Description
Move Pylance language-client lifecycle ownership to Pylance while preserving compatibility with independently updated Python and Pylance extensions.
Python advertises support for the new lifecycle and delegates start, stop, and restart when Pylance advertises self-management. The existing Python-managed path and client APIs remain available for older Pylance versions. The existing language-server output channel is shared during the transition.
Companion Pylance draft: https://github.com/microsoft/pyrx/pull/10248
Testing
ERR_STREAM_PREMATURE_CLOSEduring shutdown.The Python desktop test bundle used a temporary webpack configuration to filter external modules after prior test compilation affected external-module discovery.