You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value of the python.languageServer setting: Microsoft
Expected behaviour
Should format document.
Actual behaviour
Formatting fails to apply.
Steps to reproduce:
Create a python file with blank first line:
importsysprint(sys.executable)
Reason
From the logs:
Formatting with black failed.
TypeError: Cannot read property 'length' of undefined
This issue is caused in getTextEditsInternal. When the first line is blank, start.line is 0. beforeLines[start.line - 1].length === 0 check fails with TypeError: Cannot read property 'length' of undefined
Environment data
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): falsepython.languageServersetting: MicrosoftExpected behaviour
Should format document.
Actual behaviour
Formatting fails to apply.
Steps to reproduce:
Reason
From the logs:
This issue is caused in
getTextEditsInternal. When the first line is blank,start.lineis 0.beforeLines[start.line - 1].length === 0check fails withTypeError: Cannot read property 'length' of undefined