Fix local nbextensions path resolution for kernels launched from local kernelspec #16886
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.
This PR fixes an issue where local nbextensions could not be found when kernels were launched from local kernelspecs, even when those kernelspecs had an associated Python interpreter with nbextensions installed.
Problem
The
NbExtensionsPathProvider
was missing a case for handling'startUsingLocalKernelSpec'
kernel connections. This caused the provider to always returnundefined
for local kernelspec-based kernels, resulting in the error message "No nbextensions folder found for kernel" and preventing widgets from working when CDN access was unavailable.Root Cause
The switch statement in
NbExtensionsPathProvider.node.ts
only handled:'startUsingPythonInterpreter'
→ returnssysPrefix/share/jupyter
'connectToLiveRemoteKernel'
and'startUsingRemoteKernelSpec'
→ returnsbaseUrl
default
→ returnsundefined
Local kernelspecs (
'startUsingLocalKernelSpec'
) fell through to the default case and always returnedundefined
, even when they had an associated Python interpreter.Solution
Added a new case for
'startUsingLocalKernelSpec'
that:'startUsingPythonInterpreter'
to returnsysPrefix/share/jupyter
undefined
(maintaining existing behavior for non-Python kernels)Testing
This change is minimal, safe, and maintains backward compatibility while fixing the specific scenario described in the issue.
Fixes #16823.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
0.0.0.123
node /home/REDACTED/work/vscode-jupyter/vscode-jupyter/node_modules/.bin/mocha --config ./build/.mocha.unittests.js.json ./out/interactive-window/generatedCodeStorageManager.unit.test.js ./out/interactive-window/shiftEnterBanner.unit.test.js ./out/kernels/helpers.unit.test.js ./out/kernels/kernelAutoReConnectMonitor.unit.test.js ./out/kernels/kernelAutoRestartMonitor.unit.test.js ./out/kernels/kernelCrashMonitor.unit.test.js ./out/kernels/kernelDependencyService.unit.test.js ./out/kernels/kernelFinder.unit.test.js ./out/kernels/kernelProvider.node.unit.test.js ./out/kernels/kernelProvider.web.unit.test.js ./out/kernels/kernelRefreshIndicator.node.unit.test.js ./out/kernels/kernelRefreshIndicator.web.unit.test.js ./out/test/package.nls.json.unit.test.js out/**/ipyWidgetScriptSourceProvider.unit.test.js
(packet block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.