Giter Club home page Giter Club logo

Comments (4)

tmhedberg avatar tmhedberg commented on July 19, 2024

Yes, it's possible to add it. Patches welcome. :)

from simpylfold.

Hotschke avatar Hotschke commented on July 19, 2024

I tried pull request #18 and this actually provides folding of the module docstring.

I have noticed that the pull request was first merged then reverted because of multi-line strings defined with """ which would be a different kind of folds.

Is there any middle ground to apply #18. I could see a sensible way to require only leading whitespace before """ to identify docstring related """. If someone else has a good counter example, it would make it more trickier.

from simpylfold.

tmhedberg avatar tmhedberg commented on July 19, 2024

I'm not really opposed to re-applying #18 as long as the bug that it introduced is fixed, but I'd personally prefer to only fold actual docstrings (not multi-line strings occurring in arbitrary locations, as #18 does). This means that, in addition to the existing behavior, where docstrings following a class or def line are folded, we would also fold docstrings starting on either the first line of the file, or following a shebang line, like in your example.

In either case, I'm not likely to work on it myself in the near future, but I'd be happy to review another pull request.

from simpylfold.

Hotschke avatar Hotschke commented on July 19, 2024

I have encountered one issue regarding my proposal distinguishing docstring """ from multi-line strings by checking if only leading whitespace exist: There is the possibility that u""" or r""" is the beginning of the docstring. Probably these cases could be explicitly added.

from simpylfold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.