Beispiel #1
0
    def get_conf_options(self, section: Optional[str] = None):
        """
        Get all options from the given section.

        Parameters
        ----------
        section: Optional[str]
            Section in the configuration system, e.g. `shortcuts`. If None,
            then the value of `CONF_SECTION` is used.

        Returns
        -------
        values: BasicTypes
            Values of the option in the configuration section.

        Raises
        ------
        spyder.py3compat.configparser.NoOptionError
            If the section does not exist in the configuration.
        """
        section = self.CONF_SECTION if section is None else section
        if section is None:
            raise AttributeError(
                'A SpyderConfigurationAccessor must define a `CONF_SECTION` '
                'class attribute!'
            )
        return CONF.options(section)
Beispiel #2
0
 def get_languages(self):
     """
     Get the list of languages we need to start servers and create
     clients for.
     """
     languages = ['python']
     all_options = CONF.options(self.CONF_SECTION)
     for option in all_options:
         if option in [l.lower() for l in LSP_LANGUAGES]:
             languages.append(option)
     return languages
Beispiel #3
0
def iter_servers():
    for option in CONF.options('lsp-server'):
        if option in [l.lower() for l in LSP_LANGUAGES]:
            server = LSPServer(language=option)
            server.load()
            yield server
Beispiel #4
0
def iter_servers():
    for option in CONF.options('lsp-server'):
        if option in LANGUAGE_SET:
            server = LSPServer(language=option)
            server.load()
            yield server