diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | PROJECTSTATUS.md | 23 | ||||
| -rw-r--r-- | TODO.md | 41 |
3 files changed, 14 insertions, 51 deletions
@@ -2,3 +2,4 @@ /hexai-lsp /.gocache/ /.gomodcache/ +coverage.html diff --git a/PROJECTSTATUS.md b/PROJECTSTATUS.md index 8306caa..04ff2ed 100644 --- a/PROJECTSTATUS.md +++ b/PROJECTSTATUS.md @@ -1,17 +1,23 @@ # Ideas -## Code quality -* [X] Delete dead code: `field noDiskIO is unused (U1000)` in `internal/lsp/server.go:30:2` +## Code qualoty + +* [/] TODO's in the code to be addressed +* [/] No more than 1000 LOC per source file +* [/] No more than 50 LOC per function +* [/] Each struct type in his own file +* [/] Sufficient unit tests ## Features ### Improvements -* [X] TODO's in the code to be addressed -* [ ] Include unit test coverage reports +* [X] Include unit test coverage reports +* [ ] Change inline triggers to include > to be more consistent with other triggers ### New features +* [X] Create "generate unit test" code action for selected code block => write test to FILE_test.go file * [ ] implement a code action for selected code block the way via a unix pipe as faster access in helix * [X] Use hexai as a gh copilot... CLI replacemant for command line questions * [X] Resolve diagnostics code action feature @@ -22,16 +28,13 @@ * [/] Be a replacement for 'github copilot cli' * [X] Be able to perform inline chats (keeping history in the document) * [ ] Be able to switch the underlying model via a prompt -* [/] Fine tune when Large Language Model (LLM) completions trigger, as it seems that there are some cases where the Large Language Model (LLM) receives a request but Helix isn't suggesting any completions. There seems to be something odd with the in logic. Investigate the TriggerChar logic and make sure it matches Helix's expectations. - * [ ] Actually document the completion timeout settings in HelixEditor -* [X] Only one code completion should run at a time, even if multiple triggers occur simultaneously -* [ ] Create "generate unit test" code action for selected code block => write test to FILE_test.go file +* [X] Fine tune when Large Language Model (LLM) completions trigger, as it seems that there are some cases where the Large Language Model (LLM) receives a request but Helix isn't suggesting any completions. There seems to be something odd with the in logic. Investigate the TriggerChar logic and make sure it matches Helix's expectations. * [X] Can anything else can be done with LSP? Be able to select code blocks and perform code actions on them -* [ ] Commenting exiting code -* [ ] Improve code +* [X] Commenting exiting code +* [X] Add unit test (for Go) * [X] Code refactoring (via comment instruction) Be able to switch LLMs. diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 3a4f39f..0000000 --- a/TODO.md +++ /dev/null @@ -1,41 +0,0 @@ -Implement the changes outlined in this TODO document. Mark phases as done once completed. Before marking a phase done, ensure that all unit tests pass. - -When implementing new code, ensure that there is also unit test coverage for it. Once unit tests pass, commit changes always to git after every phase completion. - -Problem statement: When implementing a LSP server for Helix Editor for Auto Code completion, what are the strategies avoiding excessive completion calls? Especially when we use an LLM in the backend it can strain the performance. Is there anything with a debounce strategy we could implement? - -Solutions (sub-divided into phases): - -To avoid excessive completion calls in a Helix Editor LSP server—especially when an LLM is on the backend—debouncing is indeed the primary strategy. Here are the key optimization techniques: - -Phase 1: Remove the LSP auto-completion rate limiter from the Hexai source code. - -Status: Done — removed the single in-flight LLM request concurrency gate so -multiple completion requests can proceed concurrently. Also ensured manual -invocation (TriggerKind=1) always triggers completion even after whitespace. -Updated tests accordingly. - -Phase 2: Debounce completion requests: Introduce a configurable delay (e.g., 100–500 ms) before sending a completion request to the LLM. This prevents a flood of calls while typing. - -Status: Done — added `completion_debounce_ms` (default 200). Server waits until -no recent input activity for at least this duration before LLM calls (both chat -and provider-native paths). Added unit test `TestCompletionDebounce_WaitsUntilQuiet`. - -Phase 3: Throttle on the server side: Beyond debouncing, implement request throttling to cap the maximum rate of LLM calls (e.g., one per 500 ms). This is especially useful when debounce alone isn’t enough under rapid editing. - -Status: Done — added `completion_throttle_ms` (default 0/disabled). Server -serializes LLM calls to maintain a minimum spacing across both chat and -provider-native completion paths. Added unit test -`TestCompletionThrottle_SerializesCalls`. - -Phase 4: I think this is already implemented, verify: Filter incomplete triggers: Avoid sending requests for short or non-meaningful prefixes (e.g., less than 2–3 characters). This reduces noise and unnecessary LLM calls. - -Status: Verified — `prefixHeuristicAllows` enforces a minimal prefix length -unless there is an inline prompt or structural trigger (., :, /, _, )). Manual -invoke may be constrained by `manual_invoke_min_prefix` (default 0). Existing -tests cover prefix handling. - -Phase 5: I think this is already implemented, verify: Server-side caching: Cache recent completions keyed by prefix and file context. This avoids recomputation for repeated or similar queries. - -Status: Verified — small LRU cache (~10) implemented (keyed by URI, position, -left/right text, and context). Tests exist in `completion_cache_test.go`. |
