Skip to content

Conversation

@bschnurr
Copy link
Member

@bschnurrbschnurr commented Aug 8, 2025

Note: this means older of versions of pylance wont work.

@karthiknadig should I add some kind of version check? Do we still want to support older versions of pylance that are expecting the pythhon extension to start them?

i was thinking I could use

export interface PylanceApi{client?:{isEnabled(): boolean; 

and set it to false for the latest pylance that starts itself.

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,
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

keeping getTelemetryReporter() removing others

const api = pylanceExtension.exports;
if (api.client && api.client.isEnabled()){
pylanceApi = api;
await api.client.start();
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

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');
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

renamed Jedi's output window to 'Jedi'

this.serverManager.dispose();
this.serverProxy.dispose();
this.analysisOptions.dispose();
this.outputChannel.dispose();
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

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(),
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

diff is messed up, removing createClient, start, stop

createClient(...args: any[]): BaseLanguageClient;
start(client: BaseLanguageClient): Promise<void>
stop(client: BaseLanguageClient): Promise<void>
getTelemetryReporter(): TelemetryReporter;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

removing

 createClient(...args: any[]): BaseLanguageClient; start(client: BaseLanguageClient): Promise<void> stop(client: BaseLanguageClient): Promise<void> 

@bschnurrbschnurr added the feature-request Request for new features or functionality label Aug 11, 2025
@bschnurrbschnurr marked this pull request as ready for review August 11, 2025 17:10
this.analysisOptions = new JediLanguageServerAnalysisOptions(
environmentService,
outputChannel,
this.outputChannel,
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

extension manager now owns the output channel

},
},
pylance:{
createClient: (...args: any[]): BaseLanguageClient =>{
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

remove pylance apis except getTelemetryReporter

@eleanorjboyd
Copy link
Member

@bschnurr what is the status on this PR?

@bschnurr
Copy link
MemberAuthor

This was a first attempt to see if i was on the right track.

@bschnurr
Copy link
MemberAuthor

@bschnurr what is the status on this PR?

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?

@eleanorjboyd
Copy link
Member

@karthiknadig would be able to answer that question better

@karthiknadig
Copy link
Member

@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.

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

Labels

feature-requestRequest for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@bschnurr@eleanorjboyd@karthiknadig