When the context is larger then the context_token_length warn the user
codelion opened this issue · 1 comments
codelion commented
In the get_source_code_context method in the ExtractCode.py file. If the context is larger than the context_token_length we just return None, None as position (as seen here -
).As a result the patchflow may fail to execute and the only thing user sees is No context found. Instead we should warn them with a logger.warn and suggest that the context selected is larger than the context_token_length and they can increase the context_token_length to process the larger context.
patched-admin commented
The following files in the repository may be relevant to the issue:
- patchwork/steps/ExtractCodeMethodForCommentContexts/ExtractCodeMethodForCommentContexts.py
- patchwork/steps/ExtractCodeContexts/ExtractCodeContexts.py
- patchwork/common/context_strategy/generic.py
- patchwork/steps/ExtractCode/ExtractCode.py
- patchwork/common/client/patched.py
- patchwork/app.py
- patchwork/steps/CreateIssueComment/CreateIssueComment.py