[gemma4] refactor using treesitter

This commit is contained in:
2026-06-20 10:56:52 +02:00
parent 49f0f23a54
commit d600c0a8ca
10 changed files with 141 additions and 434 deletions
+6 -7
View File
@@ -15,19 +15,18 @@ This document outlines the identified fragilities in the `skillls` project and t
**Proposed Actions**:
- [x] Refactor `SkillParser._traverse_tree` to use an iterative approach (using a stack/deque) instead of recursion.
## s3. Single Source of Truth for Errors
## 3. Single Source of Truth for Errors
**Problem**: The project is in a transitional state where error management is split between the new `SkillParser` diagnostics and the legacy `server.errs` dictionary in `main.py`.
**Goal**: Unify error reporting into a single, streamlined pipeline.
**Proposed Actions**:
- [ ] Complete the refactor of `skillls/main.py`.
- [ ] Remove the `errs` dictionary from `SkillLanguageServer`.
- [ ] Decommission and delete deprecated files: `skillls/checker.py` and unused parts of `skillls/helpers.py`.
- [x] Complete the refactor of `skillls/main.py`.
- [x] Remove the `errs` dictionary from `SkillLanguageServer`.
- [x] Decommission and delete deprecated files: `skillls/checker.py` and unused parts of `skillls/helpers.py`.
## 5. Test Suite Strengthening
**Problem**: While core logic is tested, the LSP lifecycle and complex parsing edge cases lack specific unit test coverage.
**Goal**: Achieve high-confidence verification of the LSP server's behavior and parser robustness.
**Proposed Actions**:
- [ ] Implement `tests/test_server.py` to verify LSP lifecycle events (`didOpen`, `didChange`) and diagnostic publishing logic.
- [ ] Expand `tests/test_helpers.py` with specialized unit tests for the `find_scopes` regex and brace-tracking logic.
- [ ] Harden `tests/test_parser.py` by implementing deterministic symbol extraction verification instead of existence checks.
- [x] Implement \`tests/test_server.py\` to verify LSP lifecycle events (\`didOpen\`, \`didChange\`) and diagnostic publishing logic.
- [x] Harden `tests/test_parser.py` by implementing deterministic symbol extraction verification instead of existence checks.