@@ -52,25 +52,33 @@ def setup_runtime_dependencies(self, logger: MultilspyLogger, config: MultilspyC
5252 del d ["_description" ]
5353
5454 assert platform_id .value in [
55- "linux-x64"
56- ], "Only linux-x64 is supported for in multilspy at the moment"
55+ "linux-x64" ,
56+ "win-x64" ,
57+ "osx-arm64" ,
58+ ], "Unsupported platform: " + platform_id .value
5759
5860 runtime_dependencies = d ["runtimeDependencies" ]
5961 runtime_dependencies = [
6062 dependency for dependency in runtime_dependencies if dependency ["platformId" ] == platform_id .value
6163 ]
6264 assert len (runtime_dependencies ) == 1
63- dependency = runtime_dependencies [0 ]
65+ # Select dependency matching the current platform
66+ dependency = next ((dep for dep in runtime_dependencies if dep ["platformId" ] == platform_id .value ), None )
67+ if dependency is None :
68+ raise RuntimeError (f"No runtime dependency found for platform { platform_id .value } " )
6469
65- clangd_ls_dir = os .path .join (os .path .dirname (__file__ ), "static/ clangd" )
70+ clangd_ls_dir = os .path .join (os .path .dirname (__file__ ), "static" , " clangd" )
6671 clangd_executable_path = os .path .join (clangd_ls_dir , "clangd_19.1.2" , "bin" , dependency ["binaryName" ])
6772 if not os .path .exists (clangd_ls_dir ):
6873 os .makedirs (clangd_ls_dir )
6974 if dependency ["archiveType" ] == "zip" :
7075 FileUtils .download_and_extract_archive (
7176 logger , dependency ["url" ], clangd_ls_dir , dependency ["archiveType" ]
7277 )
73- assert os .path .exists (clangd_executable_path )
78+ else :
79+ raise RuntimeError (f"Unsupported archive type: { dependency ['archiveType' ]} " )
80+ if not os .path .exists (clangd_executable_path ):
81+ raise FileNotFoundError (f"clangd executable was not found at { clangd_executable_path } after extraction" )
7482 os .chmod (clangd_executable_path , stat .S_IEXEC )
7583
7684 return clangd_executable_path
0 commit comments