pylance-release
pylance-release copied to clipboard
New line leaves a trailing whitespace
Environment data
- Language Server version: v2023.5.20
- OS and version: Ubuntu 22.04.2 LTS
- Python version (& distribution if applicable, e.g. Anaconda): 3.11.0
Code Snippet
class Foo:
def bar(self):
return "bar"
Repro Steps
- Put cursor at the end of the
returnstatement. - Press enter couple of times.
Expected behavior
Each new line should not leave a trailing whitespace. This is how it was on version v2023.4.30.
Actual behavior
First new line leaves a trailing whitespace.
Logs
Logs when hitting enter at the end of the return statement.
2023-05-12 12:02:11.380 [info] (875) [FG] parsing: /home/antontkv/temp/python_tests/pylance_bug.py (1ms)
2023-05-12 12:02:11.380 [info] (875) [FG] binding: /home/antontkv/temp/python_tests/pylance_bug.py (0ms)
2023-05-12 12:02:11.382 [info] (875) Background analysis message: setFileOpened
2023-05-12 12:02:11.382 [info] (875) Background analysis message: markFilesDirty
2023-05-12 12:02:11.427 [info] (875) Background analysis message: setFileOpened
2023-05-12 12:02:11.427 [info] (875) Background analysis message: markFilesDirty
2023-05-12 12:02:11.594 [info] (875) [FG] parsing: /home/antontkv/temp/python_tests/pylance_bug.py (0ms)
2023-05-12 12:02:11.595 [info] (875) [FG] binding: /home/antontkv/temp/python_tests/pylance_bug.py (0ms)
2023-05-12 12:02:11.676 [info] (875) Background analysis message: analyze
2023-05-12 12:02:11.677 [info] (875) [BG(1)] analyzing: /home/antontkv/temp/python_tests/pylance_bug.py ...
2023-05-12 12:02:11.677 [info] (875) [BG(1)] parsing: /home/antontkv/temp/python_tests/pylance_bug.py (1ms)
2023-05-12 12:02:11.678 [info] (875) [BG(1)] binding: /home/antontkv/temp/python_tests/pylance_bug.py (0ms)
2023-05-12 12:02:11.697 [info] (875) [BG(1)] checking: /home/antontkv/temp/python_tests/pylance_bug.py (19ms)
2023-05-12 12:02:11.697 [info] (875) [BG(1)] analyzing: /home/antontkv/temp/python_tests/pylance_bug.py (20ms)
2023-05-12 12:02:11.698 [info] (875) Background analysis message: getSemanticTokens delta
2023-05-12 12:02:11.699 [info] (875) [BG(1)] getSemanticTokens delta previousResultId:1683874926862 at /home/antontkv/temp/python_tests/pylance_bug.py (1ms)
2023-05-12 12:02:11.699 [info] (875) Background analysis message: resumeAnalysis
2023-05-12 12:02:11.699 [info] (875) [BG(1)] indexing: /home/antontkv/temp/python_tests/pylance_bug.py [found 1] (0ms)
2023-05-12 12:02:11.699 [info] (875) Indexing Done: /home/antontkv/temp/python_tests/pylance_bug.py
format on type is leaving trailing whitespace.
@antontkv can you turn off format on type until we fix the issue?
just put this in your settings.json file.
"[python]": {
"editor.formatOnType": false
}