Skip to content

Commit e5ceffb

Browse files
committed
docs: widened family and Layer RIn in the jury seam section
1 parent b65fb57 commit e5ceffb

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,15 @@ pick back here to render through this plugin's own templates:
327327
```
328328
│ ◈ Forgot to provide: Greeter | Database
329329
│ ⚡ Jev: .pipe(Effect.provide(AppLive))
330-
│ ↳ layer AppLive 0.99 · where here 0.60
330+
│ ↳ this expression is the program boundary · 0.99
331+
```
332+
333+
A `Layer` missing its own `RIn` gets `Layer.provide(X) inside this layer`.
334+
A channel that is only `unknown` has no service to name, so the "annotate
335+
the effect to find where R widened" line becomes the place itself:
336+
337+
```
338+
│ ⚡ Jev: annotate steps (src/jobs.ts:145), where R widened
331339
```
332340

333341
It also replaces the TS2769 overload heuristic when Jev is confident about
@@ -369,14 +377,18 @@ require("effect-error-pretty.parse").parse(message, { effect = true })
369377
-- Seams for an external judge (this is what jury.nvim registers into).
370378
-- The resolver runs inside vim.diagnostic's formatter: synchronous, fast.
371379
pretty.set_hint_resolver(function(parsed, family, names, diagnostic)
372-
-- family is "services" or "errors"; return nil for the generic hint, or
373-
-- { label = "Jev", line = "...", detail = "..." } to replace it, or
374-
-- { lean = "..." } to keep it and add a line underneath.
380+
-- family is "services", "errors" or "widened"; return nil for the generic
381+
-- hint, or { label = "Jev", line = "...", detail = "..." } to replace it,
382+
-- or { lean = "..." } to keep it and add a line underneath.
383+
-- "services" with parsed.tag == "layer" is a Layer's missing RIn.
384+
-- "widened": names[1] is the channel label (R, RIn or E) that is only
385+
-- unknown/any; the job is to say which definition lost its type.
375386
end)
376387
pretty.set_overload_picker(function(msg, candidates) return index_or_nil end)
377-
pretty.hint_family(parsed) -- "services"|"errors"|nil, names
388+
pretty.hint_family(parsed) -- "services"|"errors"|"widened"|nil, names
378389
pretty.templates.provide(layer, names, where)
379390
pretty.templates.unhandled(fix, names, target)
391+
pretty.templates.widened(label, name, file, line)
380392
```
381393

382394
## Extending

0 commit comments

Comments
 (0)