support editor help #443

Merged
navicore merged 6 commits from words-for-help into main 2026-05-02 05:35:10 +00:00
Owner
No description provided.
support editor help
Some checks failed
CI - Linux / CI - Linux x86_64 (pull_request) Failing after 3m2s
e5ed6914e0
Author
Owner

Reviewed the diff. Two things worth flagging, both minor; correctness and tests look fine otherwise.

1. Duplicated sub-module list in crates/compiler/src/builtins.rs

The 15-entry list of (category_name, add_signatures_fn) in builtin_categories() (lines 73–87) is the same list that BUILTIN_SIGNATURES LazyLock walks at lines 49–63. Adding a new builtin sub-module now requires updating both places. The new test_categories_cover_every_signature guards one direction (signatures present but category missing), so a forgotten registration in builtin_categories() will fail the test — but it would be cleaner to drive both from a single shared &[(name, fn)] constant and have BUILTIN_SIGNATURES iterate over it. Not a bug, just drift bait.

2. Silent parse failures in crates/lsp/src/words.rs:collect_stdlib (lines 75–95)

let program = parser.parse().ok()?; silently drops any stdlib module that fails to parse — the entry just vanishes from the seq/listWords response with no log. If a stdlib file regresses, an editor user sees missing words and there is no breadcrumb in the LSP log. A tracing::warn! on the parse error before discarding would make this debuggable. Same for get_stdlib(module)? returning None (shouldn't happen, since the name came from stdlib_module_names(), but worth at least an expect).

Nothing blocking.

Reviewed the diff. Two things worth flagging, both minor; correctness and tests look fine otherwise. **1. Duplicated sub-module list in `crates/compiler/src/builtins.rs`** The 15-entry list of `(category_name, add_signatures_fn)` in `builtin_categories()` (lines 73–87) is the same list that `BUILTIN_SIGNATURES` LazyLock walks at lines 49–63. Adding a new builtin sub-module now requires updating both places. The new `test_categories_cover_every_signature` guards one direction (signatures present but category missing), so a forgotten registration in `builtin_categories()` will fail the test — but it would be cleaner to drive both from a single shared `&[(name, fn)]` constant and have `BUILTIN_SIGNATURES` iterate over it. Not a bug, just drift bait. **2. Silent parse failures in `crates/lsp/src/words.rs:collect_stdlib` (lines 75–95)** `let program = parser.parse().ok()?;` silently drops any stdlib module that fails to parse — the entry just vanishes from the `seq/listWords` response with no log. If a stdlib file regresses, an editor user sees missing words and there is no breadcrumb in the LSP log. A `tracing::warn!` on the parse error before discarding would make this debuggable. Same for `get_stdlib(module)?` returning `None` (shouldn't happen, since the name came from `stdlib_module_names()`, but worth at least an `expect`). Nothing blocking.
review response
Some checks failed
CI - Linux / CI - Linux x86_64 (pull_request) Failing after 2m57s
e1892b4ad2
fix ci/cd
Some checks failed
CI - Linux / CI - Linux x86_64 (pull_request) Failing after 7m12s
b17ce29bcd
clang version
Some checks failed
CI - Linux / CI - Linux x86_64 (pull_request) Failing after 3m39s
72f505d5ec
clang
Some checks failed
CI - Linux / CI - Linux x86_64 (pull_request) Failing after 18s
c2736278aa
clang
All checks were successful
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 5m0s
cd78025b0f
navicore deleted branch words-for-help 2026-05-02 05:35:10 +00:00
Sign in to join this conversation.
No description provided.