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

Method HandleFileParseRequest

python/ycm/youcompleteme.py:753–786  ·  view source on GitHub ↗
( self, block = False )

Source from the content-addressed store, hash-verified

751
752
753 def HandleFileParseRequest( self, block = False ):
754 if not self.IsServerReady():
755 return
756
757 current_buffer = self.CurrentBuffer()
758 # Order is important here:
759 # FileParseRequestReady has a low cost, while
760 # NativeFiletypeCompletionUsable is a blocking server request
761 if ( not current_buffer.IsResponseHandled() and
762 current_buffer.FileParseRequestReady( block ) and
763 self.NativeFiletypeCompletionUsable() ):
764
765 if self._user_options[ 'show_diagnostics_ui' ]:
766 # Forcefuly update the location list, etc. from the parse request when
767 # doing something like :YcmDiags
768 async_diags = any( self._message_poll_requests.get( filetype )
769 for filetype in vimsupport.CurrentFiletypes() )
770 current_buffer.UpdateDiagnostics( block or not async_diags )
771 else:
772 # If the user disabled diagnostics, we just want to check
773 # the _latest_file_parse_request for any exception or UnknownExtraConf
774 # response, to allow the server to raise configuration warnings, etc.
775 # to the user. We ignore any other supplied data.
776 current_buffer.GetResponse()
777
778 # We set the file parse request as handled because we want to prevent
779 # repeated issuing of the same warnings/errors/prompts. Setting this
780 # makes IsRequestHandled return True until the next request is created.
781 #
782 # Note: it is the server's responsibility to determine the frequency of
783 # error/warning/prompts when receiving a FileReadyToParse event, but
784 # it is our responsibility to ensure that we only apply the
785 # warning/error/prompt received once (for each event).
786 current_buffer.MarkResponseHandled()
787
788
789 def ShouldResendFileParseRequest( self ):

Calls 9

IsServerReadyMethod · 0.95
CurrentBufferMethod · 0.95
IsResponseHandledMethod · 0.80
getMethod · 0.80
UpdateDiagnosticsMethod · 0.80
GetResponseMethod · 0.80
MarkResponseHandledMethod · 0.80
FileParseRequestReadyMethod · 0.45