Maintained engine: the first completion in a just-opened module importer waits for its first preamble
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- devtools, performance
Direzione di ricerca
The first-completion wait comes from patch 0008, which switches code completion to TUScheduler::Stale in modules mode, so start from that change and the StaleOrAbsent path it replaces. The issue describes three possible improvements, and the work requires choosing one, either a bounded wait of about 800 ms, a persistent validation memo, or prioritizing the edited file in the prime pool. Done means a decision recorded on the issue, and any change verified against the ux-xlings U5 typing checks.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Symptom
With the maintained engine (mcppls-clangd 0.0.12, 23.1.0-mcppls.0), completion in a module importer that was just opened waits for the file's first preamble. That takes several seconds on a real project. For example, in xlings src/core/xself/doctor.cpp the first build of about 100 prerequisite modules takes about 3.3 s locally and longer on CI runners. Until the preamble exists, each completion runs past the server's 1 s budget and mcppls's own engine answers it. After that, completion answers in 35–390 ms.
Stock clangd 23.1 answers at once in that window, from its fallback without a preamble. That fallback leaves out imported declarations, and after ., -> or :: it is empty (the 0.0.11 "popup never came" report).
Cause
This is intended engine behavior. In modules mode, mcppls-clangd's code completion runs on TUScheduler::Stale instead of StaleOrAbsent (patch 0008, the "first module completion" change of UP-25), so a first completion waits for the first preamble instead of giving an import-blind answer.
Measured locally on the same workspace, warm cache, 40 s of 10 Hz typing (ux-xlings U5):
| completions during the first preamble | after it | |
|---|---|---|
| stock 23.1 | 7–16 ms (fallback) | p95 ≈ 0.2 s |
| mcppls-clangd 0.0.12 | 1.4–6.3 s (past the 1 s budget, answered by mcppls) | 35–390 ms |
Decision for 0.0.12
The wait on first open is accepted. The ux typing checks now report it as their own "first-open" measurement and hold p95 and engine share to the unchanged budgets for the completions after the engine's first answer.
To improve later
- A bounded wait: wait for the first preamble up to a budget (about 800 ms), then answer as upstream does and let the semantic answer follow.
- A faster first preamble on a warm cache: the BMIs are all reused, and the time goes to validating each prerequisite again. A validation memo that persists across processes, keyed by the same exact inputs, would remove most of it.
- Priority for the edited file: at startup, prime units' prerequisite work shares the bounded build pool with the file being typed in. The focused file should go first.
- Lingua principale
- C++
- Stelle
- 25
- Fork
- 2
- Merge medio
- 21h 5m
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Sunrisepeak/mcpp-language-server
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sunrisepeak/mcpp-language-server#80 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Sunrisepeak/mcpp-language-server#66 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
Sunrisepeak/mcpp-language-server#77 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Sunrisepeak/mcpp-language-server#71 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
Sunrisepeak/mcpp-language-server#59 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Sunrisepeak/mcpp-language-server
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
xiaoyifang/goldendict-ng#3148 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
triton-inference-server/server#9069 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 4 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100