fix: swapped error message args, dead code after check=True, missing dotnet v9 (#1250)

1. ls_process.py: swapped values in error message — was reporting
   "read {expected} of {actual}" instead of "read {actual} of {expected}"

2. common.py: check=True made the returncode != 0 branch unreachable
   (CalledProcessError raised before it). Removed check=True so the
   warning logs execute before raising the exception explicitly.

3. ls_utils.py: dotnet version error message listed "4, 6, 7, 8" but
   the code also checks for version 9. Added 9 to the message.
This commit is contained in:
Andrew Barnes authored and GitHub committed 2026-03-31 01:31:21 +02:00
1 parent 01f475ffc3
commit ceb87cb7cd
3 files changed
+5 -7

No files matched your search

+3 -5
View File
@@ -117,7 +117,7 @@ class RuntimeDependencyCollection:
completed_process = subprocess.run(
command,
shell=True,
check=True,
check=False,
cwd=cwd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
@@ -126,10 +126,8 @@ class RuntimeDependencyCollection:
if completed_process.returncode != 0:
log.warning("Command '%s' failed with return code %d", command, completed_process.returncode)
log.warning("Command output:\n%s", completed_process.stdout)
else:
log.info(
"Command completed successfully",
)
raise subprocess.CalledProcessError(completed_process.returncode, command, completed_process.stdout)
log.info("Command completed successfully")
@staticmethod
def _install_from_url(dep: RuntimeDependency, target_dir: str) -> None:
+1 -1
View File
@@ -321,7 +321,7 @@ class LanguageServerProcess:
if not chunk:
if process.poll() is not None:
raise LanguageServerTerminatedException(
f"Process terminated while trying to read response (read {num_bytes} of {len(data)} bytes before termination)",
f"Process terminated while trying to read response (read {len(data)} of {num_bytes} bytes before termination)",
language=self.language,
)
# Process still running but no data available yet, retry after a short delay
+1 -1
View File
@@ -549,7 +549,7 @@ class PlatformUtils:
# If no supported version found, raise exception with all available versions
raise SolidLSPException(
f"No supported dotnet version found. Available versions: {', '.join(available_version_cmd_output)}. Supported versions: 4, 6, 7, 8"
f"No supported dotnet version found. Available versions: {', '.join(available_version_cmd_output)}. Supported versions: 4, 6, 7, 8, 9"
)
except (FileNotFoundError, subprocess.CalledProcessError):
try: