Commit 1e7cb46
authored
feat(lsp): add loading indicators for registry data fetching (#45)
* feat(lsp): add LoadingState tracking to DocumentState
Add loading state infrastructure for tracking registry data fetch status.
This provides the foundation for loading indicators in editors.
Changes:
- Add LoadingState enum (Idle, Loading, Loaded, Failed)
- Add loading_state and loading_started_at fields to DocumentState
- Implement set_loading(), set_loaded(), set_failed() state transitions
- Add loading_duration() for elapsed time tracking
- Export LoadingState from document module
Testing:
- 13 unit tests covering all state transitions
- Concurrent mutation safety test
- Idempotency and edge case tests
- Timer reset behavior verification
* feat(lsp): add LSP progress notifications for registry fetching
Add RegistryProgress struct implementing window/workDoneProgress protocol
to show visual loading indicators in editors during version fetching.
- Add progress.rs module with RegistryProgress for progress lifecycle
- Track client capabilities to check work done progress support
- Integrate progress notifications into document open/change handlers
- Graceful degradation for clients without progress support
- Safe Drop implementation with cleanup task for incomplete progress
* feat(lsp): add inlay hints loading fallback for unsupported editors
Add LoadingState to deps-core and loading indicator configuration
for editors without LSP progress notification support.
- Move LoadingState enum to deps-core with comprehensive docs
- Add LoadingIndicatorConfig with loading_text validation (max 100 chars)
- Update EcosystemConfig with loading_text and show_loading_hints
- Update Ecosystem trait generate_inlay_hints with loading_state param
- Add loading hint display logic in lsp_helpers
- Update all 4 ecosystem implementations
- Add comprehensive unit tests for LoadingState and loading hints
* test(lsp): add comprehensive loading indicator E2E tests
Add 22 end-to-end integration tests for loading indicator feature
covering lifecycle, configuration, concurrency, and edge cases.
- Add loading state lifecycle tests for cargo ecosystem
- Add configuration integration tests (defaults, custom, disabled)
- Add loading text validation tests (truncation at 100 chars)
- Add concurrent document loading tests
- Add timeout scenario and race condition tests
- Add Drop cleanup logic verification test
- Fix feature flag scope on ecosystem-specific tests
* fix(lsp): enable incremental progress updates during version fetching
Refactor fetch_latest_versions_parallel() to use stream-based processing
with buffer_unordered() instead of join_all(). This allows sending
progress updates after each dependency fetch completes.
- Add progress parameter to fetch_latest_versions_parallel()
- Use AtomicUsize counter to track completed fetches
- Call progress.update(count, total) after each fetch
- Limit concurrency to 10 parallel requests
* fix(lsp): show inlay hints immediately after progress completes
Move inlay_hint_refresh() call before generate_diagnostics_internal()
so hints appear immediately after loading, without waiting for the
slower diagnostics generation which makes 2 network calls per
dependency (get_versions + get_latest_matching).
Before: Progress → Diagnostics (30s for 100 deps) → Hints
After: Progress → Hints (instant) → Diagnostics (background)
Performance improvement: 300x faster inlay hints display (30s → 100ms)
* test(lsp): add notification capture infrastructure and ordering tests
Extend LspClient to capture LSP notifications instead of discarding them,
enabling tests that verify notification ordering.
- Add CapturedNotification struct with timestamp and sequence number
- Implement notification capture in read_response()
- Add helper methods: get_notifications(), find_notification(), flush_notifications()
- Add workspace.inlayHint.refreshSupport to client capabilities
- Add notification_ordering.rs with ordering verification tests1 parent fbeacb2 commit 1e7cb46
File tree
20 files changed
+2227
-35
lines changed- crates
- deps-cargo/src
- deps-core/src
- deps-go/src
- deps-lsp
- src
- document
- handlers
- tests
- common
- deps-npm/src
- deps-pypi/src
20 files changed
+2227
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| 396 | + | |
| 397 | + | |
394 | 398 | | |
395 | 399 | | |
396 | 400 | | |
| |||
401 | 405 | | |
402 | 406 | | |
403 | 407 | | |
| 408 | + | |
404 | 409 | | |
405 | 410 | | |
406 | 411 | | |
| |||
424 | 429 | | |
425 | 430 | | |
426 | 431 | | |
| 432 | + | |
| 433 | + | |
427 | 434 | | |
428 | 435 | | |
429 | 436 | | |
| |||
434 | 441 | | |
435 | 442 | | |
436 | 443 | | |
| 444 | + | |
437 | 445 | | |
438 | 446 | | |
439 | 447 | | |
| |||
457 | 465 | | |
458 | 466 | | |
459 | 467 | | |
| 468 | + | |
| 469 | + | |
460 | 470 | | |
461 | 471 | | |
462 | 472 | | |
| |||
467 | 477 | | |
468 | 478 | | |
469 | 479 | | |
| 480 | + | |
470 | 481 | | |
471 | 482 | | |
472 | 483 | | |
| |||
490 | 501 | | |
491 | 502 | | |
492 | 503 | | |
| 504 | + | |
| 505 | + | |
493 | 506 | | |
494 | 507 | | |
495 | 508 | | |
| |||
500 | 513 | | |
501 | 514 | | |
502 | 515 | | |
| 516 | + | |
503 | 517 | | |
504 | 518 | | |
505 | 519 | | |
| |||
522 | 536 | | |
523 | 537 | | |
524 | 538 | | |
| 539 | + | |
| 540 | + | |
525 | 541 | | |
526 | 542 | | |
527 | 543 | | |
| |||
532 | 548 | | |
533 | 549 | | |
534 | 550 | | |
| 551 | + | |
535 | 552 | | |
536 | 553 | | |
537 | 554 | | |
| |||
554 | 571 | | |
555 | 572 | | |
556 | 573 | | |
| 574 | + | |
| 575 | + | |
557 | 576 | | |
558 | 577 | | |
559 | 578 | | |
| |||
565 | 584 | | |
566 | 585 | | |
567 | 586 | | |
| 587 | + | |
568 | 588 | | |
569 | 589 | | |
570 | 590 | | |
| |||
736 | 756 | | |
737 | 757 | | |
738 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
739 | 803 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
130 | 136 | | |
131 | 137 | | |
132 | 138 | | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
135 | | - | |
| 142 | + | |
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
| |||
249 | 256 | | |
250 | 257 | | |
251 | 258 | | |
| 259 | + | |
252 | 260 | | |
253 | 261 | | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
257 | 265 | | |
| 266 | + | |
258 | 267 | | |
259 | 268 | | |
260 | 269 | | |
| |||
350 | 359 | | |
351 | 360 | | |
352 | 361 | | |
| 362 | + | |
| 363 | + | |
353 | 364 | | |
354 | 365 | | |
355 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
0 commit comments