Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miltos Allamanis committed May 8, 2020
1 parent a32c61c commit bcf1606
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class TypeSuggestion(NamedTuple):
"side": "RIGHT",
"commit_id": commit_id,
"body": "The following type annotation might be useful:\n ```suggestion\n"
f"{annotate_parameter(suggestion.filepath[1:],suggestion.file_location,suggestion.name,suggestion.suggestion)}\n```\n",
f"{annotate_parameter(suggestion.filepath[1:],suggestion.file_location,suggestion.name,suggestion.suggestion)}```\n",
}
headers = {
"authorization": f"Bearer {github_token}",
Expand Down
3 changes: 2 additions & 1 deletion src/annotationutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def annotate_parameter(
target_line = lines[location[0] - 1]
assert target_line[location[1] :].startswith(param_name)
return (
target_line[: location[1] + len(param_name)]
" "
+ target_line[: location[1] + len(param_name)] # It's unclear why a single char is lost...
+ f": {annotation}"
+ target_line[location[1] + len(param_name) :]
)

0 comments on commit bcf1606

Please # to comment.