diff --git a/src/solidlsp/ls_handler.py b/src/solidlsp/ls_handler.py index 65a5931..731952f 100644 --- a/src/solidlsp/ls_handler.py +++ b/src/solidlsp/ls_handler.py @@ -2,6 +2,7 @@ import asyncio import json import logging import os +import platform import subprocess import threading import time @@ -147,9 +148,15 @@ class SolidLanguageServerHandler: child_proc_env = os.environ.copy() child_proc_env.update(self.process_launch_info.env) + cmd = self.process_launch_info.cmd + is_windows = platform.system() == "Windows" + if not isinstance(cmd, str) and not is_windows: + # Since we are using the shell, we need to convert the command list to a single string + # on Linux/macOS + cmd = " ".join(cmd) log.info("Starting language server process via command: %s", self.process_launch_info.cmd) self.process = subprocess.Popen( - self.process_launch_info.cmd, + cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE,