{"record":{"id":"346d1e1bb2f52243","repo":"oraios/serena","slug":"language-server-base-launch-command-with-arguments","errorCode":null,"errorMessage":"Language server base launch command with arguments unsupported","messagePattern":"Language server base launch command with arguments unsupported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/solidlsp/dependency_provider.py","lineNumber":177,"sourceCode":"        return [core_path]\n\n    def _create_launch_command_from_base_command(self, base_command: list[str]) -> list[str]:\n        core_path = base_command[0]\n        cmd = self._create_launch_command(core_path)\n        if len(base_command) == 1:\n            # This is the regular case, where the base command consists only of the core\n            # dependency's path, and the launch command is constructed from it.\n            return cmd\n        else:\n            # In this case, the user has overridden the base command via LS-specific settings\n            # with a command that has arguments and therefore does not map cleanly to\n            # the single path assumption. However, in special cases where the full command\n            # was constructed by appending arguments to the core dependency's path,\n            # we simply assume that the provided base command can be substituted.\n            if cmd[0] == core_path:\n                return base_command + cmd[1:]\n            else:\n                raise ValueError(\"Language server base launch command with arguments unsupported\")\n\n\nclass LanguageServerDependencyProviderUvx(LanguageServerDependencyProviderBaseCommand):\n    \"\"\"\n    Dependency provider for language servers distributed as a PyPI package, run on demand via ``uvx`` / ``uv x``.\n\n    The pinned package version can be overridden by the user via the LS-specific setting given by\n    ``version_setting_key``. Alternatively, the LS-specific setting \"ls_path\" can be set to the path of an\n    already-installed language server executable, in which case it is launched directly, bypassing uv entirely.\n    \"\"\"\n\n    DEFAULT_UVX_PYTHON_VERSION = \"3.13\"\n\n    def __init__(\n        self,\n        custom_settings: \"SolidLSPSettings.CustomLSSettings\",\n        ls_resources_dir: str,\n        *,","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/dependency_provider.py#L159-L195","documentation":"Language server dependency providers can substitute a user-configured base launch command for the default one, but only when the recorded command's first element equals the core dependency path. If the stored command has the core path elsewhere (e.g. arguments were appended to build cmd[0]) or cmd[0] differs, the provider cannot safely map the arguments and raises ValueError.","triggerScenarios":"A previously persisted language-server launch command whose first element is not exactly the resolved core dependency path, while base_command has extra arguments — i.e. cmd[0] != core_path during _create_launch_command_from_base_command.","commonSituations":"Users configuring a wrapper script or flags in the language server command; a dependency version/location change (e.g. after upgrade or cache clear) makes the stored path no longer match cmd[0].","solutions":["Clear the persisted custom base command / reset language server settings so the default command is regenerated.","Update the stored command so its first element is exactly the core dependency path, with extra flags as trailing elements.","Remove wrapper-script style commands; configure arguments via the provider's settings instead."],"exampleFix":"// before (stored command embeds args in the executable)\n/opt/tools/node wrapper.sh --langserver.js\n// after (core path first, args after)\n/opt/tools/node --langserver.js","handlingStrategy":"validation","validationCode":"def validate_base_command(base_command: list[str], core_path: str) -> bool:\n    return bool(base_command) and base_command[0] == core_path","typeGuard":"def is_substitutable_command(cmd: list[str], core_path: str) -> bool:\n    return len(cmd) > 0 and isinstance(cmd[0], str) and cmd[0] == core_path","tryCatchPattern":"try:\n    launch_cmd = provider.create_launch_command(base_command)\nexcept ValueError as e:\n    if 'base launch command with arguments unsupported' in str(e):\n        launch_cmd = None  # fall back to provider default\n    else:\n        raise","preventionTips":["Keep the core dependency executable as argv[0]; pass extra flags as subsequent elements.","Clear cached language-server command settings after upgrading or moving dependencies.","Avoid wrapper scripts in custom base commands; use the provider's argument settings instead."],"tags":["language-server","configuration","dependency-management"],"backgroundTag":"unsupported-command-configuration","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}