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

Aperta
#99 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
devtools

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Java
Stelle
9
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lsfusion/plugin-idea

Tutte le issue di lsfusion/plugin-idea

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.