-
Notifications
You must be signed in to change notification settings - Fork 294
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
Don't activate Python extension until needed (Tests Needed) #5193
Comments
Our activation events are explicitly tied to The only thing that changed recently is we trigger on more Python-related files:
Otherwise our Only other thing involving start-up is we added |
I realized this is because of DonJayamanne/typescript-notebook#4. |
The real trouble here is the dependency from the Jupyter extension to the Python extension. I.e. when Jupyter activates, Python activates although, as in this case, there is no reason for Python to be active. |
The long-term plan is to break the hard dependency and make it optional. I suspect Jupyter already has an issue open for this, but in case they don't I'll transfer your issue over to there. |
Looks like a dupe of #4965 |
This is a dependency issue. Because the typescript notebook extension loads on startup, it also loads the jupyter extension. |
The jupyter extension should not need to load the Python extension. The dependency isn't supposed to work that way. |
Dupe of #4526 |
Not a dupe of #4526. |
The root cause of this is here:
Maybe there's another way we can determine if the python extension is installed other than calling the getExtension API. |
I think this is how it has always worked, looks like just because the extension is installed we assume it has been actiavted and try to use it (when we try to use this, then we actiavte it if hasn't been activated). |
When i open a typescript notebook, we still activate Python extension (if it is installed) because we're searching for kernels in interpreters. E.g. assume the following
I.e. i don't see any way around this. @greazer @IanMatthewHuff @rchiodo @DavidKutu @joyceerhl @claudiaregio /cc |
Notebook seems okay to load the python extension. It just shouldn't load in a directory with markdown files. |
One way we could potentially work around this problem is to prompt the user to set a language for the first cell of their notebook before the kernel picker is populated with anything. Right? Example: Assuming your scenario, the user has a blank notebook with no language set in the first cell.
|
I dunno, still seems like if I was a Julia or R user that I wouldn't want the python extension activated just for opening a notebook. Creating a blank notebook could save a default language to use for new notebooks. Then only activate and search for python language notebooks? |
Not sure i like this. Having to get the user to first select a language then the kernel feels like too many steps. |
Sure, but what if i now want to change the kernel to a Python kernel? At this point we won't be displaying all the python interpreters as the Python extension hasn't been actiavted. I think its ok to activate the python extension. I'd say, if user installed Python extnesion, then its ok to activate. |
Python extenion should display prompts like Else I don't see the need for the prompt just because the extension actiavted. But that's an issue at their end. |
Ok. I think I see what you're saying Don. Here's a summary...
Is this complete? Do I have it right? Not sure I think it's the right answer yet, though. |
This has been done, but we need tests for this. |
We've regressed as a result of the changes for Kernel Push (tests really need to be added for this so we don't regress). |
It seems ok to activate the python extension if there are python cells in it. This just needs to e thought through with our getting started investigation. |
I believe the test would be:
But how does it create the notebook controllers then? |
Actually that seems like it should load the python extension. As long as it doesn't prevent opening (which it currently doesn't). I don't think there's a scenario to test for here then. |
Issue Type: Bug
When I startup VS Code I get this in a workspace that exclusively contains markdown files. This is the only window I have open. Why?
Extension version: 2021.2.636928669
VS Code version: Code - Insiders 1.55.0-insider (Universal) (9b2ee7fb7d970b9a628fdb3545bdd01d67078d16, 2021-03-11T05:15:23.749Z)
OS version: Darwin arm64 20.3.0
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: