Skip to content

Commit

Permalink
clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Feb 9, 2024
1 parent 07a93f5 commit 3edaed3
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/codergpt/explainer/explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,32 +116,3 @@ def explain(self, path: Union[str, Path], function: Optional[str] = None, classn
response = self.chain.invoke({"input": f"Explain the following code: \n\n```\n{code}\n```"})
# Pretty print the response
print(f"Explanation for the code:\n{response.content}")

# # Ensure path is a string or Path object for consistency
# if isinstance(path, str):
# path = Path(path)

# with open(path, "r") as file:
# code = file.read()

# # Guess the lexer based on the file name and content
# lexer = guess_lexer_for_filename(path.name, code)

# # Tokenize the code using the guessed lexer
# tokens = list(pygments.lex(code, lexer))

# all_functions = []
# all_classes = []
# # Process the tokens (for demonstration, just print them)
# for token_type, token_value in tokens:
# if token_type in Token.Name.Function:
# print(f"{token_type}: {token_value}")
# all_functions.append(token_value)
# elif token_type in Token.Name.Class:
# all_classes.append(token_value)
# else:
# continue

# elif token_type in Token.Comment:
# print(f"Comment: {token_value}")
# Add more conditions as needed to handle different parts of the code

0 comments on commit 3edaed3

Please sign in to comment.