-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Test proposed API to report progress of environment discovery in two phases #19212
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
Comments
Not sure if this is a bug or not, but the progress for |
It is probably because validation has already been run for the session, in that case validating it again takes no time, are you querying this API at startup? For example for me it's: Can you try to trigger a refresh manually just before fetching "refresh promise"? I have updated the example code: console.time('All paths found');
console.time('Discovery finishes');
proposedApi.environment.refreshEnvironment();
proposedApi.environment.getRefreshPromise({ stage: ProgressReportStage.allPathsDiscovered })?.then(() => {
console.timeLog('All paths found');
});
proposedApi.environment.getRefreshPromise()?.then(() => {
console.timeLog('Discovery finishes');
}); |
I was doing that before (well with 'clearCache' : true) but it makes not difference. 30 seconds or so to get all the paths |
How did you get the 'Conda done' message? Is that just internal to the python extension? |
Yes atm it's internal to the extension, we discovered it's almost the same time as "all paths found" and so wasn't worth exposing.
It maybe the case the validation already finished while waiting for all paths to be discovered (within those 30 seconds), which is why it returns immediately. |
If Don also sees the same behavior, I can add some verbose logging to confirm this hypothesis. |
I'll try to test this for @DonJayamanne since he is out sick |
I see something very similar to what Rich described:
but the API seems to work |
I see, can you please provide the logs as mentioned in the issue template. Set Output for
|
Here's the data: Console output of my custom extension:
Python log of this happening |
Thanks! So the API seem to be work as expected, but the logs reveals the reason why time taken to discover all paths is so much. It's because of us running |
Uh oh!
There was an error while loading. Please reload this page.
Refs: #19103
Complexity: 2
Create Issue
Requirements
Tagging the team who previously tested #19103, apologies for the late tag as I was OOF.
Test APIs
Test the following APIs in
IProposedExtensionAPI
:vscode-python/src/client/apiTypes.ts
Lines 207 to 217 in c46c819
Copy over contents of https://github.com/microsoft/vscode-python/blob/main/src/client/apiTypes.ts as needed.
Discovery is considered finished when all paths are discovered and validated. This API provides a way so other extensions need not wait for validation to finish. For eg. to now get all paths (without waiting for discovery to be finished), we can do:
Example usage:
The text was updated successfully, but these errors were encountered: