From 12e1a63204631be09a02a1e7a4d91e6dfbdf03f1 Mon Sep 17 00:00:00 2001 From: Mohamed Moselhy Date: Fri, 26 Mar 2021 10:01:00 -0400 Subject: [PATCH 1/3] 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 --- pythonFiles/completion.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pythonFiles/completion.py b/pythonFiles/completion.py index fd8a15d8df28..5a82d8177ecf 100644 --- a/pythonFiles/completion.py +++ b/pythonFiles/completion.py @@ -581,11 +581,9 @@ def _process_request(self, request): if lookup == "names": return self._serialize_definitions( - jedi.api.names( - source=request.get("source", None), - path=request.get("path", ""), - all_scopes=True, - ), + jedi.Script( + source=request.get("source", None), path=request.get("path", "") + ).get_names(all_scopes=True), request["id"], ) From ff2b2ba455a4564211c4d4ce6d4c9277ec725214 Mon Sep 17 00:00:00 2001 From: Mohamed Moselhy Date: Fri, 26 Mar 2021 12:18:15 -0400 Subject: [PATCH 2/3] Create 15791.md --- news/2 Fixes/15791.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2 Fixes/15791.md diff --git a/news/2 Fixes/15791.md b/news/2 Fixes/15791.md new file mode 100644 index 000000000000..90b3d99b50be --- /dev/null +++ b/news/2 Fixes/15791.md @@ -0,0 +1 @@ +In completions.py: jedi.api.names has been deprecated, switch to new syntax. From d4462305312e5977a3cd3166435fcfbbc1643dab Mon Sep 17 00:00:00 2001 From: Mohamed Moselhy Date: Mon, 29 Mar 2021 17:01:09 -0400 Subject: [PATCH 3/3] Update news/2 Fixes/15791.md Co-authored-by: Karthik Nadig --- news/2 Fixes/15791.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/2 Fixes/15791.md b/news/2 Fixes/15791.md index 90b3d99b50be..d22d1aa578a6 100644 --- a/news/2 Fixes/15791.md +++ b/news/2 Fixes/15791.md @@ -1 +1,2 @@ In completions.py: jedi.api.names has been deprecated, switch to new syntax. +(thanks [moselhy](https://github.com/moselhy)).