{"record":{"id":"cdea80b3023573f8","repo":"zed-industries/zed","slug":"unknown-method-method","errorCode":null,"errorMessage":"Unknown method: ${method}","messagePattern":"Unknown method: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"crates/prettier/src/prettier_server.js","lineNumber":237,"sourceCode":"      `Resolved config: ${JSON.stringify(resolvedConfig)}, will format file '${\n        params.options.filepath || \"\"\n      }' with options: ${JSON.stringify(options)}\\n`,\n    );\n    const formattedText = await prettier.prettier.format(params.text, options);\n    sendResponse({ id, result: { text: formattedText } });\n  } else if (method === \"prettier/clear_cache\") {\n    prettier.prettier.clearConfigCache();\n    prettier.config = (await prettier.prettier.resolveConfig(prettier.path)) || {};\n    sendResponse({ id, result: null });\n  } else if (method === \"initialize\") {\n    sendResponse({\n      id,\n      result: {\n        capabilities: {},\n      },\n    });\n  } else {\n    throw new Error(`Unknown method: ${method}`);\n  }\n}\n\nfunction makeError(message) {\n  return {\n    error: {\n      code: -32600, // invalid request code\n      message,\n    },\n  };\n}\n\nfunction sendResponse(response) {\n  const responsePayloadString = JSON.stringify({\n    jsonrpc: \"2.0\",\n    ...response,\n  });\n  const headers = `${contentLengthHeaderName}: ${Buffer.byteLength(","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/prettier/src/prettier_server.js#L219-L255","documentation":"The third path segment of a github.com URL must be the literal 'blob' for the importer to convert it into a raw URL. URLs whose segment is 'tree', 'commits', 'releases', 'raw', and so on are rejected because they point at a listing or metadata page, not a file.","triggerScenarios":"Pasting github.com/owner/repo/tree/main/docs (directory listing), github.com/owner/repo/commits/main, github.com/owner/repo/releases/tag/v1, or any URL where the kind segment differs from 'blob'.","commonSituations":"The user copied the address bar while browsing a folder (tree view) instead of an opened file; clicking through GitHub UI leaves /tree/ in the URL.","solutions":["Click the actual .md file in the tree so the URL contains /blob/, then copy it","Or hand-edit the URL, replacing 'tree' with 'blob', keeping the same ref and path"],"exampleFix":"# before\nhttps://github.com/acme/skills/tree/main/src/SKILL.md\n\n# after\nhttps://github.com/acme/skills/blob/main/src/SKILL.md","handlingStrategy":"validation","validationCode":"let segments: Vec<&str> = url.path_segments().map(Iterator::collect).unwrap_or_default();\nensure!(segments.get(2) == Some(&\"blob\"), \"Paste a GitHub blob URL that points to a .md file\");","typeGuard":"fn is_blob_kind(url: &url::Url) -> bool {\n    url.path_segments()\n        .and_then(|s| s.nth(2))\n        .map(|kind| kind == \"blob\")\n        .unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Reject /tree/, /commits/, /releases/ URLs client-side with a hint to open the file itself","Auto-suggest replacing 'tree' with 'blob' in the import UI"],"tags":["url-validation","github","path-parsing"],"backgroundTag":"url-path-parsing","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}