We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40afab3 commit e442467Copy full SHA for e442467
pyls/plugins/symbols.py
@@ -36,8 +36,14 @@ def pyls_document_symbols(config, document):
36
if (not sym_full_name.startswith(module_name) and
37
not sym_full_name.startswith('__main__')):
38
continue
39
-
40
- if _include_def(d) and os.path.samefile(document.path, d.module_path):
+ try:
+ docismodule = os.path.samefile(document.path, d.module_path)
41
+ except AttributeError:
42
+ # Python 2 on Windows has no .samefile, but then these are
43
+ # strings for sure
44
+ docismodule = document.path == d.module_path
45
+
46
+ if _include_def(d) and docismodule:
47
tuple_range = _tuple_range(d)
48
if tuple_range in exclude:
49
0 commit comments