fix(language-server): judge unknown ingredients with the analyzer's resolution #278
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!278
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lsp-unknown-ingredient-verdict"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The editor's "unknown ingredient" verdict now comes from the analyzer (
getIngredientData), the same resolution as the nutrition estimate andanalyzed.missingIngredients. Until now the language server kept its own lookup (raw keys, lowercased names, a French plural guess), and the two disagreed both ways:@carottes,@œufs,@eggs,@tomates cerises,@sels fins, and even@pâtes(pasta) matched aspâte(pastry).@olive-oil,@Huile d’olive(curly apostrophe),@huile-d-olive, a hyphenated alias (@sel-de-table,@Bok-Choy), a database key not written as a slug (Butter).Changes:
UNKNOWN_INGREDIENT, the nutrition hover and "Convert to grams" all go throughgetIngredientData.isKnownIngredient,lookupIngredientandbuildIngredientLookupSetare removed, along with thelookupSetplumbing (provideDiagnostics,ResolvedDb,DbReloadDeps,server.ts).@carottesis flagged with "Did you mean '@Carotte'?". Write the singular or add the plural to the entry'saliases.findClosestIngredientcompares the slugs of key, name and aliases, so it also suggests through a key not written as a slug.This is the routing step of PR 5a of the DX plan: the bug is in released behavior and does not depend on the planned move, so it ships as a patch on
main. PR 5a (movingisKnownIngredient/findClosestIngredientinto the analyzer) follows ondev/1.6oncemainis merged back.Checks:
tests/unknown-ingredient-verdict.test.ts(24 FR/EN cases comparing editor, hover andanalyze().missingIngredients), typecheck, biome,bun test(3919 pass, 1 skip), conformance unchanged (142/142, 24/24),deprecations:check, audit unchanged (126).