Skip to content

Commit 3bb62a7

Browse files
committed
docs: add preview section with 5 representative rendered scenarios
Adds a `## Preview` section between `## Why` and `## Features` showing how each common Effect-related diagnostic renders in the float. Scenarios covered: - Unhandled errors (E channel) — compact box with Effect.catchTags hint - Wrong success type (A) — compact box with Got/Expected for A - Scope required — Scope-specific title and Effect.scoped hint - Multi-channel diff — full tri-channel view when 2+ channels diverge - Layer — ROut widening — Layer-specific channel labels and hints Each example uses the same input shape as the scenarios in the lab file used for local verification, so the README stays honest about what the plugin actually produces.
1 parent d4383f0 commit 3bb62a7

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,88 @@ This plugin parses the error, figures out which channel (A, E, or R) actually di
2727
╰─
2828
```
2929

30+
## Preview
31+
32+
More scenarios the plugin recognizes, shown as they render in the float.
33+
34+
### Unhandled errors (forgot `Effect.catchAll` / `catchTags` / `orDie`)
35+
36+
```
37+
╭─ ⚠ Effect — Unhandled Errors
38+
│
39+
│ ⚠ Not in E channel: NetworkError | ParseError
40+
│ ⚡ Hint: .pipe(Effect.catchTags({...})) or Effect.orDie
41+
│
42+
│ Got: Effect<User, NetworkError | ParseError, Http>
43+
│ Expected: Effect<User, never, Http>
44+
╰─
45+
```
46+
47+
### Wrong success type (A)
48+
49+
```
50+
╭─ ⊘ Effect — A Mismatch
51+
│
52+
│ ✗ Got A: User
53+
│ ✓ Expected: string
54+
│
55+
│ Got: Effect<User, NetworkError | ParseError, Http>
56+
│ Expected: Effect<string, NetworkError | ParseError, Http>
57+
╰─
58+
```
59+
60+
### Scope required
61+
62+
`Scope` is detected specifically so the hint suggests `Effect.scoped` instead of a generic `Effect.provide`.
63+
64+
```
65+
╭─ ◈ Effect — Scope Required
66+
│
67+
│ ◈ Forgot to provide: Scope
68+
│ ⚡ Hint: wrap in Effect.scoped(...) — Scope is required
69+
│
70+
│ Got: Effect<string, never, Scope>
71+
│ Expected: Effect<string, never, never>
72+
╰─
73+
```
74+
75+
### Multi-channel diff
76+
77+
When two or more channels diverge at once, the compact boxes step aside for a full tri-channel view with all annotations stacked at the bottom.
78+
79+
```
80+
╭─ ⊘ Effect Mismatch
81+
│
82+
│ ✗ Got:
83+
│ A: void
84+
│ E: NetworkError | ParseError | DbError
85+
│ R: Http | Database | Logger
86+
│
87+
│ ✓ Expected:
88+
│ A: void
89+
│ E: never
90+
│ R: never
91+
│
92+
│ ◈ Forgot to provide: Http | Database | Logger
93+
│ ⚠ Unhandled errors: NetworkError | ParseError | DbError
94+
╰─
95+
```
96+
97+
### Layer — ROut widening
98+
99+
Layer mismatches get their own channel labels (`ROut / E / RIn`) and a `Layer.provide` / `Layer.merge` hint.
100+
101+
```
102+
╭─ ⊘ Layer — ROut Mismatch
103+
│
104+
│ ✗ Got ROut: Database | Http
105+
│ ✓ Expected: Database
106+
│
107+
│ Got: Layer<Database | Http, never, never>
108+
│ Expected: Layer<Database, never, never>
109+
╰─
110+
```
111+
30112
## Features
31113

32114
**Effect-specific**

0 commit comments

Comments
 (0)