lsfusion_find_elements: finish a module-name search promptly and report unknown IDEA module names in `scope`

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

Chưa có ai nhận issue này.

Đá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
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
devtools

Hướng nghiên cứu

Trace how names searches with elementTypes = "module" build their search scope and apply the name filter, then inspect how scope resolves IDEA module names. Reproduce the full-name search and an unknown scope with the examples in the issue. Done means full-name searches return promptly with all matching modules, and unresolved scope names are reported clearly.

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

Mô tả

bug
Description

Two behaviours of names searches on a large multi-module project (plugin 1.0.315, a workspace of about 30 IDEA modules):

  1. A search supplied with a module's full name — names = "<ModuleName>", elementTypes = "module" — without scope returns the module, but only after the whole time budget is spent: the answer carries "meta": "too long - timeout hit" even with timeoutSeconds = 30, and the same with scope = "project". With scope = "<the IDEA module that holds the file>" the answer is immediate. The time such a search takes should not depend on the size of the project.

  2. scope is project, project and libraries or a comma-separated list of IDEA module names. A name that is not an IDEA module (for example, an lsFusion module name or a Maven artifact id) is skipped silently; when none of the listed names is an IDEA module, the search scope is empty and the tool answers {"items": []}, which cannot be told apart from "the element does not exist".

names = "MyModule", elementTypes = "module", minSymbols = 0, timeoutSeconds = 30
-> 1 item, "meta": "too long - timeout hit"             (about 27 s)
names = "MyModule", elementTypes = "module", scope = "my-idea-module", minSymbols = 0
-> 1 item                                                (immediate)
names = "MyModule", elementTypes = "module", scope = "no-such-idea-module", minSymbols = 0
-> {"items": []}
Reason

An agent that looks a module up by name reads the timeout flag as "the search is incomplete" and falls back to a text search, and reads the empty answer under a wrong scope as "no such module". The report that prompted this issue did exactly that and located the module by file instead.

Fix
  • A search supplied with a full module name completes promptly and still returns every match the name filter allows (the filter matches by occurrence of the name, so other modules whose names contain it are returned as well).
  • A scope whose IDEA module names match nothing is rejected with an error naming the unknown names, or the unresolved names are reported in meta.
Ngôn ngữ chính
Java
Star
9
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 lsfusion/plugin-idea

Tất cả issue của lsfusion/plugin-idea

Issue tương tự

Thêm issue về Java

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.