Creates a language specific LanguageServer instance based on the given configuration, and appropriate settings for the programming language. If language is Java, then ensure that jdk-17.0.6 or higher is installed, `java` is in PATH, and JAVA_HOME is set to the installation director
(cls, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str)
| 60 | |
| 61 | @classmethod |
| 62 | def create(cls, config: MultilspyConfig, logger: MultilspyLogger, repository_root_path: str) -> "LanguageServer": |
| 63 | """ |
| 64 | Creates a language specific LanguageServer instance based on the given configuration, and appropriate settings for the programming language. |
| 65 | |
| 66 | If language is Java, then ensure that jdk-17.0.6 or higher is installed, `java` is in PATH, and JAVA_HOME is set to the installation directory. |
| 67 | |
| 68 | :param repository_root_path: The root path of the repository. |
| 69 | :param config: The Multilspy configuration. |
| 70 | :param logger: The logger to use. |
| 71 | |
| 72 | :return LanguageServer: A language specific LanguageServer instance. |
| 73 | """ |
| 74 | if config.code_language == Language.PYTHON: |
| 75 | from hyperagent.multilspy.language_servers.jedi_language_server.jedi_server import ( |
| 76 | JediServer, |
| 77 | ) |
| 78 | |
| 79 | return JediServer(config, logger, repository_root_path) |
| 80 | elif config.code_language == Language.JAVA: |
| 81 | from hyperagent.multilspy.language_servers.eclipse_jdtls.eclipse_jdtls import ( |
| 82 | EclipseJDTLS, |
| 83 | ) |
| 84 | |
| 85 | return EclipseJDTLS(config, logger, repository_root_path) |
| 86 | elif config.code_language == Language.RUST: |
| 87 | from hyperagent.multilspy.language_servers.rust_analyzer.rust_analyzer import ( |
| 88 | RustAnalyzer, |
| 89 | ) |
| 90 | |
| 91 | return RustAnalyzer(config, logger, repository_root_path) |
| 92 | elif config.code_language == Language.CSHARP: |
| 93 | from hyperagent.multilspy.language_servers.omnisharp.omnisharp import OmniSharp |
| 94 | |
| 95 | return OmniSharp(config, logger, repository_root_path) |
| 96 | else: |
| 97 | logger.log(f"Language {config.code_language} is not supported", logging.ERROR) |
| 98 | raise MultilspyException(f"Language {config.code_language} is not supported") |
| 99 | |
| 100 | def __init__( |
| 101 | self, |
no test coverage detected