|
1 | 1 | # Plan: LSP Client Fixes & Indexing |
2 | 2 |
|
| 3 | +**Released:** v0.4.3 (2026-03-19) — see `release-notes-v0.4.3.md`. |
| 4 | + |
3 | 5 | ## Current Status |
4 | 6 |
|
5 | 7 | ✅ **Completed:** |
|
11 | 13 | - Added LSP SymbolKind fallback: map numeric `kind` to label when `detail` is missing |
12 | 14 | - Enhanced symbol mapping: added MCP-style kind strings ("Part Definition", etc.) with normalized lookup |
13 | 15 | - Analyzed MCP client template patterns |
14 | | -- **✅ Phase 1 Complete:** LSP client now returns symbols correctly; graph has symbol nodes (Package, PartDef) and edges (IN_DOCUMENT, IN_PACKAGE) |
15 | | - |
16 | | -⚠️ **Minor Issue:** |
17 | | -- CLI may exit non-zero after successful indexing (cleanup/close issue), but data is written correctly |
| 16 | +- **✅ Phase 1 Complete:** LSP client returns symbols; graph has symbol nodes and edges (IN_DOCUMENT, IN_PACKAGE) |
| 17 | +- **✅ Phase 2 Complete:** LSP notification handler (e.g. `window/logMessage` when `DEBUG_LSP_NOTIFICATIONS=1`); indexed `modelbase-development/models/`; `graph-map.md` generated with full nodes and interconnection table |
| 18 | +- **✅ CLI exit fix:** (1) Explicit graph store close in `cmdAnalyze` (try/finally). (2) After successful analyze, CLI calls `process.exit(0)` so the process exits before Node/Kuzu teardown (avoids Windows access violation). Verified: `node scripts/index-and-map.mjs test/fixtures/sysml` completes with exit 0 and writes `graph-map.md`. |
18 | 19 |
|
19 | 20 | ## Plan |
20 | 21 |
|
21 | | -### Phase 1: Test & Verify (Immediate) |
22 | | - |
23 | | -1. **Rebuild and test LSP client** |
24 | | - ```bash |
25 | | - npm run build |
26 | | - node lsp/test-server.mjs # Should work (already tested) |
27 | | - ``` |
28 | | - |
29 | | -2. **Test index-and-map with fixed client** |
30 | | - ```bash |
31 | | - npm run index-and-map |
32 | | - ``` |
33 | | - - Check if LSP now returns symbols (with `--stdio`, proper cwd, timeouts) |
34 | | - - If LSP still returns empty, MCP fallback should kick in |
35 | | - - Verify `graph-map.md` has symbol nodes and edges |
36 | | - |
37 | | -3. **If still no edges:** |
38 | | - - Run `node scripts/debug-lsp-symbols.mjs` to see raw LSP response |
39 | | - - Check if MCP fallback is being called (add logging) |
40 | | - - Verify MCP client init succeeds (may need longer timeout or different approach) |
| 22 | +### Phase 1: Test & Verify — ✅ Done |
41 | 23 |
|
42 | | -### Phase 2: Notification Handlers (From Template Analysis) |
| 24 | +1. Rebuild and test LSP client; run index-and-map. |
| 25 | +2. Verify `graph-map.md` has symbol nodes and edges. |
| 26 | +3. Debug LSP/MCP via `scripts/debug-lsp-symbols.mjs` if needed. |
43 | 27 |
|
44 | | -4. **Add LSP notification handlers** |
45 | | - - If server sends `window/logMessage`, register handler instead of ignoring |
46 | | - - Log notifications for debugging |
47 | | - - Pattern from template: `client.setNotificationHandler(schema, handler)` |
| 28 | +### Phase 2: Notification Handlers & Larger Models — ✅ Done |
48 | 29 |
|
49 | | -5. **Test with real SysML files** |
50 | | - - Index `modelbase-development/models/` (larger, more symbols) |
51 | | - - Validate specific file: `deploy-modelbase-development.sysml` |
52 | | - - Check if edges appear with more complex models |
| 30 | +4. **LSP notification handler** — Handler added in `lsp-client.ts`; `window/logMessage` and `window/showMessage` logged when `DEBUG_LSP_NOTIFICATIONS=1`. |
| 31 | +5. **Real SysML files** — Indexed `modelbase-development/models/` (4 files); map shows Action, Block, Package, PartDef, PartUsage, RequirementDef and IN_DOCUMENT/IN_PACKAGE edges. |
53 | 32 |
|
54 | 33 | ### Phase 3: Robustness (If Needed) |
55 | 34 |
|
|
63 | 42 |
|
64 | 43 | ### Phase 4: Validation & Documentation |
65 | 44 |
|
66 | | -8. **Validate the requested file** |
| 45 | +8. **Validate the requested file** (optional) |
67 | 46 | - Use MCP `validate` tool on `deploy-modelbase-development.sysml` |
68 | 47 | - Report syntax errors, semantic issues |
69 | 48 |
|
70 | | -9. **Update documentation** |
71 | | - - Document the fixes in `MCP_INTERACTION_GUIDE.md` |
72 | | - - Add troubleshooting section for "no edges" issue |
73 | | - - Document `lsp/` folder usage |
| 49 | +9. **Documentation** — Done in v0.4.3: fixes in `MCP_INTERACTION_GUIDE.md`, "no edges" and troubleshooting, `lsp/` usage in README and release notes. Further troubleshooting can be added as needed. |
74 | 50 |
|
75 | | -## Immediate Next Steps |
| 51 | +## Next Steps (Phase 3 / 4) |
76 | 52 |
|
77 | | -1. **Rebuild TypeScript** |
78 | | -2. **Run index-and-map** to see if fixes work |
79 | | -3. **Check graph-map.md** for symbol nodes and edges |
80 | | -4. **If still empty:** Debug LSP response and MCP fallback |
| 53 | +1. **Optional:** Connection retry and clearer error reporting (Phase 3). |
| 54 | +2. **Optional:** MCP `validate` on a SysML file; expand troubleshooting in docs (Phase 4). |
81 | 55 |
|
82 | 56 | ## Success Criteria |
83 | 57 |
|
84 | | -- ✅ `graph-map.md` shows symbol nodes (Package, PartDef, etc.) not just Document |
| 58 | +- ✅ `graph-map.md` shows symbol nodes (Package, PartDef, Action, etc.) not just Document |
85 | 59 | - ✅ Interconnection table has edges (IN_DOCUMENT, IN_PACKAGE) |
86 | | -- ✅ Indexing completes without timeouts |
87 | | -- ✅ Validation script works for SysML files |
| 60 | +- ✅ Indexing writes data correctly (LSP + optional MCP fallback) |
| 61 | +- ⏳ Validation script for SysML files (script exists; MCP validate integration optional) |
0 commit comments