@@ -31,7 +31,8 @@ export function AdvancedComponentLibrary(props: AdvancedComponentLibraryProps) {
31
31
extras : {
32
32
"type" : nodeData . type ,
33
33
"path" : nodeData . file_path ,
34
- "description" : nodeData . docstring ,
34
+ "description" : nodeData [ "json_description" ] [ "description" ] || nodeData . docstring ,
35
+ "argumentDescriptions" : nodeData [ "json_description" ] [ "arguments" ] ,
35
36
"lineNo" : nodeData . lineno
36
37
}
37
38
} ) ;
@@ -44,19 +45,24 @@ export function AdvancedComponentLibrary(props: AdvancedComponentLibraryProps) {
44
45
"str" : "string"
45
46
}
46
47
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 ] || "" : "" ;
50
56
51
57
switch ( variable [ "kind" ] ) {
52
58
case "InCompArg" :
53
- node . addInPortEnhance ( `★${ name } ` , `parameter-${ type } -${ name } ` ) ;
59
+ node . addInPortEnhance ( `★${ name } ` , `parameter-${ type } -${ name } ` , true , null , description ) ;
54
60
break ;
55
61
case "InArg" :
56
- node . addInPortEnhance ( name , `parameter-${ type } -${ name } ` ) ;
62
+ node . addInPortEnhance ( name , `parameter-${ type } -${ name } ` , true , null , description ) ;
57
63
break ;
58
64
case "OutArg" :
59
- node . addOutPortEnhance ( name , `parameter-out-${ type } -${ name } ` ) ;
65
+ node . addOutPortEnhance ( name , `parameter-out-${ type } -${ name } ` , true , null , description ) ;
60
66
break ;
61
67
default :
62
68
console . warn ( "Unknown variable kind for variable" , variable )
0 commit comments