Skip to content

Commit 2eb9533

Browse files
rubmarymeta-codesync[bot]
authored andcommitted
Use pyrefly lsp to find definition for attributes
Summary: In this diff I am using the function `find_definition_for_base_type` to get the attribute definition. This allow getting the file where the attribute was defined and result more accurate results. Reviewed By: donsbot Differential Revision: D92757977 fbshipit-source-id: 9a720e3ac6ec807626affa62726694996ecbc2e0
1 parent fb56a80 commit 2eb9533

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

glean/lang/python-pyrefly/tests/regression/without_dynamic_import/declaration_uses/simple/declaration_uses.out

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
"span": { "length": 3, "start": 314 }
1212
}
1313
},
14+
{
15+
"key": {
16+
"declaration": {
17+
"cls": { "key": { "name": { "key": "mod_b.util.Cls" } } }
18+
},
19+
"file": {
20+
"key": "glean/lang/python-pyrefly/tests/regression/without_dynamic_import/declaration_uses/simple/mod_a/__init__.py"
21+
},
22+
"span": { "length": 3, "start": 392 }
23+
}
24+
},
1425
{
1526
"key": {
1627
"declaration": {

glean/lang/python-pyrefly/tests/regression/without_dynamic_import/declaration_uses/simple/xrefs_via_name_by_file.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
"source": { "length": 3, "start": 392 },
1919
"target": { "key": "mod_b.helper.Cls" }
2020
},
21+
{
22+
"source": { "length": 3, "start": 392 },
23+
"target": { "key": "mod_b.util.Cls" }
24+
},
2125
{
2226
"source": { "length": 3, "start": 400 },
2327
"target": { "key": "mod_a.Cls" }

0 commit comments

Comments
 (0)