You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `complete FILE LINE COL` to the AffineScript CLI, powering LSP
completion. Three moving parts:
* `lib/json_output.ml` — `extract_prefix_at` scans backward from the
cursor column to extract the identifier prefix and detect a
dot-access context; `collect_completions` filters the symbol table
by prefix match and appends keyword candidates (suppressed in dot
context); `emit_completions` serialises the list as a JSON array
with `{name, kind, type, detail}` per item.
* `bin/main.ml` — `complete_file` reads the source, calls
`extract_prefix_at` + `collect_completions`, and emits the result;
`complete_cmd` (FILE LINE COL, 1-based LSP convention) added and
wired into the default command group.
* `test/test_e2e.ml` — 6 new E2E tests under "E2E LSP Phase C"
covering: prefix extraction correctness, prefix match returning a
symbol, empty prefix returning candidates, unknown prefix returning
empty, keyword inclusion, dot-context keyword suppression.
101 total tests, 0 regressions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments