Skip to content
Advertisement

Python long list is broken into annoying multiple line in VScode?

enter image description here

Hi, I am using VScode for python. I face an annoying point in autoformat that a long list is broken into multiple lines as shown in the picture. I try to change wordwrap property but it does not help.

Advertisement

Answer

I use the Python formatting toolkit “autopep8“, and its effects are as follows:

enter image description here

"python.formatting.provider": "autopep8",

It is recommended that you check whether there are related settings in the file “settings.json” that affect the use of formatting.

The “autopep8” in VSCode is used as the formatting code of the Python formatting toolkit. We can use it by installing it using pip. Please disable related formatting extensions to avoid interference.

More references: Formatting in VSCode.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement