8000 update get_all_docstrings to return dict · codellm-devkit/python-sdk@9d5a274 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d5a274

Browse files
Bridget McGinnBridget McGinn
authored andcommitted
update get_all_docstrings to return dict
1 parent e3a5fc3 commit 9d5a274

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cldk/analysis/java/codeanalyzer/codeanalyzer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,8 +1079,10 @@ def get_all_docstrings(self) -> List[Tuple[str, JComment]]:
10791079
Returns:
10801080
Dict[str, List[str]]: Dictionary of file paths and their corresponding docstrings.
10811081
"""
1082-
docstrings = []
1082+
docstrings = {}
10831083
for file_path, list_of_comments in self.get_all_comments().items():
1084-
docstrings += [(file_path, docstring) for docstring in list_of_comments if docstring.is_javadoc]
1084+
javadoc_comments = [docstring for docstring in list_of_comments if docstring.is_javadoc]
1085+
if javadoc_comments:
1086+
docstrings[file_path] = javadoc_comments
10851087

1086-
return docstrings
1088+
return docstrings

0 commit comments

Comments
 (0)
0