MCPcopy
hub / github.com/ycm-core/YouCompleteMe / InlayHintsRequest

Class InlayHintsRequest

python/ycm/client/inlay_hints_request.py:28–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26# FIXME: This is copy/pasta from SemanticTokensRequest - abstract a
27# SimpleAsyncRequest base that does all of this generically
28class InlayHintsRequest( BaseRequest ):
29 def __init__( self, request_data ):
30 super().__init__()
31 self.request_data = request_data
32 self._response_future = None
33
34
35 def Start( self ):
36 self._response_future = self.PostDataToHandlerAsync( self.request_data,
37 'inlay_hints' )
38
39 def Done( self ):
40 return bool( self._response_future ) and self._response_future.done()
41
42
43 def Reset( self ):
44 self._response_future = None
45
46 def Response( self ):
47 if not self._response_future:
48 return []
49
50 response = self.HandleFuture( self._response_future,
51 truncate_message = True )
52
53 if not response:
54 return []
55
56 # Vim may not be able to convert the 'errors' entry to its internal format
57 # so we remove it from the response.
58 errors = response.pop( 'errors', [] )
59 for e in errors:
60 exception = MakeServerException( e )
61 _logger.error( exception )
62 DisplayServerException( exception, truncate_message = True )
63
64 return response.get( 'inlay_hints' ) or []

Callers 1

_NewRequestMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected