fixed the Python extension failing in the virtual workspace on IInterpreterPathService#24050
Closed
heejaechang wants to merge 1 commit intomicrosoft:mainfrom
Closed
fixed the Python extension failing in the virtual workspace on IInterpreterPathService#24050heejaechang wants to merge 1 commit intomicrosoft:mainfrom
heejaechang wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…erpreterPathService. The root cause seems to be that `IDisposableRegistry` is now considered an array of services (after the Inversify update), and having one of the items with catch/then causes `Inversify` to think the service is being called with the wrong API (`get` instead of `getAsync`), throwing the following exception: > You are attempting to construct '" + key + "' in a synchronous way\n but it has asynchronous dependencies. Ideally, `IDisposableRegistry` should be an actual service rather than a type alias of `IDisposable[]`, but that would require too many changes. Instead, I fixed the item that goes into the `IDisposable[]`. That item (a mock) was considered a Promise because the mock automatically generates any symbol that is accessed. I bypassed `then` and `catch` by returning undefined, so it is no longer treated as a Promise. It would be nice if `IDisposableRegistry` became a real service at some point so this issue wouldn't occur again.
Member
|
I think this might address it better: #24051 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue was found during testing
pylanceonvirtual workspace.....
I fixed the Python extension failing in the virtual workspace on IInterpreterPathService
The root cause seems to be that
IDisposableRegistryis now considered an array of services (after the Inversify update), and having one of the items with catch/then causesInversifyto think the service is being called with the wrong API (getinstead ofgetAsync), throwing the following exception:Ideally,
IDisposableRegistryshould be an actual service rather than a type alias ofIDisposable[], but that would require too many changes. Instead, I fixed the item that goes into theIDisposable[].That item (a mock) was considered a Promise because the mock automatically generates any symbol that is accessed. I bypassed
thenandcatchby returning undefined, so it is no longer treated as a Promise.It would be nice if
IDisposableRegistrybecame a real service at some point so this issue wouldn't occur again.....
how should I add a test for this change?