Skip to content
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

Support line formatting #283

Closed
hauselin opened this issue Aug 26, 2020 · 2 comments
Closed

Support line formatting #283

hauselin opened this issue Aug 26, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@hauselin
Copy link

Environment data

  • Language Server version: 2020.8.2
  • OS and version: Mac 10.13.6
  • Python version: Anaconda Python 3.8.1
  • VSCode version: 1.48.2

Expected behaviour

I've set "editor.formatOnType": true in settings.json. When I press return/enter after a line, that line should be formatted automatically.

Actual behaviour

Any given line won't format automatically when pylance is enabled. When I comment out "python.languageServer": "Pylance", in my settings.json, format on type works again.

formatontype

@jakebailey
Copy link
Member

We don't implement this LSP method. The MPLS did, and the core extension has (old, hacky) logic for doing this when running jedi.

I'm not sure that we are going to reimplement this, as the core extension is planning on having this feature reworked in order to better support auto-formatting on enter (and thus requires us to not declare support for it): microsoft/vscode-python#8996

@jakebailey jakebailey added the enhancement New feature or request label Aug 26, 2020
@github-actions github-actions bot removed the triage label Aug 26, 2020
@jakebailey jakebailey changed the title Enabling pylance breaks "editor.formatOnType": true Support line formatting Nov 6, 2020
@savannahostrowski
Copy link
Contributor

This should have been closed previously as this is being handled on the core extension side as mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants