microsoft / vscode-jupyter

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

Notebook file takes away focus from file list when clicked #5070

Closed RGFTheCoder closed 3 years ago

RGFTheCoder commented 3 years ago

Environment data

Version: Commit: f30a9b73e8ffc278e71575118b6bf568f04587c8 Date: 2021-03-04T22:38:50.094Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Linux x64 5.8.0-44-generic

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

When clicking an ipynb file in the file explorer, the editor opens and the focus remains on the file list, unless the file is double-clicked.

Actual behaviour

When clicking an ipynb file in the file explorer, an editor opens and takes focus, even if it is already opened.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Make a blank test.ipynb
  2. Click on it once on the file list
  3. Press F2 to rename it
  4. Realize that selecting the file also takes away focus from the list, which should only happen on double-clicks.

Peek 2021-03-08 00-02

Logs

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

``` User belongs to experiment group 'pythonaa' User belongs to experiment group 'pythonSendEntireLineToREPL' User belongs to experiment group 'pythonNotDisplayLinterPrompt' User belongs to experiment group 'pythonTensorboardExperiment' User belongs to experiment group 'ShowPlayIcon - start' User belongs to experiment group 'ShowExtensionSurveyPrompt - control' User belongs to experiment group 'DebugAdapterFactory - experiment' User belongs to experiment group 'PtvsdWheels37 - experiment' User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control' User belongs to experiment group 'AA_testing - experiment' User belongs to experiment group 'CollectLSRequestTiming - control' User belongs to experiment group 'CollectNodeLSRequestTiming - experiment' User belongs to experiment group 'DeprecatePythonPath - control' User belongs to experiment group 'RunByLine - experiment' > conda --version > pyenv root > python3.7 ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python3.6 ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python3 ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python2 ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > ~/anaconda3/bin/conda info --json > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > python ~/.vscode/extensions/ms-python.python-2021.2.625869727/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)" > pyenv root > ~/anaconda3/bin/conda env list > ~/anaconda3/bin/conda env list > pyenv root > pyenv root > pyenv root Error 2021-03-07 23:50:40: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file '/media/linx/Data/Projects/preact/SpaceTraders/.vscode/settings.json' (Error: Unable to resolve non-existing file '/media/linx/Data/Projects/preact/SpaceTraders/.vscode/settings.json') at _handleError (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:151863) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async y.readText (/home/linx/.vscode/extensions/ms-python.python-2021.2.625869727/out/client/extension.js:9:298390) at async p.doesFileNeedToBeFixed (/home/linx/.vscode/extensions/ms-python.python-2021.2.625869727/out/client/extension.js:59:481011) at async /home/linx/.vscode/extensions/ms-python.python-2021.2.625869727/out/client/extension.js:59:480138 at async Promise.all (index 1) at async p.getFilesToBeFixed (/home/linx/.vscode/extensions/ms-python.python-2021.2.625869727/out/client/extension.js:59:480084) at async p.updateTestSettings (/home/linx/.vscode/extensions/ms-python.python-2021.2.625869727/out/client/extension.js:59:479711)] { code: 'FileNotFound' } > pyenv root Python interpreter path: /usr/bin/python3 > pyenv root > pyenv root Starting Pylance language server. > pyenv root > ~/anaconda3/bin/conda info --json ```

DavidKutu commented 3 years ago

Thanks for the issue @RGFTheCoder. This will get solved with our new implementation of notebooks. We're currently working on it to release it as soon as possible.

You can read about it and try it here: https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/

greazer commented 3 years ago

Thanks for your feedback. This issue will likely be addressed once VS Code adds native support for editing notebooks. Please see https://github.com/microsoft/vscode/issues/91987.