|
53 | 53 | "osx-arm64": "mac-aarch64", |
54 | 54 | } |
55 | 55 |
|
56 | | -# Java runtime dependency information per platform |
57 | | -JAVA_DEPENDENCIES = { |
58 | | - "win-x64": { |
59 | | - "url": "https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-win32-x64-1.42.0-561.vsix", |
60 | | - "archiveType": "zip", |
61 | | - "java_home_path": "extension/jre/21.0.7-win32-x86_64", |
62 | | - "java_path": "extension/jre/21.0.7-win32-x86_64/bin/java.exe", |
63 | | - }, |
64 | | - "linux-x64": { |
65 | | - "url": "https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-linux-x64-1.42.0-561.vsix", |
66 | | - "archiveType": "zip", |
67 | | - "java_home_path": "extension/jre/21.0.7-linux-x86_64", |
68 | | - "java_path": "extension/jre/21.0.7-linux-x86_64/bin/java", |
69 | | - }, |
70 | | - "linux-arm64": { |
71 | | - "url": "https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-linux-arm64-1.42.0-561.vsix", |
72 | | - "archiveType": "zip", |
73 | | - "java_home_path": "extension/jre/21.0.7-linux-aarch64", |
74 | | - "java_path": "extension/jre/21.0.7-linux-aarch64/bin/java", |
75 | | - }, |
76 | | - "osx-x64": { |
77 | | - "url": "https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-darwin-x64-1.42.0-561.vsix", |
78 | | - "archiveType": "zip", |
79 | | - "java_home_path": "extension/jre/21.0.7-macosx-x86_64", |
80 | | - "java_path": "extension/jre/21.0.7-macosx-x86_64/bin/java", |
81 | | - }, |
82 | | - "osx-arm64": { |
83 | | - "url": "https://github.com/redhat-developer/vscode-java/releases/download/v1.42.0/java-darwin-arm64-1.42.0-561.vsix", |
84 | | - "archiveType": "zip", |
85 | | - "java_home_path": "extension/jre/21.0.7-macosx-aarch64", |
86 | | - "java_path": "extension/jre/21.0.7-macosx-aarch64/bin/java", |
87 | | - }, |
88 | | -} |
89 | | - |
90 | 56 |
|
91 | 57 | class KotlinLanguageServer(SolidLanguageServer): |
92 | 58 | """ |
@@ -135,32 +101,13 @@ def _get_or_install_core_dependency(self) -> str: |
135 | 101 | kotlin_suffix = PLATFORM_KOTLIN_SUFFIX.get(platform_id.value) |
136 | 102 | assert kotlin_suffix, f"Unsupported platform for Kotlin LSP: {platform_id.value}" |
137 | 103 |
|
138 | | - java_dependency = JAVA_DEPENDENCIES[platform_id.value] |
139 | | - |
140 | 104 | # Setup paths for dependencies |
141 | 105 | static_dir = os.path.join(self._ls_resources_dir, "kotlin_language_server") |
142 | 106 | os.makedirs(static_dir, exist_ok=True) |
143 | 107 |
|
144 | | - # Setup Java |
145 | | - java_dir = os.path.join(static_dir, "java") |
146 | | - os.makedirs(java_dir, exist_ok=True) |
147 | | - |
148 | | - self._java_home_path = os.path.join(java_dir, java_dependency["java_home_path"]) |
149 | | - java_path = os.path.join(java_dir, java_dependency["java_path"]) |
150 | | - |
151 | | - if not os.path.exists(java_path): |
152 | | - log.info(f"Downloading Java for {platform_id.value}...") |
153 | | - FileUtils.download_and_extract_archive(java_dependency["url"], java_dir, java_dependency["archiveType"]) |
154 | | - if not platform_id.value.startswith("win-"): |
155 | | - os.chmod(java_path, 0o755) |
156 | | - |
157 | | - assert os.path.exists(java_path), f"Java executable not found at {java_path}" |
158 | | - |
159 | 108 | # Setup Kotlin Language Server |
160 | | - if platform_id.value.startswith("win-"): |
161 | | - kotlin_script = os.path.join(static_dir, "kotlin-lsp.cmd") |
162 | | - else: |
163 | | - kotlin_script = os.path.join(static_dir, "kotlin-lsp.sh") |
| 109 | + kotlin_script_name = "kotlin-lsp.cmd" if platform_id.value.startswith("win-") else "kotlin-lsp.sh" |
| 110 | + kotlin_script = os.path.join(static_dir, kotlin_script_name) |
164 | 111 |
|
165 | 112 | if not os.path.exists(kotlin_script): |
166 | 113 | kotlin_lsp_version = self._custom_settings.get("kotlin_lsp_version", DEFAULT_KOTLIN_LSP_VERSION) |
|
0 commit comments