mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add warning for unused imports
This commit is contained in:
parent
729939ad93
commit
6a078ee075
13 changed files with 53 additions and 5 deletions
|
@ -127,6 +127,13 @@ class Range:
|
|||
def text(self) -> str:
|
||||
return self.original_text[self.start : self.end]
|
||||
|
||||
@property
|
||||
def with_trailing_newline(self) -> "Range":
|
||||
if len(self.original_text) > self.end and self.original_text[self.end] == "\n":
|
||||
return Range(self.start, self.end + 1, self.original_text)
|
||||
else:
|
||||
return self
|
||||
|
||||
@staticmethod
|
||||
def join(a: T.Optional["Range"], b: T.Optional["Range"]) -> T.Optional["Range"]:
|
||||
if a is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue