summaryrefslogtreecommitdiff
path: root/internal/hexailsp/run.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-19 21:41:33 +0300
committerPaul Buetow <paul@buetow.org>2025-08-19 21:41:33 +0300
commitef188388102b0377ed506b8767536233575965bb (patch)
tree837fa426d8f2cc65a1bc144630f968bf2cab5c1a /internal/hexailsp/run.go
parent526e40a54ba325a6f75f35817799614d7b5997b7 (diff)
lsp: reduce eager completions and add throttling\n\n- Defaults: remove ';' 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
Diffstat (limited to 'internal/hexailsp/run.go')
-rw-r--r--internal/hexailsp/run.go22
1 files changed, 12 insertions, 10 deletions
diff --git a/internal/hexailsp/run.go b/internal/hexailsp/run.go
index 64607e3..dd12600 100644
--- a/internal/hexailsp/run.go
+++ b/internal/hexailsp/run.go
@@ -98,14 +98,16 @@ func ensureFactory(factory ServerFactory) ServerFactory {
}
func makeServerOptions(cfg appconfig.App, logContext bool, client llm.Client) lsp.ServerOptions {
- return lsp.ServerOptions{
- LogContext: logContext,
- MaxTokens: cfg.MaxTokens,
- ContextMode: cfg.ContextMode,
- WindowLines: cfg.ContextWindowLines,
- MaxContextTokens: cfg.MaxContextTokens,
- CodingTemperature: cfg.CodingTemperature,
- Client: client,
- TriggerCharacters: cfg.TriggerCharacters,
- }
+ return lsp.ServerOptions{
+ LogContext: logContext,
+ MaxTokens: cfg.MaxTokens,
+ ContextMode: cfg.ContextMode,
+ WindowLines: cfg.ContextWindowLines,
+ MaxContextTokens: cfg.MaxContextTokens,
+ CodingTemperature: cfg.CodingTemperature,
+ Client: client,
+ TriggerCharacters: cfg.TriggerCharacters,
+ // Optional; when zero, server uses a sensible default
+ MinCompletionIntervalMs: 0,
+ }
}