{"record":{"id":"3b1c5296d98871f0","repo":"oraios/serena","slug":"matlab-language-server-script-not-found-in-extensi","errorCode":null,"errorMessage":"MATLAB language server script not found in extension at {extension_path}","messagePattern":"MATLAB language server script not found in extension at (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/matlab_language_server.py","lineNumber":236,"sourceCode":"        def _get_executable_path(cls, extension_path: str) -> str:\n            \"\"\"\n            Get the path to the MATLAB language server executable based on platform.\n\n            The language server is a Node.js script located in the extension's server directory.\n            \"\"\"\n            # The MATLAB extension bundles the language server in the 'server' directory\n            server_dir = os.path.join(extension_path, \"server\", \"out\")\n            main_script = os.path.join(server_dir, \"index.js\")\n\n            if os.path.exists(main_script):\n                return main_script\n\n            # Alternative location\n            alt_script = os.path.join(extension_path, \"out\", \"index.js\")\n            if os.path.exists(alt_script):\n                return alt_script\n\n            raise RuntimeError(f\"MATLAB language server script not found in extension at {extension_path}\")\n\n        @staticmethod\n        def _find_matlab_installation() -> str:\n            \"\"\"\n            Find MATLAB installation path.\n\n            Search order:\n                1. MATLAB_PATH environment variable\n                2. Common installation locations based on platform\n\n            Returns:\n                Path to MATLAB installation directory.\n\n            Raises:\n                RuntimeError: If MATLAB installation is not found.\n\n            \"\"\"\n            # Check environment variable first","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/matlab_language_server.py#L218-L254","documentation":"After locating (or downloading) the VS Code MATLAB extension, the server looks for its language server entry script (first at the standard location, then out/index.js). If neither exists inside the extension directory, _get_executable_path raises RuntimeError, meaning the extension is present but its layout is not what this integration expects.","triggerScenarios":"create_launch_command resolves an extension_path whose directory does not contain the expected server script layout (missing extension/dist or out/index.js) — e.g. MATLAB_EXTENSION_PATH points to the wrong folder, or the downloaded extension's internal layout changed between versions.","commonSituations":"Pointing MATLAB_EXTENSION_PATH at the .vsix file or the VS Code extensions root instead of the specific extension directory; MathWorks renaming internal paths in a newer extension version; a truncated/corrupted download.","solutions":["Set MATLAB_EXTENSION_PATH to the exact extension directory containing the server script (check for dist/index.js or out/index.js inside it)","Re-download/reinstall the MathWorks.language-matlab extension so a complete copy is on disk","Inspect the extension folder contents and confirm the script path the code expects; if the layout changed, pin/use a compatible extension version"],"exampleFix":"# before\nexport MATLAB_EXTENSION_PATH=~/.vscode/extensions   # wrong: parent dir\n# after\nexport MATLAB_EXTENSION_PATH=~/.vscode/extensions/MathWorks.language-matlab-<version>","handlingStrategy":"validation","validationCode":"import os\next = os.environ.get(\"MATLAB_EXTENSION_PATH\", \"\")\nassert ext and (os.path.exists(os.path.join(ext, \"out\", \"index.js\")) or\n                any(os.path.exists(os.path.join(ext, s)) for s in (\"dist/index.js\", \"extension/dist/index.js\"))), \\\n    \"extension dir lacks the expected server script\"","typeGuard":"def has_server_script(ext_dir: str) -> bool:\n    return os.path.isdir(ext_dir) and (\n        os.path.exists(os.path.join(ext_dir, \"out\", \"index.js\")) or\n        os.path.exists(os.path.join(ext_dir, \"dist\", \"index.js\")))","tryCatchPattern":"try:\n    ls = SolidLSP(\"matlab\")\nexcept RuntimeError as e:\n    if \"language server script not found\" in str(e):\n        reinstall_matlab_extension(); ls = SolidLSP(\"matlab\")\n    else:\n        raise","preventionTips":["Point MATLAB_EXTENSION_PATH at the exact extension directory, not the .vsix or the extensions root","Re-download the extension if its internal layout may have changed between versions","Verify out/index.js or dist/index.js exists inside the directory before startup"],"tags":["matlab","nodejs","installation","path"],"backgroundTag":"server-script-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}