Giter Club home page Giter Club logo

Comments (1)

tmhedberg avatar tmhedberg commented on July 19, 2024

I think your title should say "doctests" instead of "docstrings", but I know what you mean.

As I mentioned in #9, my 2 criteria for including new folding functionality in this plugin are:

  1. Can it be implemented without making the code complicated?
  2. Is it universally desirable?

I am not sure this meets either criterion. For the first, I suspect that this would be more challenging to implement than you think. It is not sufficient to only fold docstring lines beginning with >>> or .... Doctests also include expected output below the >>> lines, which has no special prefix, and may extend to multiple lines. How do you tell where the doctest ends and the "normal" docstring resumes? While I'm sure that it is possible to do so by examining what the actual doctest module does and reimplementing it in Vim, I can't imagine that the resulting code will be simple to understand.

For the second criterion, I do not think it is obvious that nearly every Python programmer would want this. I, for one, would rather not have doctests fold separately. I would still accept such a feature if it were opt-in; i.e. disabled by default but toggled on by a variable that could be set from the user's .vimrc.

So, if you want to write a patch for this, I'll accept it, provided that it is well-written and does not overly complicate the code, does not fail to fold correctly in any unusual corner cases, and is disabled unless the user enables it in their .vimrc.

I appreciate the suggestion, whether or not we end up including it.

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.