python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

Question : how to format code ?

Open deb75 opened this issue 3 years ago • 1 comments

Hello,

Configuration :

  • OS : Windows 10
  • Microsoft Python Language Server version 0.5.59.0
  • python : winpython64 3.9.0
  • lsp client : emacs 27.1.2 lsp-python-ms

When typing C-c l = =, I receive the message :

lsp-format-buffer: Capability not supported by the language server: "documentFormattingProvider"

I searched within issues if anyone did report any formatting problem (keyword "format") but it returned nothing.

Does this returned message means the python-language-server lacks the formatting feature ? Or is it a bug, most probably from my configuration ?

If not, could it be feature request to add python code formatting ?

Regards

deb75 avatar Jan 08 '21 08:01 deb75

LS does not format code. The reason is there are many excellent third party formatters with extended functionality and duplicating it does not make much sense. VS Code extension formats code using one of those.

MikhailArkhipov avatar Jan 08 '21 16:01 MikhailArkhipov