示例#1
0
  def DebugInfo( self, request_data ):
    try:
      completer = self._GetSolutionCompleter( request_data )
    except RuntimeError:
      omnisharp_server = responses.DebugInfoServer(
        name = 'OmniSharp',
        handle = None,
        executable = PATH_TO_OMNISHARP_BINARY )

      return responses.BuildDebugInfoResponse( name = 'C#',
                                               servers = [ omnisharp_server ] )

    with completer._server_state_lock:
      solution_item = responses.DebugInfoItem(
        key = 'solution',
        value = completer._solution_path )

      omnisharp_server = responses.DebugInfoServer(
        name = 'OmniSharp',
        handle = completer._omnisharp_phandle,
        executable = PATH_TO_OMNISHARP_BINARY,
        address = 'localhost',
        port = completer._omnisharp_port,
        logfiles = [ completer._filename_stdout, completer._filename_stderr ],
        extras = [ solution_item ] )

      return responses.BuildDebugInfoResponse( name = 'C#',
                                               servers = [ omnisharp_server ] )
示例#2
0
    def DebugInfo(self, request_data):
        environment = self._EnvironmentForRequest(request_data)

        python_interpreter = responses.DebugInfoItem(
            key='Python interpreter', value=environment.executable)

        python_path = responses.DebugInfoItem(
            key='Python path',
            value=str(self._SysPathForFile(request_data, environment)))

        python_version = responses.DebugInfoItem(
            key='Python version',
            value='.'.join(str(item) for item in environment.version_info))

        jedi_version = responses.DebugInfoItem(key='Jedi version',
                                               value=jedi.__version__)

        parso_version = responses.DebugInfoItem(key='Parso version',
                                                value=parso.__version__)

        return responses.BuildDebugInfoResponse(name='Python',
                                                items=[
                                                    python_interpreter,
                                                    python_path,
                                                    python_version,
                                                    jedi_version, parso_version
                                                ])
示例#3
0
    def DebugInfo(self, request_data):
        items = [
            responses.DebugInfoItem('Dart Path', PATH_TO_DART),
        ]

        if self._project_dir:
            items.append(
                responses.DebugInfoItem('Project Directory',
                                        self._project_dir))

        if self._workspace_path:
            items.append(
                responses.DebugInfoItem('Workspace Path',
                                        self._workspace_path))

        return responses.BuildDebugInfoResponse(
            name="Dart",
            servers=[
                responses.DebugInfoServer(name="dart Dart Language Server",
                                          handle=self._server_handle,
                                          executable=PATH_TO_DART,
                                          logfiles=[
                                              self._server_stderr,
                                          ],
                                          extras=items)
            ])
示例#4
0
    def DebugInfo(self, request_data):
        try:
            # Note that it only raises NoExtraConfDetected:
            #  - when extra_conf is None and,
            #  - there is no compilation database
            flags, filename = self._FlagsForRequest(request_data) or []
        except (NoExtraConfDetected, UnknownExtraConf):
            # If _FlagsForRequest returns None or raises, we use an empty list in
            # practice.
            flags = []
            filename = request_data['filepath']

        database = self._flags.LoadCompilationDatabase(filename)
        database_directory = database.database_directory if database else None

        database_item = responses.DebugInfoItem(
            key='compilation database path',
            value='{0}'.format(database_directory))
        flags_item = responses.DebugInfoItem(key='flags',
                                             value='{0}'.format(list(flags)))
        filename_item = responses.DebugInfoItem(key='translation unit',
                                                value=filename)

        return responses.BuildDebugInfoResponse(
            name='C-family', items=[database_item, flags_item, filename_item])
示例#5
0
    def DebugInfo(self, request_data):
        try:
            # Note that it only raises NoExtraConfDetected:
            #  - when extra_conf is None and,
            #  - there is no compilation database
            flags = self._FlagsForRequest(request_data) or []
        except (NoExtraConfDetected, UnknownExtraConf):
            # If _FlagsForRequest returns None or raises, we use an empty list in
            # practice.
            flags = []

        try:
            database_directory = self._flags.FindCompilationDatabase(
                os.path.dirname(request_data['filepath'])).database_directory
        except NoCompilationDatabase:
            database_directory = None

        database_item = responses.DebugInfoItem(
            key='compilation database path',
            value='{0}'.format(database_directory))
        flags_item = responses.DebugInfoItem(key='flags',
                                             value='{0}'.format(list(flags)))

        return responses.BuildDebugInfoResponse(
            name='C-family', items=[database_item, flags_item])
示例#6
0
    def DebugInfo(self, request_data):
        items = [
            responses.DebugInfoItem('Startup Status',
                                    self._server_init_status),
            responses.DebugInfoItem('Java Path', PATH_TO_JAVA),
            responses.DebugInfoItem('Launcher Config.', self._launcher_config),
        ]

        if self._workspace_path:
            items.append(
                responses.DebugInfoItem('Workspace Path',
                                        self._workspace_path))

        items.extend(self.CommonDebugItems())

        return responses.BuildDebugInfoResponse(
            name="Java",
            servers=[
                responses.DebugInfoServer(
                    name="jdt.ls Java Language Server",
                    handle=self._server_handle,
                    executable=self._launcher_path,
                    logfiles=[
                        self._server_stderr,
                        (os.path.join(self._workspace_path, '.metadata',
                                      '.log')
                         if self._workspace_path else None)
                    ],
                    extras=items)
            ])
示例#7
0
 def DebugInfo(self, request_data):
     with self._server_state_mutex:
         clangd = responses.DebugInfoServer(name='clangd',
                                            handle=self._server_handle,
                                            executable=self._clangd_command,
                                            logfiles=[self._stderr_file])
         return responses.BuildDebugInfoResponse(name='clangd',
                                                 servers=[clangd])
示例#8
0
    def DebugInfo(self, request_data):
        with self._server_lock:
            tsserver = responses.DebugInfoServer(name='TSServer',
                                                 handle=self._tsserver_handle,
                                                 executable=PATH_TO_TSSERVER,
                                                 logfiles=[self._logfile])

            return responses.BuildDebugInfoResponse(name='TypeScript',
                                                    servers=[tsserver])
示例#9
0
    def DebugInfo(self, request_data):
        with self._server_state_mutex:
            server = responses.DebugInfoServer(
                name=self.GetServerName(),
                handle=self._server_handle,
                executable=self.GetCommandLine(),
                logfiles=[self._stderr_file],
                extras=self.CommonDebugItems())

        return responses.BuildDebugInfoResponse(name=self.Language(),
                                                servers=[server])
示例#10
0
    def DebugInfo(self, request_data):
        with self._server_state_mutex:
            tern_server = responses.DebugInfoServer(
                name='Tern',
                handle=self._server_handle,
                executable=PATH_TO_TERN_BINARY,
                address=SERVER_HOST,
                port=self._server_port,
                logfiles=[self._server_stdout, self._server_stderr])

            return responses.BuildDebugInfoResponse(name='JavaScript',
                                                    servers=[tern_server])
示例#11
0
    def DebugInfo(self, request_data):
        http_server = responses.DebugInfoServer(
            name='SwiftySwiftVim',
            handle=self._http_phandle,
            executable=PATH_TO_SSVIMHTTP,
            address=SSVIM_IP,
            port=self._http_port,
            logfiles=[self._logfile_stdout, self._logfile_stderr])

        return responses.BuildDebugInfoResponse(
            name='Swift',
            servers=[http_server],
        )
示例#12
0
  def DebugInfo( self, request_data ):
    with self._server_state_mutex:
      extras = self.CommonDebugItems() + self.ExtraDebugItems( request_data )
      logfiles = [ self._stderr_file ]
      logfiles.extend( self.AdditionalLogFiles() )
      server = responses.DebugInfoServer( name = self.GetServerName(),
                                          handle = self._server_handle,
                                          executable = self.GetCommandLine(),
                                          logfiles = logfiles,
                                          extras = extras )

    return responses.BuildDebugInfoResponse( name = self.GetCompleterName(),
                                             servers = [ server ] )
示例#13
0
    def DebugInfo(self, request_data):
        with self._tsserver_lock:
            item_version = responses.DebugInfoItem('version',
                                                   self._tsserver_version)
            tsserver = responses.DebugInfoServer(
                name='TSServer',
                handle=self._tsserver_handle,
                executable=self._tsserver_executable,
                logfiles=[self._logfile],
                extras=[item_version])

            return responses.BuildDebugInfoResponse(name='TypeScript',
                                                    servers=[tsserver])
示例#14
0
    def DebugInfo(self, request_data):
        items = [
            responses.DebugInfoItem('Startup Status', self._server_init_status)
        ]

        return responses.BuildDebugInfoResponse(
            name="Vue",
            servers=[
                responses.DebugInfoServer(name="Vue Language Server",
                                          handle=self._server_handle,
                                          executable=LANGUAGE_SERVER_HOME,
                                          logfiles=[self._server_stderr],
                                          extras=items)
            ])
示例#15
0
    def DebugInfo(self, request_data):
        with self._server_state_lock:
            racerd_server = responses.DebugInfoServer(
                name='Racerd',
                handle=self._racerd_phandle,
                executable=self._racerd_binary,
                address='127.0.0.1',
                port=self._racerd_port,
                logfiles=[self._server_stdout, self._server_stderr])

            rust_sources_item = responses.DebugInfoItem(
                key='Rust sources', value=self._rust_source_path)

            return responses.BuildDebugInfoResponse(name='Rust',
                                                    servers=[racerd_server],
                                                    items=[rust_sources_item])
示例#16
0
    def DebugInfo(self, request_data):
        with self._tsserver_lock:
            item_version = responses.DebugInfoItem('version',
                                                   self._tsserver_version)
            tsserver = responses.DebugInfoServer(name='TSServer',
                                                 handle=self._tsserver_handle,
                                                 executable=PATH_TO_TSSERVER,
                                                 logfiles=[self._logfile],
                                                 extras=[item_version])

            node_executable = responses.DebugInfoItem(key='Node executable',
                                                      value=PATH_TO_NODE)

            return responses.BuildDebugInfoResponse(name='TypeScript',
                                                    servers=[tsserver],
                                                    items=[node_executable])
示例#17
0
    def DebugInfo(self, request_data):
        with self._gocode_lock:
            gocode_server = responses.DebugInfoServer(
                name='Gocode',
                handle=self._gocode_handle,
                executable=self._gocode_binary_path,
                address='127.0.0.1',
                port=self._gocode_port,
                logfiles=[self._gocode_stdout, self._gocode_stderr])

            godef_item = responses.DebugInfoItem(key='Godef executable',
                                                 value=self._godef_binary_path)

            return responses.BuildDebugInfoResponse(name='Go',
                                                    servers=[gocode_server],
                                                    items=[godef_item])
示例#18
0
    def DebugInfo(self, request_data):
        with self._server_lock:
            jedihttp_server = responses.DebugInfoServer(
                name='JediHTTP',
                handle=self._jedihttp_phandle,
                executable=PATH_TO_JEDIHTTP,
                address='127.0.0.1',
                port=self._jedihttp_port,
                logfiles=[self._logfile_stdout, self._logfile_stderr])

            python_interpreter_item = responses.DebugInfoItem(
                key='Python interpreter', value=self._python_binary_path)

            return responses.BuildDebugInfoResponse(
                name='Python',
                servers=[jedihttp_server],
                items=[python_interpreter_item])
示例#19
0
    def DebugInfo(self, request_data):
        with self._server_state_mutex:
            extras = [
                responses.DebugInfoItem(key='configuration file',
                                        value=self._server_project_file),
                responses.DebugInfoItem(key='working directory',
                                        value=self._server_working_dir)
            ]

            tern_server = responses.DebugInfoServer(
                name='Tern',
                handle=self._server_handle,
                executable=PATH_TO_TERN_BINARY,
                address=SERVER_HOST,
                port=self._server_port,
                logfiles=[self._server_stdout, self._server_stderr],
                extras=extras)

            return responses.BuildDebugInfoResponse(name='JavaScript',
                                                    servers=[tern_server])