You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a command to restart the language server #22045
However this command can't be found in my command palette, maybe in pylance extension it's already deleted.
I'd like a way to re-analyse the code in a jupyter notebook, since the language server (or the extension) is always broken weirdly microsoft/pylance-release#4736.
I have similar problems with Pylance working for a while in a Jupyter notebook, then breaking.
It's Python: Restart Language Server. Do you not see that in the command palette?
For me, when the active VSC window is a Jupyter notebook, the command palette has Restart Language Server just for .Net, nothing for Python. Conversely, when the active VSC window is a Python file, the "Python: Restart Language Server" command does appear.
It's Python: Restart Language Server. Do you not see that in the command palette?
When the editor opens a .py file, this appears:
However when in a jupyter notebook, this command vanishs:
Here is my environment and extension info:
Version: 1.81.1 (system setup)
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:22:42.175Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22000
Name: Python
Id: ms-python.python
Description: IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.
Version: 2023.14.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
Name: Pylance
Id: ms-python.vscode-pylance
Description: A performant, feature-rich language server for Python in VS Code
Version: 2023.8.40
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
Name: Jupyter Notebook Renderers
Id: ms-toolsai.jupyter-renderers
Description: Renderers for Jupyter Notebooks (with plotly, vega, gif, png, svg, jpeg and other such outputs)
Version: 1.0.17
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter-renderers
Name: Jupyter
Id: ms-toolsai.jupyter
Description: Jupyter notebook support, interactive programming and computing that supports Intellisense, debugging and more.
Version: 2023.7.1002162226
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
Name: Flake8
Id: ms-python.flake8
Description: Linting support for python files using `flake8`.
Version: 2023.6.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.flake8
Name: Black Formatter
Id: ms-python.black-formatter
Description: Formatting support for python files using `black`.
Version: 2023.4.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
Don Jayamanne (@DonJayamanne), this reminds me that the language status {} button also doesn't show for notebooks. Maybe this should be solved in a general way for all languages rather than in a Python-specific way? Has this come up before?
Can confirm I have the same issue(works in python file, doesn't show up in jupyter file) for the following environment
Version: 1.82.2 (Universal)
Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
Date: 2023-09-14T05:59:47.790Z
Electron: 25.8.1
ElectronBuildId: 23779380
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0
Name: Black Formatter
Id: ms-python.black-formatter
Description: Formatting support for Python files using `black`.
Version: 2023.4.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
Name: isort
Id: ms-python.isort
Description: Import Organization support for Python files using `isort`.
Version: 2023.10.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.isort
Name: Jupyter
Id: ms-toolsai.jupyter
Description: Jupyter notebook support, interactive programming and computing that supports Intellisense, debugging and more.
Version: 2023.8.1002501831
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
Name: Pylance
Id: ms-python.vscode-pylance
Description: A performant, feature-rich language server for Python in VS Code
Version: 2023.10.20
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
Name: Python
Id: ms-python.python
Description: IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.
Version: 2023.18.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
Hi! Has there been any progress on this? We just ran into the same problem and it's quite annoying.
The "Python: Restart Language Server" command is listed in Python files but not in Jupyter notebooks. The "Python: Show Language Server Output" command, however, does show up in any file. So I'm wondering, would this just be a one-line change to remove the editorLangId == python in the when-condition of the restart command in package.json? To make it match the when-condition of the show-output command.
I hit another variation of this. I did have a Python file open, but it was in a split pane and the other pane happened to have focus. Since "Restart Language Server" doesn't operate on a single file, I wouldn't have expected the focus to matter. I had to find and look at the extension's manifest to work out what was missing.
I think #22045 (comment) is right about this being an inconsistency between commands and the fix being to remove the editorLangId condition. That condition has now been widened to (editorLangId == python || notebookType == jupyter-notebook) in #23737, but that still doesn't address the general case.
Activity
debonte commentedon Aug 25, 2023
It's
Python: Restart Language Server. Do you not see that in the command palette?stevesimmons commentedon Aug 25, 2023
I have similar problems with Pylance working for a while in a Jupyter notebook, then breaking.
For me, when the active VSC window is a Jupyter notebook, the command palette has Restart Language Server just for .Net, nothing for Python. Conversely, when the active VSC window is a Python file, the "Python: Restart Language Server" command does appear.
Saltsmart commentedon Aug 26, 2023
When the editor opens a
.pyfile, this appears:However when in a jupyter notebook, this command vanishs:
Here is my environment and extension info:
debonte commentedon Aug 26, 2023
Don Jayamanne (@DonJayamanne), this reminds me that the language status
{}button also doesn't show for notebooks. Maybe this should be solved in a general way for all languages rather than in a Python-specific way? Has this come up before?DonJayamanne commentedon Aug 28, 2023
I think Matt Bierner (@mjbvz) would be the best person to answer this .
alexmerm commentedon Oct 19, 2023
Can confirm I have the same issue(works in python file, doesn't show up in jupyter file) for the following environment
ferstlf commentedon Feb 28, 2024
Hi! Has there been any progress on this? We just ran into the same problem and it's quite annoying.
The "Python: Restart Language Server" command is listed in Python files but not in Jupyter notebooks. The "Python: Show Language Server Output" command, however, does show up in any file. So I'm wondering, would this just be a one-line change to remove the
editorLangId == pythonin the when-condition of the restart command inpackage.json? To make it match the when-condition of the show-output command.zanuka commentedon Mar 21, 2025
Don Jayamanne (@DonJayamanne) I'd be happy to work on this
Hassan9255 commentedon Jul 25, 2025
can i work on this
yahiagaming495 commentedon Sep 15, 2025
Can i try to work on this? (No guarantee i will be able to fix it)
arymaheshwari commentedon Jun 4, 2026
Hi, I would love to work on this issue. Will raise a PR!
Tejasvi6603 commentedon Aug 20, 2026
Hi! I’m interested in working on this issue.
Could you please assign it to me? Thanks!
wabain commentedon Oct 13, 2026
I hit another variation of this. I did have a Python file open, but it was in a split pane and the other pane happened to have focus. Since "Restart Language Server" doesn't operate on a single file, I wouldn't have expected the focus to matter. I had to find and look at the extension's manifest to work out what was missing.
I think #22045 (comment) is right about this being an inconsistency between commands and the fix being to remove the
editorLangIdcondition. That condition has now been widened to(editorLangId == python || notebookType == jupyter-notebook)in #23737, but that still doesn't address the general case.