Commit 2ae4e5f
fix(lint-framework): coalesce lint requests dropped while one is in flight
`requestLintUpdate` used `lintRequested` as a single-flight mutex, but a
request arriving while one was in flight was discarded rather than queued.
The default delay is 0, so there is no debounce to coalesce them either. A
burst of input could therefore leave the rendered lints belonging to a stale
prefix of the text, recovered only by the 1000ms safety-net timer.
That staleness is invisible on screen, because `remapLintToCurrentSource`
keeps the highlight correctly positioned. It is not invisible to the ignore
path: `LintContext` hashes the tokens following a lint, so a lint computed
against a prefix carries a `context_hash` that never matches the one derived
from the final text. Dismissing such a lint records a hash that matches
nothing, and the highlight comes straight back and stays.
Track a `lintDirty` flag and re-run once after the in-flight pass releases
the mutex. The re-run must happen after that release, or it hits the same
guard and is dropped in turn.
Also wrap the lint in try/finally. A rejected `lintProvider` previously left
`lintRequested` stuck at true, permanently stopping all linting.
Refs #3911
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Entire-Checkpoint: b3fb753869901 parent 0262582 commit 2ae4e5f
1 file changed
Lines changed: 49 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
160 | 166 | | |
161 | | - | |
| 167 | + | |
162 | 168 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
172 | 178 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
181 | 187 | | |
182 | | - | |
183 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
184 | 191 | | |
185 | 192 | | |
186 | | - | |
187 | 193 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
195 | 211 | | |
196 | | - | |
| 212 | + | |
| 213 | + | |
197 | 214 | | |
198 | 215 | | |
199 | 216 | | |
| |||
0 commit comments