Use resource for starting interactive window#10139
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10139 +/- ##
=========================================
Coverage ? 61.27%
=========================================
Files ? 567
Lines ? 30832
Branches ? 4424
=========================================
Hits ? 18893
Misses ? 10956
Partials ? 983
Continue to review full report at Codecov.
|
| ); | ||
|
|
||
| runMountedTest( | ||
| 'Multiple Interpreters', |
There was a problem hiding this comment.
'Multiple Interpreters' [](start = 8, length = 23)
I added a note on the linked issue with the name of this test and the file.
There was a problem hiding this comment.
I think we need more changes, e.g. when calling IConfigurationService.getSettings we'll need to pass in the resource and the like.
Also, I'm now confused with the use of getNotebookIdentity. I.e. what's the difference between notebook identity and notebook resource.
How can a notebook resource change? (apart from a rename/save as).
E.g. what if we were to run a python file from two different workspaces with different python interpreters?
Does this mean we change kernels in the interactive window.
I.e. a multi root workspace with two folders, each with interpreter1 and interpreter2.
Now run file1 in interactive window, next run file2 in interactive window. What's the expected behavior?
Also, what if a user has jupyterServerURI in one of the workspace folders and not the other.
Do we need both notebook identity and a resource?
|
notebook identity is per window, notebook resource is the file that started the notebook. Because other things need to find the interactive notebook, it's a different value. Maybe the naming is wrong. Your example with running two different files for the interactive window, the first one would win (as there's only 1 interactive window). It would pick the kernel from the first. Although I think you're likely right about the getConfig values. It would likely use the wrong jupyterServerUri. In reply to: 360583265 [](ancestors = 360583265) |
|
I think this needs to be turned into its own epic. After all, this issue is about supporting mult-root workspaces. |
|
This issue is just about getting the interactive window to use the matching interpreter. We can enter another issue (and I believe we have one) for supporting multiple interactive windows. |
Unfortunately I didn't word the issue properly. THa'ts the title. But if you look at my comments, I've stated that we don't pass
But that still doesn't solve the issue of I.e. the issue is stuff will not work in multi-root workspaces.
Also, this doesn't seem to be correct, if we're using |
|
This PR makes it so that the interactive window will pick the kernel based on the first file you run it from. That's what the issue is about. That's the only thing this fix does. |
|
Kudos, SonarCloud Quality Gate passed!
|
For #3123
Use the file associated with starting the interactive window to determine what interpreter/kernelspec should be the default.