lib/subl/settings.py
def _normalize(self):
        '''
        Calculates and updates any values that haven't been set after parsing
        settings provided to the `parse` method.
        This will calculate things like the default settings path based on the
        ycmd root directory, or the python binary based on the system PATH.
        '''
        if self._ycmd_root_directory:
            resolved_ycmd_root_directory = \
                resolve_abspath(self._ycmd_root_directory)
            if resolved_ycmd_root_directory != self._ycmd_root_directory:
                logger.debug(
                    'resolved ycmd root directory: %r -> %r',
                    self._ycmd_root_directory, resolved_ycmd_root_directory,
                )
                self._ycmd_root_directory = resolved_ycmd_root_directory

            if self._ycmd_default_settings_path:
                # assume that the path is relative to the ycmd root
                resolved_ycmd_default_settings_path = resolve_abspath(
                    self._ycmd_default_settings_path,
                    start=self._ycmd_root_directory,
                )
                if resolved_ycmd_default_settings_path != \
                        self._ycmd_default_settings_path:
                    logger.debug(
                        'resolved ycmd default settings path: %r -> %r',
                        self._ycmd_default_settings_path,
                        resolved_ycmd_default_settings_path,
                    )
                    self._ycmd_default_settings_path = \
                        resolved_ycmd_default_settings_path
            else:
                # calculate default settings path instead
                ycmd_root_directory = self._ycmd_root_directory
                if ycmd_root_directory:
                    ycmd_default_settings_path = \
                        get_default_settings_path(ycmd_root_directory)
                    logger.debug(
                        'calculated default settings path from '
                        'ycmd root directory: %s', ycmd_default_settings_path
                    )
                    self._ycmd_default_settings_path = \
                        ycmd_default_settings_path

        if not self._ycmd_python_binary_path:
            self._ycmd_python_binary_path = default_python_binary_path()
        ycmd_python_binary_path = self._ycmd_python_binary_path

        resolved_python_binary_path = \
            resolve_binary_path(ycmd_python_binary_path)
        if resolved_python_binary_path:
            if resolved_python_binary_path != ycmd_python_binary_path:
                logger.debug(
                    'calculated %s binary path: %s',
                    ycmd_python_binary_path, resolved_python_binary_path,
                )
            self._ycmd_python_binary_path = resolved_python_binary_path
        else:
            logger.error(
                'failed to locate %s binary, '
                'might not be able to start ycmd servers',
                ycmd_python_binary_path
            )

        if self._ycmd_language_whitelist is None:
            logger.debug('using empty whitelist - enable for all scopes')
            self._ycmd_language_whitelist = []

        if self._ycmd_language_blacklist is None:
            logger.debug('using empty blacklist - disable for no scopes')
            self._ycmd_language_blacklist = []

        if self._ycmd_language_filetype is None:
            logger.debug(
                'using empty language to filetype mapping, '
                'the "source." scope will be used as-is for the file type'
            )
            self._ycmd_language_filetype = {}

        if self._ycmd_keep_logs is None:
            self._ycmd_keep_logs = False

        if not self._sublime_ycmd_background_threads:
            # Default is the same as in `concurrent.futures.ThreadPoolExecutor`
            cpu_count = get_cpu_count()
            thread_count = cpu_count * 5
            logger.debug(
                'calculated default background thread count: %r', thread_count,
            )
            self._sublime_ycmd_background_threads = thread_count

        Calculates and updates any values that haven't been set after parsing
        settings provided to the `parse` method.
        This will calculate things like the default settings path based on the
        ycmd root directory, or the python binary based on the system PATH.
        
Calculates and updates any values that haven't been set after parsing
settings provided to the `parse` method.
This will calculate things like the default settings path based on the
ycmd root directory, or the python binary based on the system PATH.
Calculates and updates any values that haven ' t been set after parsing settings provided to the ` parse ` method . This will calculate things like the default settings path based on the ycmd root directory or the python binary based on the system PATH .
def _normalize(self):
        if self._ycmd_root_directory:
            resolved_ycmd_root_directory = \
                resolve_abspath(self._ycmd_root_directory)
            if resolved_ycmd_root_directory != self._ycmd_root_directory:
                logger.debug(
                    'resolved ycmd root directory: %r -> %r',
                    self._ycmd_root_directory, resolved_ycmd_root_directory,
                )
                self._ycmd_root_directory = resolved_ycmd_root_directory
            if self._ycmd_default_settings_path:
                resolved_ycmd_default_settings_path = resolve_abspath(
                    self._ycmd_default_settings_path,
                    start=self._ycmd_root_directory,
                )
                if resolved_ycmd_default_settings_path != \
                        self._ycmd_default_settings_path:
                    logger.debug(
                        'resolved ycmd default settings path: %r -> %r',
                        self._ycmd_default_settings_path,
                        resolved_ycmd_default_settings_path,
                    )
                    self._ycmd_default_settings_path = \
                        resolved_ycmd_default_settings_path
            else:
                ycmd_root_directory = self._ycmd_root_directory
                if ycmd_root_directory:
                    ycmd_default_settings_path = \
                        get_default_settings_path(ycmd_root_directory)
                    logger.debug(
                        'calculated default settings path from '
                        'ycmd root directory: %s', ycmd_default_settings_path
                    )
                    self._ycmd_default_settings_path = \
                        ycmd_default_settings_path
        if not self._ycmd_python_binary_path:
            self._ycmd_python_binary_path = default_python_binary_path()
        ycmd_python_binary_path = self._ycmd_python_binary_path
        resolved_python_binary_path = \
            resolve_binary_path(ycmd_python_binary_path)
        if resolved_python_binary_path:
            if resolved_python_binary_path != ycmd_python_binary_path:
                logger.debug(
                    'calculated %s binary path: %s',
                    ycmd_python_binary_path, resolved_python_binary_path,
                )
            self._ycmd_python_binary_path = resolved_python_binary_path
        else:
            logger.error(
                'failed to locate %s binary, '
                'might not be able to start ycmd servers',
                ycmd_python_binary_path
            )
        if self._ycmd_language_whitelist is None:
            logger.debug('using empty whitelist - enable for all scopes')
            self._ycmd_language_whitelist = []
        if self._ycmd_language_blacklist is None:
            logger.debug('using empty blacklist - disable for no scopes')
            self._ycmd_language_blacklist = []
        if self._ycmd_language_filetype is None:
            logger.debug(
                'using empty language to filetype mapping, '
                'the "source." scope will be used as-is for the file type'
            )
            self._ycmd_language_filetype = {}
        if self._ycmd_keep_logs is None:
            self._ycmd_keep_logs = False
        if not self._sublime_ycmd_background_threads:
            cpu_count = get_cpu_count()
            thread_count = cpu_count * 5
            logger.debug(
                'calculated default background thread count: %r', thread_count,
            )
            self._sublime_ycmd_background_threads = thread_count
def _normalize ( self ) : if self . _ycmd_root_directory : resolved_ycmd_root_directory = resolve_abspath ( self . _ycmd_root_directory ) if resolved_ycmd_root_directory != self . _ycmd_root_directory : logger . debug ( 'resolved ycmd root directory: %r -> %r' , self . _ycmd_root_directory , resolved_ycmd_root_directory , ) self . _ycmd_root_directory = resolved_ycmd_root_directory if self . _ycmd_default_settings_path : resolved_ycmd_default_settings_path = resolve_abspath ( self . _ycmd_default_settings_path , start = self . _ycmd_root_directory , ) if resolved_ycmd_default_settings_path != self . _ycmd_default_settings_path : logger . debug ( 'resolved ycmd default settings path: %r -> %r' , self . _ycmd_default_settings_path , resolved_ycmd_default_settings_path , ) self . _ycmd_default_settings_path = resolved_ycmd_default_settings_path else : ycmd_root_directory = self . _ycmd_root_directory if ycmd_root_directory : ycmd_default_settings_path = get_default_settings_path ( ycmd_root_directory ) logger . debug ( 'calculated default settings path from ' 'ycmd root directory: %s' , ycmd_default_settings_path ) self . _ycmd_default_settings_path = ycmd_default_settings_path if not self . _ycmd_python_binary_path : self . _ycmd_python_binary_path = default_python_binary_path ( ) ycmd_python_binary_path = self . _ycmd_python_binary_path resolved_python_binary_path = resolve_binary_path ( ycmd_python_binary_path ) if resolved_python_binary_path : if resolved_python_binary_path != ycmd_python_binary_path : logger . debug ( 'calculated %s binary path: %s' , ycmd_python_binary_path , resolved_python_binary_path , ) self . _ycmd_python_binary_path = resolved_python_binary_path else : logger . error ( 'failed to locate %s binary, ' 'might not be able to start ycmd servers' , ycmd_python_binary_path ) if self . _ycmd_language_whitelist is None : logger . debug ( 'using empty whitelist - enable for all scopes' ) self . _ycmd_language_whitelist = [ ] if self . _ycmd_language_blacklist is None : logger . debug ( 'using empty blacklist - disable for no scopes' ) self . _ycmd_language_blacklist = [ ] if self . _ycmd_language_filetype is None : logger . debug ( 'using empty language to filetype mapping, ' 'the "source." scope will be used as-is for the file type' ) self . _ycmd_language_filetype = { } if self . _ycmd_keep_logs is None : self . _ycmd_keep_logs = False if not self . _sublime_ycmd_background_threads : cpu_count = get_cpu_count ( ) thread_count = cpu_count * 5 logger . debug ( 'calculated default background thread count: %r' , thread_count , ) self . _sublime_ycmd_background_threads = thread_count
Calculates and updates any values that haven't been set after parsing
settings provided to the `parse` method.
Calculates and updates any values that haven ' t been set after parsing settings provided to the ` parse ` method .
'''
        Calculates and updates any values that haven't been set after parsing
        settings provided to the `parse` method.
        This will calculate things like the default settings path based on the
        ycmd root directory, or the python binary based on the system PATH.
        ''' # assume that the path is relative to the ycmd root # calculate default settings path instead # Default is the same as in `concurrent.futures.ThreadPoolExecutor`
self