Skip to content
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

Ensure we register for interpreter change when moving from untrusted to trusted. #19351

Merged
merged 5 commits into from
Jun 24, 2022

Conversation

karthiknadig
Copy link
Member

@karthiknadig karthiknadig commented Jun 23, 2022

I have moved some of the even registrations into activate(). This is needed because whenever we change trust we call deactivate() and activate the extension. This is to simulate the extension re-load.

The cause is that object lifetime management currently is not straightforward due to the way we use inversify. This is compounded by the fact that when inversify unloads, it does not call dispose on the objects. Then again inversify may not own the object that it is trying to dispose. For now hacks will have to do. Long term we will be rewriting the various parts of the extension to get rid of inversify and have better control over object life times. so we can actually do deactivate and activate to simulate Windows re-load.

@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Jun 23, 2022
@karthiknadig karthiknadig marked this pull request as ready for review June 23, 2022 23:51
@karthiknadig karthiknadig requested a review from karrtikr June 24, 2022 05:29
@karthiknadig karthiknadig merged commit 1ffa23a into microsoft:main Jun 24, 2022
@karthiknadig karthiknadig deleted the merge-dispose branch August 29, 2022 17:16
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
…to trusted. (microsoft/vscode-python#19351)

* Ensure we register for interpreter change when moving from untrusted to trusted.

* Tweak LanguageServerChangeHandler dispose

* Use disposables instead on context.subscriptions for consistency.

* Address comments.

* Fix tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants