-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DeprecationWarning on autocompletion with jedi 0.17.0 #12218
Closed
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fcef06c
Fixed the DeprecationWarning: Providing the line is now done in the f…
gorogoroumaru 85de90e
Fixed the DeprecationWarning: Providing the line is now done in the f…
gorogoroumaru ec0642c
Fixed the DeprecationWarning: Providing the line is now done in the f…
gorogoroumaru c84738e
Fixed the DeprecationWarning: Providing the line is now done in the f…
gorogoroumaru 66d5003
Fixed the DeprecationWarning: Providing the line is now done in the f…
gorogoroumaru 8b43745
Merge remote-tracking branch 'origin/work' into work
gorogoroumaru 8590530
Merge remote-tracking branch 'origin/work' into work
gorogoroumaru ecc5302
Merge remote-tracking branch 'origin/work' into work
gorogoroumaru File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1371,15 +1371,14 @@ def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str): | |
else: | ||
raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names)) | ||
|
||
interpreter = jedi.Interpreter( | ||
text[:offset], namespaces, column=cursor_column, line=cursor_line + 1) | ||
script = jedi.Interpreter(text[:offset],namespaces) | ||
try_jedi = True | ||
|
||
try: | ||
# find the first token in the current tree -- if it is a ' or " then we are in a string | ||
completing_string = False | ||
try: | ||
first_child = next(c for c in interpreter._get_module().tree_node.children if hasattr(c, 'value')) | ||
first_child = next(c for c in script._get_module().tree_node.children if hasattr(c, 'value')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you keep |
||
except StopIteration: | ||
pass | ||
else: | ||
|
@@ -1399,7 +1398,7 @@ def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str): | |
if not try_jedi: | ||
return [] | ||
try: | ||
return filter(completion_filter, interpreter.complete()) | ||
return filter(completion_filter, script.complete(column=cursor_column, line=cursor_line + 1)) | ||
except Exception as e: | ||
if self.debug: | ||
return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the name here from
interpreter
toscript
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it’s my mistake.
I will fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I changed the variable name to “interpreter”, some checks were not successful.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change!
About the errors, I don't know why but you can check the tests results by clicking on
details
right next to them. I will try to take a look with it too tomorrow!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is your local python version? On one of the failed checks, there is the following message:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anaconda python3.7.7 is my local python version.
But why my local python version affects travis-CI checks?