-
Notifications
You must be signed in to change notification settings - Fork 293
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
Incorrect Jupyter notebookFileRoot when workspace has more than one folder #8561
Comments
Thanks for the bug. We'll investigate come January. |
@joetoth Just picking this up to look into now. Initial I'm not seeing the same issue that you are, but I'm not 100% sure if I have my setup the same as yours is. What I did was the following:
Does that look the same as your setup? edit: On closer looks looks like you might have the following setup:
Which is a bit different from mine which was:
Let me try that setup as well. Apologies that scenario does indeed not seem to respect the notebookFileRoot setting. Looking into it now. |
Here is an easy way to reproduce. Create a project /Users/joetoth/projects/1 and another /Users/joetoth/projects/2 Now open a file from 1 and Run line in interactive window. The correct interpreter opens, the line is run and Next open a file from 2, run a line, the correct interpreter opens, then line is run, BUT Let me know if you require further information. Thanks a bunch! |
I believe that I have a fix for this issue here. My fix is only addressing the issue with the notebookFileRoot setting for multi root workspaces. I believe that there might be a different issue here regarding this that I think might need a usage change: This specification here I believe is off: I didn't actually know this myself (don't work with many multi root workspaces) but the VS Code variables actually resolve relative to the folder of the file that is being worked with. So for a file second.py that is in a folder "/Second" the example above would resolve to "MyDirectory/Second/Second" instead of "MyDirectory/Second" since that path doesn't exist it would ignore the notebookFileRoot setting. See here:
However regardless of that we did have an issue here where when calculating the startup directory we were not passing the file being opened so we were always just taking the first setting that applied (whatever the setting was for First folder in this case) which I have a fix coming up soon for. |
Note for bug validation:
Note that the "/Documents" is correct for the settings for Folder "Second". |
Issue Type: Bug
I have 2 folders in a workspace, First and Second.
I tried setting "jupyter.notebookFileRoot": "${workspaceFolder}/Second" in the workspace, user, and project json files.
But, no matter how I start a Jupyter Interactive Window (from a file open from Second) the interpreter's root is always First.
I switched the order of the "folders" in the workspace file to:
]
Now it "works", the interpreter's root is Second.
VS Code version: Code - Insiders 1.63.0-insider (Universal) (d09289a2b6dd0e56b2a264a8e9380685498e10d6, 2021-12-04T02:02:08.723Z)
OS version: Darwin x64 21.1.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (29)
(7 theme extensions excluded)
The text was updated successfully, but these errors were encountered: