theme-language-server: checks get dropped while a forced runChecks is pending

Đang mở
#1,385 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@efegokdemir đang làm issue này rồi.

Từ ngày 12/11/2026.

  • #1397 của @efegokdemir — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
devtools

Hướng nghiên cứu

Start with src/utils/debounce.ts and trace how runChecks passes trigger URIs through normal and forced calls. Check the debounce tests and the language server call sites to see how multiple roots are handled. Done means pending checks are retained across calls and diagnostics arrive for every affected file; add or update tests for the reported timing cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi! We run our own language server on top of startServer from @shopify/theme-language-server-common, and we noticed that sometimes an open file just never gets diagnostics until you edit it again.

I tracked it down to debounce in src/utils/debounce.ts. Once runChecks.force(...) has been called, every other call is ignored until that forced run has finished (if (timeoutId !== null && force) return;). And since only the arguments of the last call are kept, a normal call made within 100 ms of another one also replaces it.

So you can lose a check in a few ways:

  • A file is opened while a forced run is waiting or running (for example right after a watched file changed). If the forced run already read its theme, that new file isn't in it, and its own request was ignored. No diagnostics.
  • Two files from two different themes (two roots in the workspace) are opened within 100 ms. Only the second one gets checked.
  • A forced call replaces a normal call that was still waiting.

It's easy to hit when the editor restores several tabs at startup while something on disk is changing.

What fixed it for us was keeping a set of all the trigger URIs from every call, forced or not, and passing all of them to the next run, instead of keeping only the last call. Happy to open a PR if that sounds like the right direction.

We reproduced it on 2.21.2, and the code on main looks the same.

Ngôn ngữ chính
TypeScript
Star
245
Fork
108
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Shopify/theme-tools

Tất cả issue của Shopify/theme-tools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.