summaryrefslogtreecommitdiff
path: root/internal/lsp/handlers.go
AgeCommit message (Collapse)Author
2025-08-28lsp/chat: remove '..' trigger; docs: update triggers; tests: align throttle ↵v0.2.1Paul Buetow
test; version: bump to 0.2.1
2025-08-22remove busy checkPaul Buetow
2025-08-22stuffPaul Buetow
2025-08-22logging: log completion TriggerKind and TriggerCharacter for every requestPaul Buetow
2025-08-22completion: only apply leading indentation for ';;text;' prompts; not for ↵Paul Buetow
';text;'
2025-08-22chat: remove ';;' as in-editor chat trigger to avoid conflict with inline ↵Paul Buetow
';;text;' completion; update docs
2025-08-22lsp: suppress auto-trigger when line contains bare ';;' (no ';;text;') ↵Paul Buetow
unless manual invoke; add explicit skip log
2025-08-22lsp: refine ';;text;' detection to require non-empty, non-space content and ↵Paul Buetow
closing ';'; ensure bare ';;' and ';;;' do not auto-trigger; add tests
2025-08-22lsp: always trigger completion on inline semicolon prompts (;text; or ↵Paul Buetow
';;...;'); relax prefix check accordingly; add tests
2025-08-22tests(lsp): add duplicate-prefix and manual-invoke tests; fix cache key to ↵Paul Buetow
ignore trailing whitespace; guard compCache init
2025-08-22lsp: relax short-prefix check for manual invoke and after ')' in signaturesPaul Buetow
2025-08-22lsp: treat manual completion as trigger; remove space from default triggers; ↵Paul Buetow
avoid auto after whitespace
2025-08-20betterPaul Buetow
2025-08-20lsp: add tiny LRU cache for last 10 completions; ignore trailing whitespace ↵Paul Buetow
in cache key; log cache hits; report busy with isIncomplete to prompt client retry
2025-08-19lsp/codeactions: make actions lazy and resolve on selection\n\n- Advertise ↵Paul Buetow
CodeAction resolveProvider and implement codeAction/resolve\n- Return lightweight actions with data; no LLM call during listing\n- On resolve, perform LLM and populate WorkspaceEdit\n- Update tests to cover lazy+resolve flow
2025-08-19logging: highlight LLM no-op skips in yellow\n\n- Add AnsiYellow to logging ↵Paul Buetow
utilities\n- Colorize skip logs (no-trigger, short-prefix, busy) in hexai-lsp logs
2025-08-19lsp: include space in trigger characters and allow space-triggered ↵Paul Buetow
completions\n\n- Defaults now include space (" ") in trigger list\n- Prefix heuristic treats space as structural trigger (no min-prefix required)\n- README and config example updated\n- Tests: add coverage for space trigger
2025-08-19lsp: replace time throttle with in-flight guard; improve short-prefix ↵Paul Buetow
heuristic\n\n- Prevent overlapping LLM requests via llmBusy guard\n- Remove time-based throttle and option plumbing\n- Short-prefix heuristic now skips over trailing whitespace and clamps index\n- Add tests for busy guard and trailing-space allowance
2025-08-19lsp: reduce eager completions and add throttling\n\n- Defaults: remove ';' ↵Paul Buetow
and '?' from trigger characters\n- Add min-typed-prefix heuristic for LLM completions (>=2 chars)\n- Add simple time-based throttle between LLM completions (default 900ms)\n- Tests: verify default triggers and skip logic (throttle + min prefix)\n- Config example: update trigger_characters list
2025-08-19lsp: strip inline spans for completions\n\n- Add stripInlineCodeSpan helper ↵Paul Buetow
to extract first inline backtick span\n- Apply only in completion path after fence stripping\n- Add comprehensive unit tests for inline span handling
2025-08-19chore: commit pending changes in status, LSP, and Ollama modulesPaul Buetow
2025-08-18lsp: strip Markdown code fences from LLM outputs (completions and code actions)Paul Buetow
2025-08-18refactor(lsp,llm,hexailsp,appconfig): split long funcs; add testsPaul Buetow
- Extract helpers to keep funcs <=50 lines; no behavior changes - Add tests for prompt removal, code actions, and LLM request builders - Table-drive TestInParamList; run gofmt
2025-08-18feat(lsp): add coding_temperature knob and remove hardcoded temps\n\n- Add ↵Paul Buetow
to app config and server options.\n- Use in LSP code actions and completions.\n- Default to provider temperature when not set.\n- Update README and config.json.example.
2025-08-17cli+lsp: refactor main packages into internal runners; add testsPaul Buetow
- Move CLI logic to internal/hexaicli with Run/RunWithClient - Move LSP logic to internal/hexailsp with Run/RunWithFactory - Extract helpers; keep behavior identical for both binaries - Add unit tests for hexaicli (input parsing, messages, streaming) and hexailsp (factory wiring, client creation, logging settings) - Add top-of-file summaries and 'Not yet reviewed by a human' comments to all Go files - Update README with internal package docs
2025-08-17lsp/config: make completion trigger characters configurablePaul Buetow
- Add trigger_characters to JSON config and ServerOptions - Store on server and advertise in initialize - Update README and example config - Preserve previous defaults when unset
2025-08-16lsp: add 'Resolve diagnostics' code action scoped to selectionPaul Buetow
- Parse diagnostics from CodeAction context; filter to overlap with selection - Build LLM prompt from selection-only diagnostics; replace only selected range - Keep existing 'Rewrite selection' action; return both when applicable - Add Diagnostic and CodeActionContext types; make CodeActionParams.Context raw JSON - Add helpers for range overlap; unit tests for filtering/overlap - Update README to document resolve-diagnostics action
2025-08-16fix(lsp): avoid duplicate assignment prefix in completionsPaul Buetow
- Prompt: instruct model to only continue from cursor; do not repeat LHS already typed.\n- Add stripDuplicateAssignmentPrefix to drop duplicated 'name :=' or 'name =' when model repeats it.\n- Tests: cover := and = cases.\n- .gitignore: ignore built binary and go caches.
2025-08-16feat(lsp): code action to rewrite selection with instruction detectionPaul Buetow
- Adds textDocument/codeAction handler that rewrites the selected range.\n- Instruction preference: strict ;text; marker first, then //, #, -- line comments, then single-line block comments (/* */ and <!-- -->). Earliest in the selection wins.\n- Removes the matched instruction from the selection before sending to LLM.\n- README: document code action workflow and instruction formats.
2025-08-16refactor(config): drop env-based config (except OPENAI_API_KEY)Paul Buetow
- Switch to config-file-only; only OPENAI_API_KEY read from env.\n- llm: replace env autodetect with Config + NewFromConfig; add newOpenAI/newOllama.\n- lsp: NewServer now accepts injected llm.Client.\n- cli: remove env overrides; extend appConfig with provider-specific fields; build client from config + OPENAI_API_KEY.\n- docs: update README (config-only, defaults to OpenAI, minimal example); simplify flags table.\n- add config.json.example.\n- prompts: enforce ;text; (no spaces) and add ;;text; to remove entire line; tests added.
2025-08-16feat(logging): add LLM stats (averages and per-minute)v0.0.2Paul Buetow
2025-08-16feat(logging): add LLM stats averages and per-minute metricsPaul Buetow
2025-08-16feat(llm): add Ollama provider + provider selection and CLI override; update ↵v0.0.1Paul Buetow
README and logs
2025-08-16lsp/completion: strip inline ;...; prompt markers via AdditionalTextEdits; ↵Paul Buetow
update tests
2025-08-16revert: remove newline-after-colon insertion behavior and its testsPaul Buetow
2025-08-16logging: migrate LSP logs to global singleton (internal/logging); use ↵Paul Buetow
consistent colors/prefix; refactor LLM provider to use global logger and remove per-client loggers
2025-08-16lsp: split monolithic server.go into modules; add configurable max tokens ↵Paul Buetow
and context strategies (minimal|window|file-on-new-func|always-full); provide flags/env fallbacks; add unit tests for helpers and context; update README; remove obsolete files