Skip to content

Commit b460f31

Browse files
committed
Fix linting issues in rope_implementation & tests
1 parent f38d3ef commit b460f31

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

pylsp/python_lsp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,6 @@ def m_text_document__definition(self, textDocument=None, position=None, **_kwarg
768768

769769
def m_text_document__implementation(self, textDocument=None, position=None, **_kwargs):
770770
# textDocument here is just a dict with a uri
771-
workspace = self._match_uri_to_workspace(textDocument["uri"])
772-
document = workspace.get_document(textDocument["uri"])
773771
return self.implementations(textDocument["uri"], position)
774772

775773
def m_text_document__document_highlight(

test/data/implementations_examples/example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from abc import ABC, abstractmethod
22

3+
34
class Animal(ABC):
45
@abstractmethod
56
def breathe(self):

test/plugins/test_implementations.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Copyright 2017-2020 Palantir Technologies, Inc.
22
# Copyright 2021- Python Language Server Contributors.
33

4-
import test
54
from pathlib import Path
65

76
import pytest
87

8+
import test
99
from pylsp import uris
1010
from pylsp.config.config import Config
1111
from pylsp.plugins.rope_implementation import pylsp_implementations
@@ -42,12 +42,12 @@ def workspace(examples_dir_path: Path, endpoint) -> None:
4242

4343
def test_implementations(config, workspace, doc_uri) -> None:
4444
# Over 'fly' in WingedAnimal.fly
45-
cursor_pos = {"line": 14, "character": 8}
45+
cursor_pos = {"line": 15, "character": 8}
4646

4747
# The implementation of 'Bird.fly'
4848
def_range = {
49-
"start": {"line": 21, "character": 8},
50-
"end": {"line": 21, "character": 11},
49+
"start": {"line": 22, "character": 8},
50+
"end": {"line": 22, "character": 11},
5151
}
5252

5353
doc = workspace.get_document(doc_uri)
@@ -58,12 +58,12 @@ def test_implementations(config, workspace, doc_uri) -> None:
5858

5959
def test_implementations_skipping_one_class(config, workspace, doc_uri) -> None:
6060
# Over 'Animal.breathe'
61-
cursor_pos = {"line": 4, "character": 8}
61+
cursor_pos = {"line": 5, "character": 8}
6262

6363
# The implementation of 'breathe', skipping intermediate classes
6464
def_range = {
65-
"start": {"line": 18, "character": 8},
66-
"end": {"line": 18, "character": 15},
65+
"start": {"line": 19, "character": 8},
66+
"end": {"line": 19, "character": 15},
6767
}
6868

6969
doc = workspace.get_document(doc_uri)
@@ -77,12 +77,12 @@ def test_implementations_skipping_one_class(config, workspace, doc_uri) -> None:
7777
)
7878
def test_property_implementations(config, workspace, doc_uri) -> None:
7979
# Over 'Animal.size'
80-
cursor_pos = {"line": 9, "character": 9}
80+
cursor_pos = {"line": 10, "character": 9}
8181

8282
# The property implementation 'Bird.size'
8383
def_range = {
84-
"start": {"line": 25, "character": 8},
85-
"end": {"line": 25, "character": 12},
84+
"start": {"line": 26, "character": 8},
85+
"end": {"line": 26, "character": 12},
8686
}
8787

8888
doc = workspace.get_document(doc_uri)
@@ -93,7 +93,7 @@ def test_property_implementations(config, workspace, doc_uri) -> None:
9393

9494
def test_implementations_not_a_method(config, workspace, doc_uri) -> None:
9595
# Over 'print(...)' call
96-
cursor_pos = {"line": 28, "character": 0}
96+
cursor_pos = {"line": 29, "character": 0}
9797

9898
doc = workspace.get_document(doc_uri)
9999

0 commit comments

Comments
 (0)