@@ -13,6 +13,7 @@ def pyls_document_symbols(config, document):
13
13
# returns DocumentSymbol[]
14
14
hide_imports = config .plugin_settings ('jedi_symbols' ).get ('hide_imports' , False )
15
15
definitions = document .jedi_names (all_scopes = False )
16
+
16
17
def transform (d ):
17
18
include_d = _include_def (d , hide_imports )
18
19
if include_d is None :
@@ -31,6 +32,7 @@ def transform(d):
31
32
}
32
33
return [dt for dt in (transform (d ) for d in definitions ) if dt ]
33
34
35
+
34
36
def pyls_document_symbols_legacy (config , document ):
35
37
# returns SymbolInformation[]
36
38
all_scopes = config .plugin_settings ('jedi_symbols' ).get ('all_scopes' , True )
@@ -46,11 +48,13 @@ def pyls_document_symbols_legacy(config, document):
46
48
'kind' : _kind (d ),
47
49
} for d in definitions if _include_def (d , hide_imports ) is not None ]
48
50
51
+
49
52
def _include_def (definition , hide_imports = True ):
53
+ # returns
50
54
# True: include def and sub-defs
51
55
# False: include def but do not include sub-defs
52
56
# None: Do not include def or sub-defs
53
- if (# Unused vars should also be skipped
57
+ if ( # Unused vars should also be skipped
54
58
definition .name != '_' and
55
59
definition .is_definition () and
56
60
not definition .in_builtin_module () and
0 commit comments