octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65220] get_help_text returns docstring from p


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #65220] get_help_text returns docstring from parent methods
Date: Thu, 1 Feb 2024 01:45:34 -0500 (EST)

Follow-up Comment #38, bug#65220 (group octave):

I pushed the following changes related to this bug report:

http://hg.savannah.gnu.org/hgweb/octave/rev/d312676c51c8
http://hg.savannah.gnu.org/hgweb/octave/rev/258444f64447
http://hg.savannah.gnu.org/hgweb/octave/rev/80d3a6abfc4d
http://hg.savannah.gnu.org/hgweb/octave/rev/2faec354b977
http://hg.savannah.gnu.org/hgweb/octave/rev/82b67791bf1b

There is still a lot of room for improvement in the way we capture comments in
the parser, but things work a lot better now for extracting help for
functions, classdef methods, and classdef properties.

I don't think the behavior for "help fcn" changed - the first non-copyright
comment block in a .m file should be used as the help text.  If there isn't
one before the function definition, then the first one before the body of the
function should be used.

Explaining what happens for classdef classes and methods is probably best done
with an example:


## Class doc above
classdef foo
  ## Class doc inside
  methods
    ## Ctor doc above
    function obj = foo ()
      ## Ctor doc inside
    end
    ## Method doc above
    function method (obj)
      ## Method doc inside
    end
  end
  properties
    ## property doc above
    A ## property doc at eol
  end
end


* If only one of the "above"/"inside" or "block/eol" pairs is present, that
one is used
* If neither is present, the object is undocumented
* If both are present for the class doc or a property, the one above is
preferred
* If both are present for a ctor or method, the one inside is preferred

If there is documentation for a property, method or constructor, then "help
CLASS-NAME.PROPERTY-NAME" or "help CLASS-NAME.METHOD-NAME" will display it.

If there is documentation for the class, then "help CLASS-NAME" will display
it.  If there is documentation for the constructor but not the class, then
"help CLASS-NAME" will show the constructor documentation.

I believe that is the current behavior with the changes I listed above.  If
not, give me a test case and I'll try to fix it.

If the behavior described above is not compatible with Matlab, please also
report that.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65220>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]