Skip to content

Commit 12fb975

Browse files
committed
Fix the way we prepare a hierarchy item for resolution
1 parent 2422195 commit 12fb975

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ycmd/completers/language_server/language_server_completer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,10 +2699,9 @@ def Hierarchy( self, request_data, args ):
26992699

27002700
preparation_item, direction, kind = args
27012701

2702-
# Remove ycmd things
2703-
if 'fromRanges' in preparation_item:
2704-
name_and_kind_key = 'to' if direction == 'outgoing' else 'from'
2705-
preparation_item = preparation_item[ name_and_kind_key ]
2702+
if item := ( preparation_item.get( 'from' ) or
2703+
preparation_item.get( 'to' ) ):
2704+
preparation_item = item
27062705
else:
27072706
del preparation_item[ 'locations' ]
27082707
kind_number = lsp.SYMBOL_KIND.index( preparation_item[ 'kind' ] )

0 commit comments

Comments
 (0)