@bacnh85/pi-serena 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/worker.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bacnh85/pi-serena",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Pi extension that provides Serena semantic code tools through a persistent worker.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/worker.ts CHANGED
@@ -281,10 +281,12 @@ def _handle_diagnostics(req_id, req: dict[str, Any]) -> dict[str, Any]:
281
281
 
282
282
  try:
283
283
  uri = pathlib.Path(str(PurePath(lang_server.repository_root_path, relative_path))).as_uri()
284
- result = lang_server.send.text_document_diagnostic({
284
+ result = lang_server.server.send.text_document_diagnostic({
285
285
  "textDocument": {"uri": uri},
286
286
  })
287
287
  return {"id": req_id, "ok": True, "tool": "get_diagnostics_for_file", "result": _json.dumps(result, indent=2, default=str)}
288
+ except AttributeError:
289
+ return {"id": req_id, "ok": True, "tool": "get_diagnostics_for_file", "result": _json.dumps({"note": "Language server does not support textDocument/diagnostic"})}
288
290
  except Exception as exc:
289
291
  return {"id": req_id, "ok": True, "tool": "get_diagnostics_for_file", "result": _json.dumps({"note": "Diagnostics request completed with no issues or language server does not support textDocument/diagnostic", "detail": str(exc)})}
290
292