File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,13 +34,20 @@ def by_position(position: Position) -> t.Callable[[Reference], bool]:
3434 Returns:
3535 A function that returns True if the reference contains the position, False otherwise
3636 """
37- return lambda r : (
38- r .range .start .line < position .line
39- or (r .range .start .line == position .line and r .range .start .character <= position .character )
40- ) and (
41- r .range .end .line > position .line
42- or (r .range .end .line == position .line and r .range .end .character >= position .character )
43- )
37+
38+ def contains_position (r : Reference ) -> bool :
39+ return (
40+ r .range .start .line < position .line
41+ or (
42+ r .range .start .line == position .line
43+ and r .range .start .character <= position .character
44+ )
45+ ) and (
46+ r .range .end .line > position .line
47+ or (r .range .end .line == position .line and r .range .end .character >= position .character )
48+ )
49+
50+ return contains_position
4451
4552
4653def get_references (
You can’t perform that action at this time.
0 commit comments