comparison libinterp/corefcn/help.cc @ 33231:92ca2f6c6b85

find help for default constructor in one more place (bug #65258) * help.cc (help_system::raw_help_from_symbol_table): Return signature of default constructor if searching for class_name.class_name and the class is found but not the constructor. (help_system::raw_help_for_class): Fix spacing for default constructor signature.
author John W. Eaton <jwe@octave.org>
date Thu, 21 Mar 2024 10:40:31 -0400
parents 515c1cc1b45e
children
comparison
equal deleted inserted replaced
33230:515c1cc1b45e 33231:92ca2f6c6b85
746 } 746 }
747 747
748 // We found a class, but no docstring for it and there is no 748 // We found a class, but no docstring for it and there is no
749 // constructor explicitly defined. 749 // constructor explicitly defined.
750 750
751 help = "default constructor: obj = " + name + "()"; 751 help = "default constructor: obj = " + name + " ()";
752 what = "constructor"; 752 what = "constructor";
753 symbol_found = true; 753 symbol_found = true;
754 return true; 754 return true;
755 } 755 }
756 756
838 // FIXME: Should we only find public methods here? 838 // FIXME: Should we only find public methods here?
839 839
840 octave_value ov_meth = cls.get_method (nm); 840 octave_value ov_meth = cls.get_method (nm);
841 841
842 if (get_help_from_fcn (nm, ov_meth, help, what, symbol_found)) 842 if (get_help_from_fcn (nm, ov_meth, help, what, symbol_found))
843 return true; 843 {
844 what = "class method";
845 return true;
846 }
847
848 // Found class but no method. If the NM is the same as the name
849 // of the class, then we have a default constructor.
850
851 if (cls.get_name () == nm)
852 {
853 help = "default constructor: obj = " + nm + " ()";
854 what = "constructor";
855 symbol_found = true;
856 return true;
857 }
844 858
845 // FIXME: Should we only find public properties here? 859 // FIXME: Should we only find public properties here?
846 860
847 cdef_property prop = cls.find_property (nm); 861 cdef_property prop = cls.find_property (nm);
848 862