@@ -31,7 +31,8 @@ export function AdvancedComponentLibrary(props: AdvancedComponentLibraryProps) {
3131 extras : {
3232 "type" : nodeData . type ,
3333 "path" : nodeData . file_path ,
34- "description" : nodeData . docstring ,
34+ "description" : nodeData [ "json_description" ] [ "description" ] || nodeData . docstring ,
35+ "argumentDescriptions" : nodeData [ "json_description" ] [ "arguments" ] ,
3536 "lineNo" : nodeData . lineno
3637 }
3738 } ) ;
@@ -44,19 +45,24 @@ export function AdvancedComponentLibrary(props: AdvancedComponentLibraryProps) {
4445 "str" : "string"
4546 }
4647
47- nodeData [ "variables" ] . forEach ( variable => {
48- let name = variable [ "name" ] ;
49- let type = type_name_remappings [ variable [ "type" ] ] || variable [ "type" ] ;
48+ const argumentDescriptions = nodeData [ "json_description" ] [ "arguments" ] ;
49+
50+
51+ nodeData [ "variables" ] . forEach ( ( variable , _ ) => {
52+ const name = variable [ "name" ] ;
53+ const type = type_name_remappings [ variable [ "type" ] ] || variable [ "type" ] ;
54+
55+ const description = argumentDescriptions ? argumentDescriptions [ name ] || "" : "" ;
5056
5157 switch ( variable [ "kind" ] ) {
5258 case "InCompArg" :
53- node . addInPortEnhance ( `★${ name } ` , `parameter-${ type } -${ name } ` ) ;
59+ node . addInPortEnhance ( `★${ name } ` , `parameter-${ type } -${ name } ` , true , null , description ) ;
5460 break ;
5561 case "InArg" :
56- node . addInPortEnhance ( name , `parameter-${ type } -${ name } ` ) ;
62+ node . addInPortEnhance ( name , `parameter-${ type } -${ name } ` , true , null , description ) ;
5763 break ;
5864 case "OutArg" :
59- node . addOutPortEnhance ( name , `parameter-out-${ type } -${ name } ` ) ;
65+ node . addOutPortEnhance ( name , `parameter-out-${ type } -${ name } ` , true , null , description ) ;
6066 break ;
6167 default :
6268 console . warn ( "Unknown variable kind for variable" , variable )
0 commit comments