mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
errors: In suggestions, use "insert" or "remove"
Previously it always said "replace", leading to incorrect wording.
This commit is contained in:
parent
8d734f7bbd
commit
9570dceaa8
1 changed files with 11 additions and 3 deletions
|
@ -113,6 +113,14 @@ at {filename} line {line_num} column {col_num}:
|
|||
if action.edit_range is not None
|
||||
else self.range.text
|
||||
)
|
||||
|
||||
if old == "":
|
||||
stream.write(
|
||||
f"suggestion: insert {Colors.GREEN}{action.replace_with}{Colors.CLEAR}\n"
|
||||
)
|
||||
elif action.replace_with == "":
|
||||
stream.write(f"suggestion: remove {Colors.RED}{old}{Colors.CLEAR}\n")
|
||||
else:
|
||||
stream.write(
|
||||
f"suggestion: replace {Colors.RED}{old}{Colors.CLEAR} with {Colors.GREEN}{action.replace_with}{Colors.CLEAR}\n"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue