Skip to content

Commit 8377b2c

Browse files
authored
Fix include_declaration handling in references request (#440)
1 parent 6c168d0 commit 8377b2c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pylsp/plugins/references.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
@hookimpl
11-
def pylsp_references(document, position, exclude_declaration=False):
11+
def pylsp_references(document, position, exclude_declaration):
1212
code_position = _utils.position_to_jedi_linecolumn(document, position)
1313
usages = document.jedi_script().get_references(**code_position)
1414

test/plugins/test_references.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_references(tmp_workspace): # pylint: disable=redefined-outer-name
4242
DOC1_URI = uris.from_fs_path(os.path.join(tmp_workspace.root_path, DOC1_NAME))
4343
doc1 = Document(DOC1_URI, tmp_workspace)
4444

45-
refs = pylsp_references(doc1, position)
45+
refs = pylsp_references(doc1, position, exclude_declaration=False)
4646

4747
# Definition, the import and the instantiation
4848
assert len(refs) == 3
@@ -72,7 +72,7 @@ def test_references_builtin(tmp_workspace): # pylint: disable=redefined-outer-n
7272
doc2_uri = uris.from_fs_path(os.path.join(str(tmp_workspace.root_path), DOC2_NAME))
7373
doc2 = Document(doc2_uri, tmp_workspace)
7474

75-
refs = pylsp_references(doc2, position)
75+
refs = pylsp_references(doc2, position, exclude_declaration=False)
7676
assert len(refs) >= 1
7777

7878
expected = {

0 commit comments

Comments
 (0)