Mengapa
Gap-analysis vs Serena MCP (LSP-backed IDE-for-agents). Serena punya "Contextual Diagnostics" — retrieve errors/warnings (linting) untuk file/symbol spesifik, bantu agent identifikasi & fix bug. CodeLens TIDAK punya ini — verified: scripts/lsp_client.py hanya request textDocument/definition, textDocument/references, textDocument/hover (grep di sesi ini). TIDAK ada textDocument/publishDiagnostics handler. Agent yang mau tahu "file ini ada error lint apa?" harus jalankan linter eksternal manual — persis grep-manual yang goal CodeLens hindari.
Konteks
CodeLens SUDAH punya infra LSP: lsp_client.py (JSON-RPC ke language server), hybrid_engine.py (--deep flag), commands/lsp.py, doctor --check lsp-status (cek server tersedia). LSP diagnostics datang sebagai server-push notification (textDocument/publishDiagnostics) setelah didOpen — infra didOpen sudah ada (lsp_client.py:304). Tinggal capture notification-nya.
Tujuan
Command/sub-check yang mengembalikan diagnostics (error/warning/hint dari language server) untuk file atau symbol tertentu, dalam shape finding standar. Kandidat lokasi: doctor --check diagnostics atau sub-check baru. Degrade gracefully kalau LSP tidak terinstall (return kosong + note, jangan crash — konsisten dgn pola --deep).
Constraint
- Reuse
lsp_client.py/hybrid_engine.py — JANGAN bikin LSP client kedua.
- LSP OPTIONAL — kalau server tidak ada, return
{status:ok, diagnostics:[], lsp_available:false}, bukan error. Sama seperti --deep sekarang.
publishDiagnostics adalah async server-push — perlu handle timing (buka file, tunggu diagnostics dengan timeout wajar, tutup). Jangan hang kalau server tidak pernah push.
- Design doc WAJIB (feature-class kalau tambah engine/command baru).
Definition of Done
Mengapa
Gap-analysis vs Serena MCP (LSP-backed IDE-for-agents). Serena punya "Contextual Diagnostics" — retrieve errors/warnings (linting) untuk file/symbol spesifik, bantu agent identifikasi & fix bug. CodeLens TIDAK punya ini — verified:
scripts/lsp_client.pyhanya requesttextDocument/definition,textDocument/references,textDocument/hover(grep di sesi ini). TIDAK adatextDocument/publishDiagnosticshandler. Agent yang mau tahu "file ini ada error lint apa?" harus jalankan linter eksternal manual — persis grep-manual yang goal CodeLens hindari.Konteks
CodeLens SUDAH punya infra LSP:
lsp_client.py(JSON-RPC ke language server),hybrid_engine.py(--deepflag),commands/lsp.py,doctor --check lsp-status(cek server tersedia). LSP diagnostics datang sebagai server-push notification (textDocument/publishDiagnostics) setelahdidOpen— infra didOpen sudah ada (lsp_client.py:304). Tinggal capture notification-nya.Tujuan
Command/sub-check yang mengembalikan diagnostics (error/warning/hint dari language server) untuk file atau symbol tertentu, dalam shape finding standar. Kandidat lokasi:
doctor --check diagnosticsatau sub-check baru. Degrade gracefully kalau LSP tidak terinstall (return kosong + note, jangan crash — konsisten dgn pola--deep).Constraint
lsp_client.py/hybrid_engine.py— JANGAN bikin LSP client kedua.{status:ok, diagnostics:[], lsp_available:false}, bukan error. Sama seperti--deepsekarang.publishDiagnosticsadalah async server-push — perlu handle timing (buka file, tunggu diagnostics dengan timeout wajar, tutup). Jangan hang kalau server tidak pernah push.Definition of Done
lsp_available:false, tidak crash/hang