@@ -143,20 +143,23 @@ def second_pass(self, graph: Graph, files: list[Path], path: Path) -> None:
143143 logging .info (f'Processing file ({ i + 1 } /{ files_len } ): { file_path } ' )
144144 for _ , entity in file .entities .items ():
145145 entity .resolved_symbol (lambda key , symbol : analyzers [file_path .suffix ].resolve_symbol (self .files , lsps [file_path .suffix ], file_path , path , key , symbol ))
146- for key , symbols in entity .resolved_symbols .items ():
146+ for key , symbols in entity .symbols .items ():
147147 for symbol in symbols :
148+ if len (symbol .resolved_symbol ) == 0 :
149+ continue
150+ resolved_symbol = next (iter (symbol .resolved_symbol ))
148151 if key == "base_class" :
149- graph .connect_entities ("EXTENDS" , entity .id , symbol .id )
152+ graph .connect_entities ("EXTENDS" , entity .id , resolved_symbol .id )
150153 elif key == "implement_interface" :
151- graph .connect_entities ("IMPLEMENTS" , entity .id , symbol .id )
154+ graph .connect_entities ("IMPLEMENTS" , entity .id , resolved_symbol .id )
152155 elif key == "extend_interface" :
153- graph .connect_entities ("EXTENDS" , entity .id , symbol .id )
156+ graph .connect_entities ("EXTENDS" , entity .id , resolved_symbol .id )
154157 elif key == "call" :
155- graph .connect_entities ("CALLS" , entity .id , symbol .id )
158+ graph .connect_entities ("CALLS" , entity .id , resolved_symbol .id , { "line" : symbol . symbol . start_point . row , "text" : symbol . symbol . text . decode ( "utf-8" )} )
156159 elif key == "return_type" :
157- graph .connect_entities ("RETURNS" , entity .id , symbol .id )
160+ graph .connect_entities ("RETURNS" , entity .id , resolved_symbol .id )
158161 elif key == "parameters" :
159- graph .connect_entities ("PARAMETERS" , entity .id , symbol .id )
162+ graph .connect_entities ("PARAMETERS" , entity .id , resolved_symbol .id )
160163
161164 def analyze_files (self , files : list [Path ], path : Path , graph : Graph ) -> None :
162165 self .first_pass (path , files , [], graph )
0 commit comments