Summary
Folding ranges in Jupyter notebook are sometimes messed up and do not align with indented blocks, parentheses, etc.
This is the minimal example I could get with a notebook containing two cells:
import os
import zipfile
out_dir = "output"
archive = "archive.zip" # <-------------------------------------- FOLDS HERE!
with zipfile.ZipFile(archive, "r") as zip_ref: # <--------------- NO FOLD HERE!
for file_info in zip_ref.infolist(): # <--------------------- NO FOLD HERE!
out_path = os.path.join(out_dir, file_info.filename)
if file_info.file_size == 0:
pass
else: # <------------------------------------------------ NO FOLD HERE!
if os.path.exists(out_path): # <--------------------- NO FOLD HERE!
pass
x1 = X(
p1="X",
)
x2 = X(
p1="X",
p2="X",
p3="X",
p4="X",
p5="X", # <-------------------------------------- FOLDS HERE!
p6="X",
p7="X",
)
Demo
Version
ty server version: 0.0.21
Summary
Folding ranges in Jupyter notebook are sometimes messed up and do not align with indented blocks, parentheses, etc.
This is the minimal example I could get with a notebook containing two cells:
repro.ipynb Cell 1repro.ipynb Cell 2Demo
Version
ty server version: 0.0.21