Команда отлично работает с файлом без импорта:
Код: Выделить всё
""" This is a docstring that should fold
when VS Code's Fold All Block Comments command
is executed on this file. Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna"""
# This folds
Код: Выделить всё
import math
""" This is a docstring that should fold
when VS Code's Fold All Block Comments command
is executed on this file. Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna"""
# Also folds
Код: Выделить всё
import math
import tkinter
""" This is a docstring that should fold
when VS Code's Fold All Block Comments command
is executed on this file. Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna"""
# Does not fold with Fold All Block Comments command.
Код: Выделить всё
import math
""" This is a docstring that should fold
when VS Code's Fold All Block Comments command
is executed on this file. Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna"""
# I fold!
import tkinter
""" This is a docstring that should fold
when VS Code's Fold All Block Comments command
is executed on this file. Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna"""
# I fold too!
Подробнее здесь: https://stackoverflow.com/questions/768 ... s-in-files