Skip to content

bump jedi compatibility: compare to Path-like object #2

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

Merged
merged 2 commits into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pyls/plugins/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ def pyls_document_symbols(config, document):
if (not sym_full_name.startswith(module_name) and
not sym_full_name.startswith('__main__')):
continue

if _include_def(d) and document.path == d.module_path:
try:
docismodule = os.path.samefile(document.path, d.module_path)
except AttributeError:
# Python 2 on Windows has no .samefile, but then these are
# strings for sure
docismodule = document.path == d.module_path

if _include_def(d) and docismodule:
tuple_range = _tuple_range(d)
if tuple_range in exclude:
continue
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'configparser; python_version<"3.0"',
'future>=0.14.0; python_version<"3"',
'backports.functools_lru_cache; python_version<"3.2"',
'jedi>=0.17.2,<0.18.0',
'jedi>=0.17.2,<0.19.0',
'python-jsonrpc-server>=0.4.0',
'pluggy',
'ujson<=2.0.3 ; platform_system!="Windows" and python_version<"3.0"',
Expand Down