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

Python Language Server "unable to determine path to interpreter" should be actionable #2983

Closed
qubitron opened this Issue Oct 23, 2018 · 4 comments

Comments

@qubitron

qubitron commented Oct 23, 2018

Environment data

  • VS Code version: 1.28.2 (user setup)
  • Extension version (available under the Extensions sidebar): 2018.9.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Have python 2.7, 3.6, 3.7 and anaconda installed
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): None (yet)
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

Opened a folder with a single empty hello.py file:
image

No python interpreter is selected, and I get this error message immediately after opening the file

Expected behavior

The dialog should instead say something like

No Python interpreter is selected, you need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.
[ Select Python Interpreter ] 

@brettcannon brettcannon added the triage label Oct 23, 2018

d3r3kk added a commit to d3r3kk/vscode-python that referenced this issue Oct 26, 2018

Add 'Select' button to 'No Interpreter' warning message.
Fix for Microsoft#2983

- Add button to warning message that opens interpreter selector
- Add localization
@d3r3kk

This comment has been minimized.

d3r3kk commented Oct 26, 2018

Current behaviour is indeed unactionable:

2983_unresolvable_msg_no_interpreter_yet

I propose we do something like so:

2983_proposal_make_actionable

Branch for person who would implement such a thing.

Note: The popup for dependencies such as linters should probably be deferred until after this action is taken as well. Covered in #2811.

@DonJayamanne

This comment has been minimized.

DonJayamanne commented Oct 26, 2018

@d3r3kk
I'd change this as follows:

  • Modify pythonInterpreter.ts (but only check currently selected interpreter) to add a new diagnostic InvalidPythonInterpreterDiagnostic (that would check if the selected interpreter is valid or not)
  • Should be a very simple change.

Benefits:

  • Consistent approach to validations/checks
  • Consistent UX (displaying message and prompt, e.g. button would read Select Python Interpreter)
  • Catch the error early on
  • Benefits the entire extension (currently this validation is done in language server code, but linters, formatters, etc all fail due to the invalid python interpreter having been selected).
@DonJayamanne

This comment has been minimized.

DonJayamanne commented Oct 26, 2018

Changing label to Needs PR, as that's whats been requested (a change, and the UI has been provided).

@DonJayamanne

This comment has been minimized.

DonJayamanne commented Oct 26, 2018

@brettcannon
This is a very simple change that improves the getting started experience, hence changing the label to P1.
As discussed, if you disagree please feel free to change the priority.

@DonJayamanne DonJayamanne added the P1 label Oct 26, 2018

@d3r3kk d3r3kk self-assigned this Nov 3, 2018

d3r3kk added a commit to d3r3kk/vscode-python that referenced this issue Nov 3, 2018

When opening a workspace with interpreters available but none current…
…ly selected, make the message actionalble.

For Microsoft#2983

- [x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
- [x] Title summarizes what is changing
- [x] Has a [news entry](https://github.com/Microsoft/vscode-python/tree/master/news) file (remember to thank yourself!)
- [x] Unit tests & system/integration tests are added/updated
- [x] ~[Test plan](https://github.com/Microsoft/vscode-python/blob/master/.github/test_plan.md) is updated as appropriate~ *(This is covered by assertions already present)*
- [x] ~[`package-lock.json`](https://github.com/Microsoft/vscode-python/blob/master/package-lock.json) has been regenerated by running `npm install` (if dependencies have changed)~

DonJayamanne added a commit that referenced this issue Nov 7, 2018

When opening a workspace with interpreters available but none current…
…ly selected, make the message actionalble. (#3187)

For #2983

@DonJayamanne DonJayamanne self-assigned this Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment