microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.3k stars 294 forks source link

Python code hints tab completion not working #12867

Closed lovettchris closed 1 year ago

lovettchris commented 1 year ago

Environment data

Expected behaviour

Type in the following:

image

and notice that there's a lovely copilot prompt to complete this code using json.load which is exactly what I wanted. So I hit TAB like I do in a normal python file to complete this suggestion.

Actual behaviour

Tab hides the prompt moves the keyboard focus so the bottom right of the cell:

image

Steps to reproduce:

This only happened once after creating new empty test.ipynb, but now when I restart vscode on this same notebook it works fine. Very weird.

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

``` Visual Studio Code (1.75.1, undefined, desktop) Jupyter Extension Version: 2023.1.2010391206. Python Extension Version: 2023.2.0. Workspace folder d:\git\microsoft\image_segmentation\snpe\notebooks\quantize User belongs to experiment group 'jupyterTest' User belongs to experiment group 'jupyterEnhancedDataViewer' info 16:55:26.959: LSP Notebooks experiment is enabled info 16:55:31.405: Find preferred kernel for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb with metadata {"kernelspec":{"display_name":"archai","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.9"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"6e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994"}}} & preferred interpreter c:\anaconda3\envs\archai\python.exe info 16:55:31.405: Find preferred kernel for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb with metadata {"kernelspec":{"display_name":"archai","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.9"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"6e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994"}}} & preferred interpreter c:\anaconda3\envs\archai\python.exe info 16:55:32.929: Find preferred kernel for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb with metadata {"kernelspec":{"display_name":"archai","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.9"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"6e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994"}}} & preferred interpreter c:\anaconda3\envs\archai\python.exe info 16:55:32.930: Preferred kernel .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher is exact match or top match for non python kernels, (true, [object Object], true, false) info 16:55:32.930: PreferredConnection: .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher found for NotebookDocument: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb info 16:55:32.934: Find preferred kernel for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb with metadata {"kernelspec":{"display_name":"archai","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.9"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"6e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994"}}} & preferred interpreter c:\anaconda3\envs\archai\python.exe info 16:55:32.934: Preferred kernel .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher is exact match or top match for non python kernels, (false, [object Object], true, false) info 16:55:32.934: PreferredConnection: .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher found for NotebookDocument: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb info 16:55:33.146: Starting Jupyter Session startUsingPythonInterpreter, .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher (Python Path: c:\anaconda3\envs\archai, EnvType: Conda, EnvName: 'archai', Version: 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)]) for 'd:\git\microsoft\image_segmentation\snpe\notebooks\quantize\iothub.ipynb' (disableUI=false) info 16:55:42.522: Process Execution: > c:\anaconda3\envs\archai\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" > c:\anaconda3\envs\archai\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" info 16:55:42.536: Process Execution: > c:\anaconda3\envs\archai\python.exe -m pip list > c:\anaconda3\envs\archai\python.exe -m pip list info 16:55:42.547: Process Execution: > c:\anaconda3\envs\archai\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 5504 > c:\anaconda3\envs\archai\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 5504 info 16:55:42.547: Process Execution: cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\vscode_datascience_helpers info 16:55:42.706: Process Execution: > c:\anaconda3\envs\archai\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"d842323d-3e91-405c-8e89-75d31a7d6a5c" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\clovett\AppData\Roaming\jupyter\runtime\kernel-v2-5504OSdtDIrZQfoh.json > c:\anaconda3\envs\archai\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"d842323d-3e91-405c-8e89-75d31a7d6a5c" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\clovett\AppData\Roaming\jupyter\runtime\kernel-v2-5504OSdtDIrZQfoh.json info 16:55:42.706: Process Execution: cwd: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize cwd: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize info 16:55:43.090: ipykernel version & path 6.21.2, c:\anaconda3\envs\archai\lib\site-packages\ipykernel\__init__.py for c:\anaconda3\envs\archai\python.exe info 16:55:44.252: Started Kernel archai (Python 3.10.9) (pid: 22552) info 16:55:44.299: Process Execution: > c:\anaconda3\envs\archai\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\printJupyterDataDir.py > c:\anaconda3\envs\archai\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.1.2010391206\pythonFiles\printJupyterDataDir.py warn 16:55:44.400: Got a non-existent Jupyer Data Dir file:///c%3A/Users/clovett/AppData/Roaming/Python/share/jupyter info 16:56:28.998: Find preferred kernel for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb with metadata {"orig_nbformat":4,"language_info":{"name":"python"}} & preferred interpreter c:\anaconda3\envs\archai\python.exe info 16:56:29.000: Preferred kernel .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher is exact match or top match for non python kernels, (false, [object Object], false, false) info 16:56:29.000: PreferredConnection: .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher found for NotebookDocument: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb error 16:56:32.041: Live Notebook not available for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb error 16:56:32.202: Live Notebook not available for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb error 16:56:32.319: Live Notebook not available for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb error 16:56:32.462: Live Notebook not available for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb error 16:56:32.753: Live Notebook not available for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb error 16:56:32.933: Live Notebook not available for d:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb info 16:56:45.312: Starting Jupyter Session startUsingPythonInterpreter, .jvsc74a57bd06e17fa15dde6767600fffe17352775c2dcab3bfbf1fd9e12a03b13b1554fc994.c:\anaconda3\envs\archai\python.exe.c:\anaconda3\envs\archai\python.exe.-m#ipykernel_launcher (Python Path: c:\anaconda3\envs\archai, EnvType: Conda, EnvName: 'archai', Version: 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)]) for 'd:\git\microsoft\image_segmentation\snpe\notebooks\quantize\test.ipynb' (disableUI=false) info 16:56:45.368: Process Execution: > c:\anaconda3\envs\archai\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" > c:\anaconda3\envs\archai\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" info 16:56:45.393: Process Execution: > c:\anaconda3\envs\archai\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"dbcc0a97-294f-48a5-9824-cd1b3b09d37d" --shell=9007 --transport="tcp" --iopub=9009 --f=c:\Users\clovett\AppData\Roaming\jupyter\runtime\kernel-v2-5504CcCosK9gZ0TN.json > c:\anaconda3\envs\archai\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"dbcc0a97-294f-48a5-9824-cd1b3b09d37d" --shell=9007 --transport="tcp" --iopub=9009 --f=c:\Users\clovett\AppData\Roaming\jupyter\runtime\kernel-v2-5504CcCosK9gZ0TN.json info 16:56:45.393: Process Execution: cwd: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize cwd: d:\git\microsoft\image_segmentation\snpe\notebooks\quantize info 16:56:45.755: ipykernel version & path 6.21.2, c:\anaconda3\envs\archai\lib\site-packages\ipykernel\__init__.py for c:\anaconda3\envs\archai\python.exe info 16:56:46.850: Started Kernel archai (Python 3.10.9) (pid: 2264) ```

DonJayamanne commented 1 year ago

@rebornix Not sure whether you're the person, if not please let me know Feels related to editor, hence assigning to you.

rebornix commented 1 year ago

@lovettchris do you mind giving latest VS Code Insiders https://code.visualstudio.com/insiders/ a try and see if you can reproduce this issue?

lovettchris commented 1 year ago

Just tried 1.76.0-insider and it seems to work fine there, thanks.