Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -r1.84 -r1.85 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 3 Nov 2024 09:50:39 -0000 1.84 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 13 Nov 2024 17:36:08 -0000 1.85 @@ -819,8 +819,37 @@ if {[nsf::is object,type=::nx::Object $objName] && ![nsf::is object,type=::nx::Class $objName]} { append blocks_out
foreach m [$objName info lookup methods -callprotection public -source application] { - set methodSyntax "$objName $m [$objName info lookup syntax $m]" set definition [nx::Object info method definition [$objName info lookup method $m]] + # + # Currently, "info lookup syntax" does not work for aliases + # + if {[lindex $definition end-2] eq "alias"} { + set targetMethod [lindex $definition end] + unset -nocomplain methodSyntax + if {[nsf::cmd::info type $targetMethod] eq "cmd"} { + # + # We have an alias to a plain command. Try + # executing the plain command and let's hope, + # it gives us a syntax. + # + try { + $targetMethod + } on error {errorMsg} { + if {[regexp {"([^\"]+)"} [lindex [split $errorMsg \n] 0] . syntax]} { + set methodSyntax "$objName $m [lrange $syntax 1 end]" + } + } + } else { + ns_log notice "unknown type '[nsf::cmd::info type $targetMethod]'" \ + "for alias for '$targetMethod'" \ + "used in [list $objName info lookup syntax $m]" + } + if {![info exists methodSyntax]} { + set methodSyntax "$objName $m ..." + } + } else { + set methodSyntax "$objName $m [$objName info lookup syntax $m]" + } set containerObject [lindex $definition 0] if {$containerObject ne $objName} { # Index: openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 5 Nov 2024 15:38:30 -0000 1.35 +++ openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 13 Nov 2024 17:36:08 -0000 1.36 @@ -184,6 +184,16 @@ return "$label" } else { if {[::apidoc::get_object_property $obj $kind $method] eq ""} { + # + # Try to handle aliases via the alias definition + # + set definition [ns_cache info {*}[expr {$kind eq "proc" ? "object" : ""}] method definition $method] + if {[lindex $definition end-2] eq "alias"} { + return "$label" + } + # + # Must be something implemented in C + # return $methodC } else { return $method @@ -416,7 +426,7 @@ #if {![string match ::* $obj]} { # ad_log error "==== update_object_doc OBJECT WITHOUT leading colons <$obj>" #} - + if {$doc_string eq ""} { set doc_string [:get_doc_block [:get_init_block $scope $obj]] }