Skip to content

Commit 7802743

Browse files
completions to use new Jedi get_names method (#15791)
* completions to use new Jedi get_names method jedi.api.names has been deprecated, use new syntax instead. * note I could have used the Script object initialized in the lines right below the change, but I went the safe route since the method enclosing the change returns pre-emptively * Create 15791.md * Update news/2 Fixes/15791.md Co-authored-by: Karthik Nadig <[email protected]> Co-authored-by: Karthik Nadig <[email protected]>
1 parent d2ab232 commit 7802743

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

news/2 Fixes/15791.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
In completions.py: jedi.api.names has been deprecated, switch to new syntax.
2+
(thanks [moselhy](https://github.com/moselhy)).

pythonFiles/completion.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,9 @@ def _process_request(self, request):
581581

582582
if lookup == "names":
583583
return self._serialize_definitions(
584-
jedi.api.names(
585-
source=request.get("source", None),
586-
path=request.get("path", ""),
587-
all_scopes=True,
588-
),
584+
jedi.Script(
585+
source=request.get("source", None), path=request.get("path", "")
586+
).get_names(all_scopes=True),
589587
request["id"],
590588
)
591589

0 commit comments

Comments
 (0)