Skip to content

Commit

Permalink
Only resolve up to 100 items
Browse files Browse the repository at this point in the history
On larger projects and slower systems, resolving many items can be very
costly, and not really all that useful.
  • Loading branch information
puremourning committed Jan 21, 2018
1 parent feba227 commit e03836f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ycmd/completers/language_server/language_server_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,12 +797,17 @@ def _ResolveCompletionItems( self, items, request_data ):
start_codepoints = list()
min_start_codepoint = request_data[ 'start_codepoint' ]

# Resolving takes some time, so only do it if there are fewer than 100
# candidates.
resolve_completion_items = ( len( items ) < 100 and
self._resolve_completion_items )

# First generate all of the completion items and store their
# start_codepoints. Then, we fix-up the completion texts to use the
# earliest start_codepoint by borrowing text from the original line.
for item in items:
# First, resolve the completion.
if self._resolve_completion_items:
if resolve_completion_items:
item = self._ResolveCompletionItem( item )

try:
Expand Down

0 comments on commit e03836f

Please sign in to comment.