File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,18 @@ def on_call_node_enter(node)
3939 end
4040
4141 case args
42- in [ Prism ::SymbolNode [ unescaped : String => prop_name ] , *]
42+ in [ Prism ::SymbolNode [ unescaped : String => prop_name ] , Prism ::Node => prop_type , *]
43+ prop_type_location = prop_type . location
44+ prop_type_indentation = prop_type_location . source_lines [ prop_type_location . start_line - 1 ] [ /\A \s */ ]
45+
46+ prop_signature = prop_type_location . slice . lines . map { |line | line . delete_prefix ( prop_type_indentation ) } . join
47+
4348 @listener . instance_exec do
4449 @index . add ( RubyIndexer ::Entry ::InstanceVariable . new (
4550 "@#{ prop_name } " ,
4651 @uri ,
4752 RubyIndexer ::Location . from_prism_location ( node . location , @code_units_cache ) ,
48- collect_comments ( node ) ,
53+ [ collect_comments ( node ) , "**Type:** \n ```ruby \n #{ prop_signature } \n ```" ] . join ( " \n \n " ) ,
4954 owner ,
5055 ) )
5156 end
You can’t perform that action at this time.
0 commit comments