Exemple #1
0
def DebugInfo():
  LOGGER.info( 'Received debug info request' )

  output = []
  has_clang_support = ycm_core.HasClangSupport()
  output.append( 'Server has Clang support compiled in: {0}'.format(
    has_clang_support ) )

  if has_clang_support:
    output.append( 'Clang version: ' + ycm_core.ClangVersion() )

  request_data = request.json
  try:
    output.append(
        _GetCompleterForRequestData( request_data ).DebugInfo( request_data) )
  except:
    pass
  return _JsonResponse( '\n'.join( output ) )
Exemple #2
0
    def DebugInfo(self):
        completers = set(self.filetype_completers.values())
        completers.add(self.identcomp)
        output = []
        for completer in completers:
            if not completer:
                continue
            debug = completer.DebugInfo()
            if debug:
                output.append(debug)

        has_clang_support = ycm_core.HasClangSupport()
        output.append(
            'Has Clang support compiled in: {0}'.format(has_clang_support))

        if has_clang_support:
            output.append(ycm_core.ClangVersion())

        return '\n'.join(output)
Exemple #3
0
def DebugInfo():
  _logger.info( 'Received debug info request' )

  output = []
  has_clang_support = ycm_core.HasClangSupport()
  output.append( 'Server has Clang support compiled in: {0}'.format(
    has_clang_support ) )

  if has_clang_support:
    output.append( 'Clang version: ' + ycm_core.ClangVersion() )

  request_data = RequestWrap( request.json )
  try:
    output.append(
        _GetCompleterForRequestData( request_data ).DebugInfo( request_data) )
  except Exception:
    _logger.debug( 'Exception in debug info request: '
                   + traceback.format_exc() )

  return _JsonResponse( '\n'.join( output ) )
Exemple #4
0
def DebugInfo():
    _logger.info('Received debug info request')
    request_data = RequestWrap(request.json)

    has_clang_support = ycm_core.HasClangSupport()
    clang_version = ycm_core.ClangVersion() if has_clang_support else None

    filepath = request_data['filepath']
    try:
        extra_conf_path = extra_conf_store.ModuleFileForSourceFile(filepath)
        is_loaded = bool(extra_conf_path)
    except UnknownExtraConf as error:
        extra_conf_path = error.extra_conf_file
        is_loaded = False

    response = {
        'python': {
            'executable': sys.executable,
            'version': platform.python_version()
        },
        'clang': {
            'has_support': has_clang_support,
            'version': clang_version
        },
        'extra_conf': {
            'path': extra_conf_path,
            'is_loaded': is_loaded
        },
        'completer': None
    }

    try:
        response['completer'] = _GetCompleterForRequestData(
            request_data).DebugInfo(request_data)
    except Exception as error:
        _logger.exception(error)

    return _JsonResponse(response)
Exemple #5
0
from ycmd import extra_conf_store, handlers, user_options_store
from ycmd.completers.completer import Completer
from ycmd.responses import BuildCompletionData
from ycmd.utils import GetCurrentDirectory, OnMac, OnWindows, ToUnicode
import ycm_core

try:
    from unittest import skipIf
except ImportError:
    from unittest2 import skipIf

Py2Only = skipIf(not PY2, 'Python 2 only')
Py3Only = skipIf(PY2, 'Python 3 only')
WindowsOnly = skipIf(not OnWindows(), 'Windows only')
ClangOnly = skipIf(not ycm_core.HasClangSupport(),
                   'Only when Clang support available')
MacOnly = skipIf(not OnMac(), 'Mac only')
UnixOnly = skipIf(OnWindows(), 'Unix only')


def BuildRequest(**kwargs):
    filepath = kwargs['filepath'] if 'filepath' in kwargs else '/foo'
    contents = kwargs['contents'] if 'contents' in kwargs else ''
    filetype = kwargs['filetype'] if 'filetype' in kwargs else 'foo'

    request = {
        'line_num': 1,
        'column_num': 1,
        'filepath': filepath,
        'file_data': {
Exemple #6
0
def GetCompleter( user_options ):
  if ShouldEnableClangdCompleter( user_options ):
    return ClangdCompleter( user_options )
  if ycm_core.HasClangSupport():
    return ClangCompleter( user_options )
  return None
Exemple #7
0
def GetCompleter( user_options ):
  if ycm_core.HasClangSupport():
    return ClangCompleter( user_options )
  else:
    return None
Exemple #8
0
def GetCompleter():
    if ycm_core.HasClangSupport():
        return ClangCompleter()
    else:
        return None