diff --git a/pyls/plugins/symbols.py b/pyls/plugins/symbols.py index 6468dd83..ef8e7fb8 100644 --- a/pyls/plugins/symbols.py +++ b/pyls/plugins/symbols.py @@ -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 diff --git a/setup.py b/setup.py index 12782990..99d2b312 100755 --- a/setup.py +++ b/setup.py @@ -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"',